In database planning and design it is essential to plan out how much HD space you are going to need to store your data. If you use BOL and do a search for "Estimating Table Size" you get three articles: - Estimating the size of a table - Estimating the size of a table with […]
2006-06-21 (first published: 2006-06-13)
518 reads
Move all (or chosen) standard indexes from your primary file group to a secondary file group (hopefully located on a seperate array)excludes clustered indexes, statistics and indexes associated with a primary keywhen you run it - set the debug to 1 to identify what the script will move, set it to 0 to actually perform […]
2006-06-19 (first published: 2005-07-08)
5,452 reads
This procedure will compare the two tables Table1 & Table2 and will display the value which is present in Table1 but not present in Table2.
2006-06-15 (first published: 2006-05-30)
430 reads
After replying to a post today I thought I'd share this with all.This is a user defined function that I use to return a table of parameters passed in a parameter string. Function UsageSelect * From dbo.fnParseParamString ([@ParamString='Delimited String of parmaters'],[@Delimeter='Delimiting Character'])Lets say you are concatenating a list of form data from a web page […]
2006-06-13 (first published: 2006-06-07)
372 reads
The following T-SQL query batch will show you which tables was changed since last execute. Tracking information: (1) changes row count /insert,update,delete/; (2) changes IDENTITY value; (3) changes physical allocations /used pages/; (4) added new tables; (5) dropped tables. The batch must be initialized before using (at least once executed). I use this batch to […]
2006-06-12 (first published: 2006-06-08)
747 reads
I was going through the painfull optimization of the database of creating better clustered indexes (not the default ones on the primary key).This operation was requiring removing all foreign keys to this table and then recreation them again.I created this script to optimize this quite tidious task.
2006-06-08 (first published: 2005-07-22)
746 reads
A script to test your database for 2005 readiness.these features are as described by the SQL 2000 BPA, however this script will run on SL 6.5,7,2000Please note that this is not a guarantee of readiness, however it is an indication that there are issues you may have to resolve to run your databases in 2005
2006-06-02 (first published: 2005-07-12)
841 reads
You recently published a script showing how to do pagination (e.g. results 20 - 30 of 100) It's also possible to do it quicker and more elegantly without having to resort to building the sql string dynamically (never a good thing IMHO). You pass in 2 parameters, @PageIndex is the first record you want (so […]
2006-05-31 (first published: 2006-05-24)
1,284 reads
INITCAP returns char, with the first letter of each word in uppercase, all other letters in lowercase. Words are delimited by white space or characters that are not alphanumeric.
2006-05-29 (first published: 2003-07-02)
647 reads
This is the basic structure of how to dynamically create a pivot table recordset for SQL 2000. In this example, I am using SUM, but it could just as easy be COUNT or any other aggregate function.
2006-05-26 (first published: 2006-05-08)
1,861 reads