2003-01-14
83 reads
2003-01-14
83 reads
This UDF returns the Service Pack versionprint dbo.ServicePackversion()
2003-01-14
102 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
293 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
38 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
784 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
399 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
825 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
945 reads
Use the sp_MSforeachtable stored procedure to run the sp_spaceused stored procedure for every table in a database
2003-01-08
112 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
149 reads
Welcome back, my fellow sleuths, to my mystery-inspired blog series! I’m having a ton...
By Steve Jones
This was one of the original values: The facing page has this text: No...
By Chris Yates
For decades, enterprises have thought about data like plumbers think about water: you build...
Comments posted to this topic are about the item Create an HTML Report on...
Comments posted to this topic are about the item I Love Editorials
Hi everyone I have a 1000 plus line query and I am getting an...
What happens when I run this code:
DECLARE @s VARCHAR(1000) = 'apple, pear, peach' SELECT * FROM STRING_SPLIT(@s, ', ')See possible answers