Select from stored procedure
This terse script shows an easy (but "dirty" - so not advisable for production environments - rather for personal use) way to select data from stored procedure.
2011-12-14 (first published: 2008-03-04)
4,147 reads
This terse script shows an easy (but "dirty" - so not advisable for production environments - rather for personal use) way to select data from stored procedure.
2011-12-14 (first published: 2008-03-04)
4,147 reads
This script will generate a restore statement with supporting MOVE operations to a new directory structure.
2011-12-13 (first published: 2008-05-29)
3,894 reads
Reports permissions to three levels: database, schema and table -- in three formats: readable, structured, scripted.
2011-12-12 (first published: 2008-02-22)
3,962 reads
The procedure below deletes all records from the specified database's(except master, model, msdb and tempdb) tables (except those from the schema 'sys').
2011-12-09 (first published: 2008-01-31)
4,182 reads
2011-12-08 (first published: 2011-11-23)
1,130 reads
This script validates the sufficient disk space per drive.
When you'll reach a minimum on a diskdrive, the script will mail all recipients.
2011-12-07 (first published: 2011-10-28)
4,042 reads
This command is the equivalent of the LEFT() function (cumbersome but effective)
2011-11-29 (first published: 2011-11-14)
1,175 reads
This creates a Tally or Numbers table which is frequently used to replace loops in code and is much faster than most loops.
2011-11-28 (first published: 2008-03-07)
6,691 reads
There are many occasions in programs where you need to manipulate strings of characters that are delimited by a particular character, such as a comma, or a space. This function enables you to extract a substring from the string at a specified occurence of the delimter. declare @Data varchar(255) set @Data = 'A,B,C,D,E' print dbo.field(@data,',',2,2) […]
2011-11-28 (first published: 2007-08-03)
2,612 reads
ntext, text, and image (Transact-SQL). This script will alter the data type from image to
varbinary(max) which is very much required as the data type is out
of support.
2011-11-28 (first published: 2011-11-14)
858 reads
By Steve Jones
ecstatic shock – n. a surge of energy upon catching a glimpse from someone...
By Chris Yates
The New Arena of Leadership The role of the Chief Data Officer is no...
Presenting you with an updated version of our sp_snapshot procedure, allowing you to easily...
Just saw the "Azure Extension for SQL Server" Does anyone has experience with it?...
I've noticed several instances of what looks like a recursive insert with the format:...
Comments posted to this topic are about the item Cleaning Up the Cloud
I have a table with this data:
TravelLogID CityID StartDate EndDate 1 1 2025-01-01 2025-01-06 2 2 2025-01-01 2025-01-06 3 3 2025-01-01 2025-01-06 4 4 2025-01-01 2025-01-06 5 5 2025-01-01 2025-01-06I run this code:
SELECT IDENT_CURRENT('TravelLog')I get the value 5 back. Now I do this:
SET IDENTITY_INSERT dbo.TravelLog ON INSERT dbo.TravelLog ( TravelLogID, CityID, StartDate, EndDate ) VALUES (25, 5, '2025-09-12', '2025-09-17') SET IDENTITY_INSERT dbo.TravelLog OFFI now run this code.
DBCC CHECKIDENT(TravelLog) GO INSERT dbo.TravelLog ( CityID, StartDate, EndDate ) VALUES (4, '2025-10-14', '2025-10-17') GOWhat is the value for TravelLogID for the row I inserted for CityID 4 and dates starting on 14 Oct 2025? See possible answers