Getting unique or primary key columns for a given table
Following script will list out all the columns which have unique/primary key constraints for a given table.
2009-01-02 (first published: 2008-12-10)
1,270 reads
Following script will list out all the columns which have unique/primary key constraints for a given table.
2009-01-02 (first published: 2008-12-10)
1,270 reads
This script helps with restoring backup files SQL Server 2005
2008-12-31 (first published: 2008-12-11)
1,603 reads
This is used to insert the multiple values using a single insert statment.
2008-12-31
515 reads
This should find all tables referenced by an sp. It uses syscomments and hence has a wrap 'issue'.
2008-12-30 (first published: 2008-12-05)
1,037 reads
we need change all user table db owners For selected database using T SQL we can easily use this method.
2008-12-29 (first published: 2008-11-30)
1,230 reads
Capturing the execution time for rebuilding an index for set of tables.
2008-12-26 (first published: 2008-11-27)
1,699 reads
This article explains a simple solution for the common problem in MSSQL 7.0/2000, finding & deleting duplicate records from a table.
2008-12-24 (first published: 2008-11-26)
2,816 reads
2008-12-23 (first published: 2008-11-10)
2,945 reads
This script is for the Generating a code block that makes it easier to grant various permissions on a group of objects qualified by specific Criteria.
2008-12-19 (first published: 2008-07-23)
1,317 reads
I couldn't find a solid script for this so I put this together. It creates the database EXACTLY as it was with growth and proper file groups.
2008-12-18 (first published: 2008-11-14)
1,272 reads
By HeyMo0sh
Microsoft Fabric (not to be confused with the more general term “fabric” in DevOps)...
By James Serra
I’m honored to be hosting T-SQL Tuesday — edition #192. For those who may...
By Vinay Thakur
Continuing from Day 2 , we learned introduction on Generative AI and Agentic AI,...
Having trouble attracting leads or visibility online? We develop the best digital marketing strategies...
Posting regularly but not getting engagement or sales? As one of the best social...
Hi Team, I am trying to refresh the Azure Synapse Dedicated pool from production...
I have some data in a table:
CREATE TABLE #test_data
(
id INT PRIMARY KEY,
name VARCHAR(100),
birth_date DATE
);
-- Step 2: Insert rows
INSERT INTO #test_data
VALUES
(1, 'Olivia', '2025-01-05'),
(2, 'Emma', '2025-03-02'),
(3, 'Liam', '2025-11-15'),
(4, 'Noah', '2025-12-22');
If I run this query, how many rows are returned?
SELECT *
FROM OPENJSON(
(
SELECT t.* FROM #test_data AS t FOR JSON PATH
)
) t; See possible answers