Prime Numbers Generator (Updated)
This a modification to the script given by eugene_b.It generates prime numbers to the upper bound you specify.I have done some simple modifications to speed the process
2003-09-10
146 reads
This a modification to the script given by eugene_b.It generates prime numbers to the upper bound you specify.I have done some simple modifications to speed the process
2003-09-10
146 reads
2003-09-08
595 reads
Following on from todays QOD (on xp_cmdshell permissions) I thought this might be useful.Takes a directory or UNC path and returns the contents as a table. eg:exec sp_getdir '\\mypc\c$'returns:datestring timestring directory filesize nameoffile---------- ---------- ----------- ----------- ----------------------18/07/2003 10:45 1 NULL Documents and Settings18/07/2003 11:02 […]
2003-09-04
285 reads
This query will give you the current job status of all scheduled jobs on sql server. Just by using sysJobs, and sysJobHistory table you will get to know the details about the last status of the scheduled jobs, irrespective of their status like failed, successful, or cancelled.Note: You must have admin right on MSDB database […]
2003-09-04
8,580 reads
This UDF is using in reporting where lots of durations are calculated, stored and then summed up and averaged for reports. By storing the durations as floats (which are similar to the fixed point numbers datetimes are stored as) math functions are simpler.The problem is that float-times are not human readable, and cast(@floatime as datetime) […]
2003-09-03
1,019 reads
With a dynamic sql script under 4000 chars use sp_executesql With under 8000 chars write it to a variable.For anything longer you can use this script. Use UpdateText and WriteText to write your dynamic sql to a text/ntext field in a table somewhere and then pass its location to this script.
2003-09-01
616 reads
I wrote this to allow me to send a priority list of int ids.This takes a "," seperated list of integers and puts them into a table, along with an [insorder] field that allows you to sort them.eg 2,6,3,1,7 becomesints insorder ---- --------1 72 13 56 37 9Depending on what […]
2003-09-01
95 reads
SQL2000 only.We use the attached script to schedule a SQL Agent job that sets up a Profile trace looking for long queries, and hourly imports them into a table. This way we can historically (but with some degree of real time) look to see what queries put a load on the system. We then allow […]
2003-08-23
1,495 reads
This a script to compare two parallel data streams, in my case production and QA. Two extracts were created and a mapping table was created as a look-up between old and new recordids. A final table TestResults was created to hold the results of the comparison. The comparison table names and join syntax are controlled […]
2003-08-21
170 reads
A stored procedure and two functions that given a path, a date and a file extension will do one of the following:-Delete all files of the supplied extension in that directory before a certain date.-Delete everything before the last full backup.I use this because disk space is tight and maintenance plans seem to delete old […]
2003-08-21
731 reads
I am excited to host T-SQL Tuesday for the first time. I want to...
By Steve Jones
Redgate had some Claude training recently, which I went through as my knowledge has...
By Steve Jones
gnossienne– n. the awareness that someone you’ve known for years still has a private...
Hi guys and gals, I've created a system that automatically allows you to "generate"...
Comments posted to this topic are about the item Demo Tracking Dropped Objects
Comments posted to this topic are about the item Randomly Selecting Columns and Rows...
If I want to return information about all Database Mail profiles on my instance from T-SQL, how can I do this?
See possible answers