This script finds and renames columns that begin with a digit, contains a space, or contains a hyphen, so that it is no longer necessary to put brackets around the column names. This is useful in situations such as when an application doesn't automatically put brackets around column names when passing queries to a SQL […]
2006-04-12 (first published: 2006-03-24)
597 reads
In response to Sachinvaishnav's search for a better way to insert a sequence number column in the same table, I bring you a cursor free Sql server 2005 example that utilizes the new ROW_NUMBER() OVER(ORDER BY) Function available in 2005
2006-04-11 (first published: 2006-03-28)
108 reads
The following script creates a class to access the default stored procs created by a previous script I submitted called script to create default stored procs. Please note that this will only work correctly if the stored procs created by my earlier script (script to create default stored procedures) have been created. Have fun
2006-04-03 (first published: 2006-03-10)
282 reads
This is an update/improved version of my script that I'm pleased to see is rated in the top 10! It will script off all of your objects in your database and if they differ from the scripted version in your VSS db, automatically check it in. If the object does not exist in VSS, this […]
2006-03-30 (first published: 2005-03-04)
740 reads
The following script allows for the scripting of data into insert statement.The user only needs to set the tablename and a query for the data they require scripted and run.Note the script takes into account autonumber primary keys and removes them from the insert statement.Also Note that this script will only work on tables with […]
2006-03-29 (first published: 2006-02-15)
463 reads
Assume that you already have a table with 1000 rows. Now suppose, after some months, you feel a need to insert a sequence number column in the same table. Here is a script that I have worked out. If you have anyother better way then you are most welcome to comment on the same!
2006-03-28 (first published: 2006-02-16)
1,990 reads
Just plug this into your Query Analyser and play. This code is an easier way of converting currency to English which can be altered easily to suit your needs.I found that this script will help in avoiding the storage of Amount in Words everytime an amount is stored in applicatons that require the functionality.
2006-03-27 (first published: 2006-02-21)
386 reads
This script returns the main properties for all data files and log files in the current database including logical and physical file names, size, used space, and file growth parameter.
2006-03-24 (first published: 2006-02-25)
591 reads
A common problem in sql is how to calculate and process, for the current row, information that is based on the results (sum, product, difference, etc) of the rows read so far.A solution (we use) to this problem is to create a self join query based on the primary key using the condition of "greater […]
2006-03-23 (first published: 2006-03-02)
413 reads
This is an improved and expanded version of the previously posted script that moves indexes to a new file group. This version will:1. Create new filegrup and files for indexes2. Script out and recreate indexes on new drive3. NEW* output report to text file4. NEW* Will run with enclosed wrapper for ALL DATABASES ON THE […]
2006-03-22 (first published: 2006-03-02)
2,010 reads