Monthly Archives: January 2014

T-SQL: Disable Constraint Checks On All Tables With A Single Line Query

Microsoft’s “undocumented” but quite useful stored procedure, sp_msforeachtable, you can easily disable constraint checks on all tables in a database. Here’s how: EXEC sp_msforeachtable "ALTER TABLE ? NOCHECK CONSTRAINT all" To re-enable the checks after you are done, simply change … Continue reading

Posted in T-SQL | Leave a comment

.NET Calling Web Services: Look Out For The “connectionManagement/maxconnections” Setting

If you have an application making web service calls in parallel, you will want to change the maxconnection setting. By default, you will be limited to 2 concurrent connections per endpoint, so even you had 20 threads going, they would … Continue reading

Posted in ASP.Net, C#, Web Services | Leave a comment

T-SQL: Get Row Counts For Every Table In A Database

Here’s a quick way to get table row counts for all tables in a database using dynamic SQL, the built-in INFORMATION_SCHEMA.TABLES view, and the “magic” of “XML PATH(”)”:   DECLARE @TABLES TABLE (TableName NVARCHAR(1000))   INSERT @TABLES SELECT TABLE_SCHEMA + … Continue reading

Posted in T-SQL | Leave a comment