Davidsalt - davidsalt.com
General Information:
Latest News:
Rebuild fragmented indexes 18 Mar 2013 | 05:57 am
This query returns all the indexes that have fragmentation above 25%. Note it is recommended to rebuild all indexes that have fragmentation above 25% and to reorganize those that have fragmentation be...
Get Database file names from Backup 31 Oct 2012 | 02:45 am
Here is a simple way to determine the file names of the mdf and log files found within a database backup file. RESTORE FILELISTONLY FROM DISK = @file WITH FILE = 1
How to move or rename mdf files 22 Oct 2012 | 09:17 am
Here is the procedure should you need to need to move or rename your .mdf file. 1. Take the database offline USE master ALTER DATABASE MyDatabase SET OFFLINE GO 2. Rename or move your database (mdf) ...
How to Detach Multiple Databases 22 Oct 2012 | 05:21 am
Here is a script that will all you to detach multiple databases in SQL Server. Simply replace [MyName] with a database prefix and it will detail all the database starting with the given prefix. DECLAR...
Get Column Properties from a Table 18 Oct 2012 | 07:51 am
Another simple script that allows you to list all the columns and their properties in a database table USE [MyDatabase] DECLARE @databaseTable AS VARCHAR (100) SET @databaseTable = ‘TableName’ SELECT ...
Restore a database from a SQL Script 18 Oct 2012 | 07:33 am
Here is a simple script that will restore you database from a file location. Note that this script will move the data and log file to a specific location. This is handy when you are creating the datab...
DataContextProxy – The ability to bind to the parent control’s view model 18 Oct 2012 | 07:13 am
Here is a fantastic resource (thanks to Dan Wahlin) for those requiring a DataContextProxy to enable binding from templated controls back to the parent control. Note that this is no longer needed in S...
SQL ERROR: SQL72014 – Please create a master key in the database or open the master key in the session before performing this operation. 3 Aug 2012 | 12:11 pm
Creating a Certificate in SQL Server may cause issues if the master key has not already been set. Eg if you were to execute the following: CREATE CERTIFICATE [my_certificate] AUTHORIZATION [dbo] WITH ...
Make ‘Associate’ the default TFS checkin action in Visual Studio 13 Jul 2012 | 02:11 pm
This is we should very useful as I was accidently resolving issues when associating my code with a work item. Ideally we should be setting the default checkin behaviour on the server. However this is ...
Update AppSettings in Unit Tests 12 Jul 2012 | 10:30 pm
So I have a value that I wish to store in the appSettings of the configuration file. However my static helper is dependent on that value being present. If it is not there then I deliberately throw an ...