Categories
- Active Directory
- Apache
- ASP.Net
- Attributes
- Batch Files
- C#
- FireFox
- Generics
- IIS
- Internet Explorer
- JavaScript
- jQuery
- LINQ
- Microsoft AJAX
- Microsoft Office
- Microsoft TechNet
- MS Build
- MS SQL Server
- MVC
- Regular Expressions
- SSIS
- Subversion
- T-SQL
- Team Foundation Server
- This and that
- Visual Studio
- WCF
- Web Services
- Windows 7
- Windows Server 2008 R2
- WinForms
- WordPress
Archives
- January 2012
- October 2011
- September 2011
- August 2011
- June 2011
- April 2011
- March 2011
- February 2011
- January 2011
- December 2010
- November 2010
- October 2010
- September 2010
- August 2010
- July 2010
- June 2010
- May 2010
- April 2010
- March 2010
- February 2010
- January 2010
- December 2009
- November 2009
- October 2009
- September 2009
- August 2009
- July 2009
- June 2009
- May 2009
- April 2009
- March 2009
- February 2009
- January 2009
- December 2008
- November 2008
- October 2008
- September 2008
- August 2008
- July 2008
- June 2008
- May 2008
- April 2008
- March 2008
- February 2008
- January 2008
- December 2007
- November 2007
- October 2007
- September 2007
- August 2007
- July 2007
- June 2007
- May 2007
- April 2007
- March 2007
- February 2007
- January 2007
- December 2006
- November 2006
- October 2006
- September 2006
- August 2006
- July 2006
- May 2006
- March 2006
- January 2006
Meta
Category Archives: MS SQL Server
SSIS: Use Two OLE DB Destination Adapters to Catch Insertion/Constraint Errors
If you are using SQL Server Integration Server (SSIS) packages to insert large volumes of data, you have undoubtedly encountered incorrectly formatted or typed data in your data source including precision errors, conversion errors, and primary key/foreign key constraint errors etc. To … Continue reading
Posted in MS SQL Server, SSIS
1 Comment
MS SQL Server: Quick T-SQL to Delete All User Table Data
Here’s a quick (hack) way to delete all user table data from a Microsoft SQL Server database using the undocumented procedure sp_MSforeachtable. As the name hints, this procedure repeats a SQL statement against all user tables within a database. This … Continue reading
Posted in MS SQL Server, T-SQL
Leave a comment
Creating a SQL CLR User Defined Function
Starting with SQL Server 2005, Microsoft added the awesome ability to reference .Net assemblies from your T-SQL procedures. Here’s a quick 5 step overview on how to get up and running with your code-based User Defined Function. 1) Create a … Continue reading
Posted in C#, MS SQL Server, T-SQL
Leave a comment
T-SQL: Backup All User Databases
Here’s an easy, generic way to back up all user databases on a SQL Server instance: DECLARE @name VARCHAR(50) — database name DECLARE @path VARCHAR(256) — path for backup files DECLARE @fileName VARCHAR(256) — filename for backup DECLARE @fileDate VARCHAR(20) — … Continue reading
Posted in MS SQL Server, T-SQL
Leave a comment
Shrinking your Transaction Log with SQL Server 2008 to Free Disk Space
If you have been used to clearing up disk space on your development and test SQL server instance file systems with SQL Server 2000 or SQL Server 2005 by using the famous TRUNCATEONLY option on your transaction logs, you might be … Continue reading
Posted in MS SQL Server, T-SQL
Leave a comment
Don’t get caught by ANSI PADDING, VARCHAR, and trailing whitespace!
One thing to be aware of when you have VARCHAR columns and are using ANSI PADDING: trailing whitespace is trimmed and not counted in your equality ( = / <> / LIKE) statements, so you might not get the results you are looking to be … Continue reading
Posted in MS SQL Server, T-SQL
Leave a comment
December 2009 IT Toolbox for TechNet Magazine
The December 2009 TechNet Magazine is on the website. Check out my IT Toolbox column here: December 2009 TechNet Magazine IT Toolbox In this issue I covered: Eraser: Eradicate Sensitive Information SQL Server Backup Pro from Red Gate: Streamline SQL … Continue reading
Posted in Microsoft TechNet, MS SQL Server
Leave a comment
T-SQL: Change Collation on your LIKE Clause Using COLLATE
Ever have trouble matching unicode letter equivalents in your T-SQL queries? For example, when you want “Québec” and “Quebec” to be equivalent in your text search query? This is where specifying Accent Insensative Collation (The “AI” in all those collation codes) comes … Continue reading
Posted in MS SQL Server, T-SQL
Leave a comment
T-SQL Hack to Turn a Set of Row Values into a Delimited String
Ever want to turn multiple rows into a comma separated list when you are querying your database? Here’s a quick way to get it done using “FOR XML PATH(”)”: DECLARE @comma_delimited_list VARCHAR(6000) SELECT @comma_delimited_list = ( SELECT productName + ‘,’ … Continue reading
Posted in MS SQL Server
Leave a comment
Quick Method of Finding Out What Version and Service Pack your SQL Server Instance is Running
If you are looking for a quick way to verify the service pack and version applied to your SQL server instance, try the following T-SQL: SELECT SERVERPROPERTY(’productversion’) AS productversion, SERVERPROPERTY(’productlevel’) AS productlevel, SERVERPROPERTY(’edition’) AS edition Hope this helps!
Posted in MS SQL Server
Leave a comment