Failure inserting into the read-only column
At times when transferring data from one database to other using either Import Export wizard or using SQL Server Integration Services, you may encounter the following error: Failure inserting into the read-only column .(SQL Server Import and Export Wizard) This...
Book Nuts and Bolts of Database Mirroring
Download the free Nuts and Bolts of Database Mirroring book by Saleem Hakani (Microsoft Corporation). Everything you need to know to configure, manage, and maintain database mirroring in your production environment. Bonus: Includes Disaster Recovery template that can...
Avoid Page Splits in SQL Server
Let’s say you have a glass filled with water and you try to put more water in that glass, what happens? Water in the glass will overflow. Exactly the same way, whenever a new row is added to a full index page, SQL Server moves around half of the rows to a new page to...
Tracking DML Changes without SQL Server Triggers
SQL Server supports an OUTPUT clause as a part of DML statements that can help you in tracking changes made during any DML operation. The OUTPUT clause can save the result set in a table or table variable. The functionality is similar to what triggers had...
Faster SQL Development using T-SQL Snippets
T-SQL Snippets allow you to quickly build T-SQL statements without having to remember the commands or its syntax. This helps in reduced development time and in increased productivity for developers and DBAs. Snippet templates were introduced in SQL Server 2012 and are...
Best Practices for Backing up Large Databases
In an ideal world, hard drives and other hardware never fail, software is never defective, users do not make mistakes, and hackers are never successful. However, we live in a less than perfect world and we should plan and prepare to handle adverse events. In todays...
Creating Sequential Numbers in SQL Server
There are many applications that require incremental numbers for maintaining unique rows in a table. For several years, we have been using IDENTITY() column as our primary option to generate incremental numbers for unique records or for Primary key values and it has...
Using MAXDOP to Speed Up Index Creation
Ever noticed that even though you have a beefy server, SQL Server index operations sometime takes time? There are many things that happen behind the scenes that could contribute to the slowness of index operations. Some of the reasons include: Load on SQL ServerOut of...
Pagination in SQL Server using Offset and Fetch
SQL Server offers new query hints that allow you to implement query paging solution. In the past, we’ve used TOP operator to return the top number of rows from a table, however, OFFSET & FETCH query clauses can give you more benefits than just...
Concatenating Strings in SQL Server using CONCAT
CONCAT() string function allows you to concatenate up to 255 string or variable values in to one single string. It requires a minimum of two input values when calling the function. CONCAT takes care of implicitly converting the data values to a string by following the...
Recent Comments