- A SQL Read with NOLOCK, Causes a ALTER Table DDL statement to be Blocked or to Fail
- How to Get a SQL String Variable to be Larger Than 4000 Characters or 8000 Characters for Dynamic SQL
- Executing the same SQL statements against multiple servers and databases using SQL Server Management Studio, and Merging the Results
- SSIS Package Upgrade then error “Cannot use the OUTPUT option when passing a constant to a stored procedure”
- Blocked SQL Sessions and Blockers
Category Archives: SQL 2008
Executing the same SQL statements against multiple servers and databases using SQL Server Management Studio, and Merging the Results
Validated against: SQL Server: 2008 R2. If you need to apply the same SQL statements against multiple servers and databases, this can be accomplished using SQL Server Management Studio (version 2008 onwards). Simply with the Registered Servers window, select the … Continue reading
Validated against: SQL Server 2005, 2008, 2008 R2. Below is a SQL script that returns SQL sessions waiting (blocked) for one second or more, and also the associated SQL sessions that are doing the actual blocking. The script returns pretty … Continue reading
Validated against: SQL Server 2005, 2008, 2008 R2.
Validated against: SQL Server 2005. Updating statistics against each table in the current database by using the undocumented stored procedure [sp_MSforeachtable].
Validated against: SQL Server 2005. Just performed a quick Google of the various methods of acquiring a list of sequential numbers and recommend the approach by Itzik Ben-Gan. The approach uses a small footprint of code and allows numbers up … Continue reading
When benchmarking disk subsystems, I generally benchmark against the most challenging task; which is random writes, with no buffering! The tool I use is the Microsoft SQLIO tool that measures IO performance. The SQLIO tool can be acquired from: http://www.microsoft.com/download/en/details.aspx?displaylang=en&id=20163 … Continue reading
Create a duplicate structure of the table concerned and build an IGNORE_DUP_KEY index over the second table that includes all the original table candidate keys and insert rows into it. forename surname age ————— ————— ———– David Selwood 40 Paul … Continue reading
Syntax for CAST: CAST ( expression AS data_type [ (length ) ]) Syntax for CONVERT: CONVERT ( data_type [ ( length ) ] , expression [ , style ] ) CONVERT is specific to SQL Server, and allows for a … Continue reading
In order to force the contents of the screen buffer to be outputted staight away please use the following SQL: