Generate insert statements with column names for any or all tables
Generate a script of insert statements with column names for any table including those with identity columns.
2012-06-15 (first published: 2012-05-22)
3,152 reads
Generate a script of insert statements with column names for any table including those with identity columns.
2012-06-15 (first published: 2012-05-22)
3,152 reads
Sometimes you just need to populate a CHAR/VARCHAR column for testing with a random selection of string literals at table CREATE time. Here is a quick and easy script.
2012-06-14 (first published: 2008-01-16)
1,186 reads
SQL Server 2012 introduces a new string concatenation function. This can be recreated in earlier versions of SQL Server.
2012-06-06 (first published: 2012-05-16)
2,182 reads
These are scripts I run each morning on my registered CMS servers to check immediate health.
2012-06-04 (first published: 2012-05-09)
2,901 reads
The code below uses a CASE STATEMENT to group sales data based on date,week,month and quarter. It should be executed in AdventureWorks 2005 or 2008.
2012-05-30 (first published: 2012-05-10)
2,051 reads
This function returns all the necessary version information in a table.
2012-05-28 (first published: 2012-03-21)
3,198 reads
Script to list out all fragmented indexes for a given database, with options to only view them, reorganize them, or rebuild them in one fell swoop.
2012-05-25 (first published: 2012-05-15)
3,321 reads
Displays the last Full, Diff, and Log backup taken. If no backup has been taken that is displayed as well.
2012-05-24 (first published: 2012-05-15)
1,502 reads
works two different ways using sql for 2000 and 2005 and powershell for 2008.
2012-05-23 (first published: 2012-05-01)
5,815 reads
2012-05-22 (first published: 2012-05-01)
833 reads
By Steve Jones
Thanks to everyone that attended my sessions at VS Live San Diego yesterday. It...
By Steve Jones
I was creating a question on sp_readerrorlog and realized that this procedure is different...
By SQLPals
Why sys.fn_dblog Is Undocumented And Why It's Still There Why sys.fn_dblog...
Telp/Wa 62 8217555651 Jl. Metro Pondok Indah No.60 & 61 UA, RT.4/RW.14, Pd. Pinang,...
Telp/Wa 62 8218200233 Shopping Arcade, The Mansion At Kemang, Jl. Kemang Raya No.3-5, RT.1/RW.7,...
Telp/Wa 62 8218200203 Jl. Jend. Sudirman No.Kav.47, RT.5/RW.4, Karet Semanggi, Kecamatan Setiabudi, Kota Jakarta...
I run this code on SQL Server 2022.
CREATE TABLE Drink
(
drinkid INT NOT NULL
CONSTRAINT DrinkPK PRIMARY KEY CLUSTERED,
drinkname VARCHAR(20),
rating NUMERIC(2, 1)
)
GO
INSERT INTO Drink
(
drinkid,
drinkname,
rating
)
VALUES
(1, 'Margarita', 4.5),
(2, 'Mojito', 4.3),
(3, 'Old Fashioned', 4.7),
(4, 'Martini', 4.4),
(5, 'Cosmopolitan', 4.2)
GO
ALTER INDEX drinkpk ON dbo.drink DISABLE
GO
SELECT * FROM dbo.Drink
GO
What is the result? See possible answers