Programming, SQL, Software, SQL Server 2008, SQL Server 2000, SQL Server 2005, Transact-SQL, tSQL, SQL Tips, Database, SQL Server 2012

SQL Server Error: Fixing The Transaction Log for Database is Full Due to log_backup

T-SQL
T-SQL

If you are working with SQL Server, you may see an ominous sounding error: the transaction log for database {Your Database Name} is full due to log_backup Continue reading “SQL Server Error: Fixing The Transaction Log for Database is Full Due to log_backup”

Advertisements
Programming, SQL, SQL Server 2008, SQL Server 2000, SQL Server 2005, Transact-SQL, tSQL, SQL Tips, Database, SQL Server 2012

TSQL Search for the Last Record in a Group

In this article I’ll show how to get the most recent record for a group of records in a SQL Server table. There are a number of ways to do this including CTEs and nested subqueries. Since nested subqueries are the most widely supported across the different versions of SQL Server, I consider them the most robust/straightforward way to get the job done, so in this article I will show you how to solve this problem using a nested subquery in either your WHERE or your FROM clause.

At the end of this article I’ll give the full working example Pet shop table and query that you can copy and paste into a SQL Server Management Studio (SSMS) session to try out the code for yourself.

If you find this article useful, be sure to check out my other SQL Server related articles for more tips.

Continue reading “TSQL Search for the Last Record in a Group”

Database, Programming, SQL, SQL Server 2000, SQL Server 2005, SQL Server 2008, SQL Server 2012, SQL Server 7, SQL Tips, Transact-SQL, tSQL

T-SQL to Enforce Proper Case Capitalization

Capitalize the First Letter of Each Word
Capitalize the First Letter of Each Word

This handy-dandy T-SQL query will take any input string and capitalize the start of each word within the string. It will also enforce proper use of lower-case throughout the string without affecting query performance too severely. This query assumes that you are working with titles, user names, or place names where you want to make sure that the first letter of each word is capitalized. Continue reading “T-SQL to Enforce Proper Case Capitalization”