sp_GetLastBackup
This will get the last date a database was backuped. It allows you to report this date on all databases on a server, or pass in a db name, and it'll report the date that db was last backed up
2002-03-07
443 reads
This will get the last date a database was backuped. It allows you to report this date on all databases on a server, or pass in a db name, and it'll report the date that db was last backed up
2002-03-07
443 reads
I use this SP to return full directory information into a table. FilePath, FileName, Filedate and FileSize are parsed from a 'dir /n/on/-c ' command. FilesInDir is the table created. usage: exec LoadFileDetailsIntoTable 'c:\winnt'select * from FilesInDir where filesize > 100000select min(fileDate) from FilesInDirThe Return Code will equal the number of files found.
2002-03-05
467 reads
spGetFieldsExists takes a tablename and a field name, and checks if that field exists in that table.It simply returns 0 or 1 (false or true).
2002-03-05
171 reads
spFindTableInfo is a great proc for finding info about your database. It will accept parameters like tablename, fieldname, size, datatype. So you can run it with no params, and it'll report every table, every field in those tables, and the size, datatype and whether its nullable or not. You can filter it by Table name […]
2002-03-05
381 reads
spDropField does exactly the opposite of spAddField. It checks for existence, then drops it, if it does exist.
2002-03-05
144 reads
spAddField is the proc I use to add all fields to the db in our upgrade scripts. With this proc, you pass it the tablename, fieldname, datatype, and null or not null. This will call spGetFieldsExists and see if the fields exists or not. If it does, spAddField will drop that column. Then it readds […]
2002-03-05
222 reads
Pass a datetime value and receive back a formatted string. Much like the Format$ function in Visual Basic.I put this together to provide a date string to add to filename. Also handy when you are creating text files that require datetime data to be output in weird character formats like yyddmm or yyyymm.eg: fnDate2Char(GetDate(), 'dmy', […]
2002-02-27
830 reads
Andy read this book recently and gave it a great review. Even though it's not a SQL book! Seriously, take a look at the review. It's a good book that is fun to read.
2002-02-26
3,275 reads
This script is very helpful for anyone trying to recreate particular SQL Server Database Versions for Testing. It allows you to automatically recompile any stored procedures or views saved with drop, create and permission statements. The scripts must all be sitting in one directory and end in the same extension. I have found this very […]
2002-02-25
690 reads
This stored procedure detaches and re-attaches a database without specifying a filename for the transaction log. This causes SQL Server to create log file with default size of 512kb.After playing around with SHRINKDATABASE, SHRINKFILE, forcing the virtual log to wrap around, etc... I found this was the quickest and most reliable method of reclaiming the […]
2002-02-25
2,612 reads
By gbargsley
Are you diversifying your DBA skillset? My recent job search made one thing clear:...
By Steve Jones
I flew to Amsterdam last night and hopefully by the time this publishes I’ll...
By Chris Yates
In every organization there is a hidden currency more valuable than capital, more enduring...
Comments posted to this topic are about the item Unlocking High-Concurrency Inserts in SQL...
Comments posted to this topic are about the item Vector Datatype
Comments posted to this topic are about the item PRs Are Like Trouble Tickets
The new Vector datatype in SQL Server 2025 is a binary type that has a few parameters. What parameters are required?
See possible answers