sp_MSTableSpace and sp_MSforeachtable combined
The following stript combines two previous articals. sp_MStablespace was being demonstrated with a cursor. To reduce the code the sp_MSforeachtable could be used.
2003-07-08
544 reads
The following stript combines two previous articals. sp_MStablespace was being demonstrated with a cursor. To reduce the code the sp_MSforeachtable could be used.
2003-07-08
544 reads
I was asked by a customer to create a scheduled weekly report detailing work that had been completed in the previous week (Monday to Friday) I figured they might lose the report or something might happen to stop the scheduler from running it, and I didn't want to have to modify my script to work […]
2003-07-07
151 reads
2003-07-02
643 reads
2003-07-02
404 reads
SUBSTR returns a portion of char, beginning at character @StartPos, @Length characters long. If @StartPos is 0, it is treated as 1. If @StartPos is positive, Oracle counts from the beginning of char to find the first character. If @StartPos is negative, Oracle counts backwards from the end of char.
2003-07-02
271 reads
UDF that returns a DATETIME which is the concatination of the TIME portion of one DATETIME and the DATE portion of another.EXAMPLES:DECLARE @Date DATETIME, @Time DATETIMESET @Date = '7/1/03 16:00'SET @Time = '5/16/1999 9:30 AM'PRINT dbo.FN_AddDateTime(@Date,@Time )RETURNS: Jul 1 2003 9:30AMPRINT dbo.FN_AddDateTime(@Date,0)RETURNS: Jul 1 2003 12:00AM
2003-07-01
99 reads
This script is useful when want find out the list of the object on a given filegroup.
2003-07-01
227 reads
This function is based on a script by Tim Dietrich (tim@timdietrich.us) named format_height.sql. His function took what he called a decimal representation of a measurement and formatted it as feet and inches. In reality the input value was just a measurement formatted to look like a decimal number but it was not a true decimal […]
2003-06-27
88 reads
While we are exploring the possibility to build data-driven application whose GUI are all dynamically generated according to database objects' extended property, we find the system provided procedures: sp_addextendedproperty, sp_dropextendedproperty,sp_updateextendedproperty can add extended property to only one object each time, while fn_listextendedproperty can not let you search objects to display their extended property. […]
2003-06-27
494 reads
A proc which gets a list of all databases (Exluding "excluded" ones) and backs them up.The backup files are stored in the directory \DatabaseName\DatabaseName.bakUNC names are supported provided SQL Server has write access to the location.It deletes backups older than x (Current 3) days.This can be changed.Add a job to execute the script of proc […]
2003-06-26
705 reads
Next Monday, February 9, 2026, my one-day live online training SQL Server Query Tuning...
By Steve Jones
One of the features we advocates have been advocating for is a better way...
Microsoft fixed the AVX instruction issue in SQL Server 2025 CU1. The container now...
Comments posted to this topic are about the item 25 Years of SQL Server...
Comments posted to this topic are about the item The Decoded Value
Comments posted to this topic are about the item Deploying SQL Server Developer Edition...
In SQL Server 2025, what is returned from this code:
DECLARE @message VARCHAR(50) = 'Hello SQL Server 2025!'; DECLARE @encoded VARCHAR(MAX); SET @encoded = BASE64_ENCODE(CAST(@message AS VARBINARY(1000))); SELECT BASE64_DECODE(@encoded)See possible answers