This is an algorithm from the september 1986 issue of Byte Magazine, in an article called Abstract Mathematical Art. It borrows from Tim Conways Game of Life to represent an algorithm by which a series of numerical values can attempt to replicate itself. It is deeply steeped in the philosophy of Caos Theory and Evolution, […]
2006-08-28 (first published: 2006-07-27)
326 reads
Inspired in the script submited by ramesh_kondaparthy , this is a set oriented solution for the same problem.Parameters: 1) @InputString varchar(25)Accepts the string, which we need to validate 2) @Type int = 0 validate the string for only alphanumeric charactersi.e Allows characters between [A-Z] ,[a-z] and [0-9] = 1 validate the string for alphanumeric and […]
2006-08-22 (first published: 2006-08-01)
3,979 reads
Trigger to insert date into table in the form of01/01/00 12:00:00instead of SQL standard date format2000-01-01 12:00:00.000This allows easily comparing to or updating based onOracle date formats or a readable format for the web.triggername - name of the triggerTABLENAME - name of the table that trigger is created onCOLUMNNAME - name of column in TABLENAME […]
2006-08-21 (first published: 2006-08-01)
472 reads
Script to Get Total Rows, space used and reserved (KB) of all tables
2006-08-18 (first published: 2006-08-01)
1,087 reads
Here's a sample script to help you get some generic mode, median, and mean statistics for something. In my example, I'm getting the number of days something takes to start and stop some task. The idea is that I'd have a fairly short list of jobs, and record would record the job id, and start/stop […]
2006-08-17 (first published: 2006-08-02)
1,059 reads
This function returns the SQL Build Number as a nvarchar(20) string. i.e. '8.00.760' @@Version is great, but super long, and the formatting of the string has changed over the years. This helps me find out what build of SQL I'm working on in a quick and efficient manner. The script includes the drop statement as […]
2006-08-09 (first published: 2006-06-23)
1,015 reads
This function returns the SQL Build Number as an int. i.e. 7, 8, or 9. @@Version is great, but super long, and the formatting of the string has changed over the years. This helps me find out what version of SQL I'm working on in a quick and efficient manner. The script includes the drop […]
2006-08-08 (first published: 2006-06-23)
1,229 reads
This is an example of retrieving WMIC results using the xp_cmdshell proc, and inserting the results into a table.Specifically, this script retrieves disk info from the LogicalDisk class, but WMIC provides thousands of other properties. WMIC does require it be ran from a Windows 2003 server, but can query other Windows 2000 servers when executed […]
2006-08-04 (first published: 2006-07-02)
783 reads
There are two UDF's included here.The first one will return the number of Years, Months and Days between a Start and End date.The second one will return either Years, Months or Days which makes it much easier to include in a select.If you know of or find a better/faster way to do this, then please […]
2006-08-01 (first published: 2004-09-23)
171 reads
Out of the box, Reporting services does not handle divide by zero conditions gracefully. There are plenty of posting on how to use the IIF() function to accomplish this, with some rather horrific looking code. In order to simplify the coding process and make the resulting expressions readable by a mere mortal, I wrote the […]
2006-07-28 (first published: 2005-05-26)
3,977 reads