ADO.NET: Connection string to localhost
This is just a standard code snipplet to eliminate re-typing a conn string to my box.
Assumes your Windows login has all rights to the SQL Server via NT/Token Authentication.
(Written for .Net)
Create Index
Here's the syntax for creating an MSSQL Index on an existing field:
Delete Statement with Joins & Top function!
Here is one of those hairy delete SQL statements.
Here we are deleting from TABLE1 where pKey does NOT match Field1 in TABLE2. We want to delete in chunks, so the top option is used.
Restoring DTS Packages
A simple way to transfer your DTS packages from one server to another is as follows:
Using Restore Databse
(old MSDB on new server):
1. Make backup of source MSDB database.
2. Restore that backup as a new database on the destinati...
Transferring SQL Server Jobs
A simple way to transfer your SQL Jobs from one server to another is as follows:
1. Make backup of source MSDB database.
2. Restore that backup as a new database on the destination server. In this example, the database is restored as DTS_Recover...
Truncate a SQL Server Database Log
Have you ever run out of space while running a big transaction set? Here's how to free up your log file space.
NOTE: It is highly recommended to perform a backup of your database immediately BEFORE AND AFTER truncating the log files so you ...