• Unable to create CTools CSS cache directory. Check the permissions on your files directory.
  • Unable to create CTools CSS cache directory. Check the permissions on your files directory.


Quickly Identify Columns with Mismatched Data Types
Here's a utility that you can use to quickly find which columns have mismatched data types across tables in a SQL Server 2008 or SQL Server 2005 database. Correcting these columns can improve performance and data integrity.
Find Out What's Going On Inside Your Partitions 1
SQL Server Management Studio (SSMS) lacks an easy-to-use tool to get detailed data about partitioned tables. To fill this gap, a reader has created two tools. One provides the data in a results grid, whereas the other provides the data in a report.
Update Rows in Large Tables Without Locking Out Users
You can use the TOP clause to limit the transaction size, but there's a trick to using it: You need to keep track of which rows have already been updated so that you don’t update them a second time. Here's how to keep track of the rows.
Get Rid of Gaps in Numerical Sequences
Although companies might want integer sequences in database applications to be gapless, gaps occur frequently. Here's a solution that you can use to eliminate existing and avoid new gaps.
Find Any String in Any SQL Code in Any Database 2
This T-SQL stored procedure searches all the databases on your server for the string you specify and returns a list of the objects that contain it.
Find and Replace Keywords in Stored Procedures 4
Having to modify stored procedures when an object name changes can be tedious. Here's a T-SQL stored procedure that eliminates the tedium from this task.
Nifty Ways to Use FOR XML PATH Concatenation 1
No temporary tables or table variables are needed to perform FOR XML PATH concatenation, so the resulting query is not only fast but also high performing.
Adventures with Big Data: How to Import 16 Billion Rows into a Single Table 1
If you have a lot of data to import into or export out of a SQL Server table, here are some tips that can save you a lot of time and aggravation.
T-SQL Function Finds Almost Any Kind of Date 10
This user-defined function is flexible and easy to maintain because it uses a matrix and simple math to locate the date you need.
Strim Strips Out Non-Alphanumeric Characters 3
Although SQL Server offers a variety of string functions, it doesn't have a function that strips out non-alphanumeric characters. Here's a user-defined function to fill that gap.
Tracking for Your SQL Server Agent Jobs
It used to be difficult to answer questions such as "When was the last time this job was run?" and "What jobs will be affected if we bring down the system for maintenance?" With the cspJobMonitor procedure that's no longer the case.
Enforce Uniqueness Without the Unique Constraint 8
If you've ever come across the problem of hitting the 900-bytes limitation for unique constraints, you'll want to check out this simple solution.
Row-Concatenation Solutions Aren't All Equal 2
A reader's tests reveal that although various row-concatenation solutions produce the same results, the time it takes to get those results can vary significantly.
Keep Track of Your Backups
The procedure cspBackupListing can list your databases’ most current backups, back up databases with previous backups older than 24 hours, or list all the backups for a database.
Display Dates in the Format You Need 4
If you often need to display the current date in different formats, you know that it can take a lot of code and effort. The FormatDate function changes that. By providing just two parameters, you can display any date in the format you need.

Digital Magazine Archives

Browse back issues of SQL Server Pro, from January 2007 through the last issue published in April 2014. Find the back issues here.


From the Blogs
Sep 29, 2015

Data Breaches and Insider Threats

I’ll sound a bit like Captain Obvious for bringing this up, but it’s important to remember that security encompasses a lot more than protecting sensitive data from the specter of outsider threats like hackers. Properly implemented security policies also account for threat-models that include insiders – or people within your organization....More
Sep 15, 2015

Setting Up Additional Checks to Ensure Regular Transaction Log Backups 1

There’s simply no way to overstate the importance of regular Transaction Log Backups. Not only do they help protect from disaster, but regular execution of T-Log backups on Full (and Bulk-Logged) Recovery databases helps keep thing “fit and trim”. Most of the time, setting up a Notification for when T-Log Backup Jobs fail is enough to let you know when something goes wrong....More
Sep 1, 2015

Stop Using INFORMATION_SCHEMA and SysObjects for Exists Checks 3

Code like this isn’t optimal: IF EXISTS(SELECT * FROM sys.objects WHERE name = N'TableToDrop' AND type = 'U')         DROP TABLE TableToDrop; GO Neither is this: IF EXISTS(SELECT TABLE_NAME FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 'TableToDrop')         DROP TABLE TableToDrop; GO Yet, I see both of those used all of the time – over and over again. Even though it’s 2015.  ...More
SQL Server Pro Forums

Get answers to questions, share tips, and engage with the SQL Server community in our Forums.

Sponsored Introduction Continue on to (or wait seconds) ×