I recently received one big file with many T-SQL batches. It was a very big file and I was asked that this file was tested many times and it can run one transaction. I noticed the separator of the batches is not GO but it was EndBatch. I have followed two options to run the whole batch in one transaction. Let us learn how to change T-SQL Batch Separator.
SQL SERVER – Disable Index – Enable Index – ALTER Index
There are few requirements in real world when Index on table needs to be disabled and re-enabled afterwards. e.g. DTS, BCP, BULK INSERT etc. Index can be dropped and recreated. I prefer to disable the Index if I am going to re-enable it again. USE AdventureWorks GO ----Diable Index ALTER INDEX [IX_StoreContact_ContactTypeID]…
Read MoreSQLAuthority News – Limited Edition T-Shirts Arrived
I have received quite a few request for SQLAuthority.com T-shirts. Every day I receive lots of emails and suggestions. Many readers have great suggestions and have helped to improve content. First of all I express my gratitude to all of you. Few of my loyal and enthusiastic readers will receive…
Read MoreSQL SERVER – Binary Sequence Generator – Truth Table Generator
Run following script in query editor to generate truth table with its decimal value and binary sequence. The truth table is 512 rows long. This can be extended or reduced by adding or removing cross joins respectively. Script: USE AdventureWorks; DECLARE @Binary TABLE ( Digit bit) INSERT @Binary VALUES (0)…
Read MoreSQL SERVER – DBCC commands List – documented and undocumented
Database Consistency Checker (DBCC) commands can gives valuable insight into what’s going on inside SQL Server system. DBCC commands have powerful documented functions and many undocumented capabilities. Current DBCC commands are most useful for performance and troubleshooting exercises. To learn about all the DBCC commands run following script in query…
Read More