UDF to find Service Pack version
This UDF returns the Service Pack versionprint dbo.ServicePackversion()
2003-01-14
131 reads
This UDF returns the Service Pack versionprint dbo.ServicePackversion()
2003-01-14
131 reads
I wrote this SP to be run from a job every night. Change the myDB reference to be a database on your system for DBA use.I just set up a job to run:Exec sp_CatchFileChangesThen I run in another step:Select * from mydb.dbo.tbl_sysaltfiles_3and output to a log file.Alternatively you could insert into another table with a […]
2003-01-13
323 reads
If new objects are created in the model database then these new objects only get created for new databases.Similarly, if objects are removed from user databases then getting them back into the database can be a pain.The following two stored procs copy objects from model to the current database if they do not already exist.
2003-01-10
57 reads
I wrote this sp to be able to calculate the distance between two locations on the earth if the latitude and longitude is known for each. Could be useful for GPS work or maps.Usage:If I know the following city locations:Sydney 151.2 E 33.87 SCanberra 149.15 E […]
2003-01-09
813 reads
WARNING: This is resource intensive. Don't use except as a last resort.I wrote this to be able to find if a TSQL batch is running already on a SQL Server. I use this rarely when I have to know to prevent running something twice.Usage:DECLARE @RC intDECLARE @SQLBatch nvarchar(255)-- Set parameter valuesEXEC @RC = [master].[dbo].[sp_RunningCheck] @SQLBatch […]
2003-01-09
435 reads
I wrote this function to work with my sp_EarthDistance stored procedure.It converts the regular degrees/minutes/seconds representation of angles to a decimal number.Remember to use '' instead of ' within a string to be treated a character and not an end quote.Sydney location 151¦12'0 "E 33¦52'0 "S and in […]
2003-01-09
852 reads
This procedure can search all columns in one or all tables for a specified string. Prints out the TableName.ColumnName that the string is found in...-- Example Calls-- EXECUTE spFindTextInColumns MyTable, 'tcart' --search a specific table-- -- EXECUTE spFindTextInColumns default, 'tcart' --search all tables BUG FIX : (2003/01/20) Changed SELECT @columnName […]
2003-01-09
986 reads
Use the sp_MSforeachtable stored procedure to run the sp_spaceused stored procedure for every table in a database
2003-01-08
133 reads
One of the challenges weve faced is changing passwords in a warm server to reflect changes made to the live server. The initial transfer of users and passwords was performed by the sp_help_revlogin script provided by Microsoft at http://support.microsoft.com/default.aspx?scid=kb;en-us;246133. The difficulty with this script was once the users are in place, you cant sync changed […]
2003-01-08
171 reads
This UDF will return the checksum for a SP or UDF to help tracking changes to the code.Example:print dbo.OBchecksum('hello')
2003-01-07
192 reads
By Steve Jones
After my session at VSLive last week, I had a few questions from the...
Referrals have never been more important in the job market. They’re no longer nice...
By Steve Jones
dorgone– adj. wondering if you could slip away from an event or group conversation...
I have about 100 Tables that are all suffixed with _Modify. These tables record...
Comments posted to this topic are about the item Make It Routine
Comments posted to this topic are about the item Finding Gaps in Sequential Data...
If I want to know whether a number of negative, positive, or zero, what is the easiest way to get this in T-SQL?
See possible answers