T-SQL Scripts

SQL Server 2017 - Graph tables

SQL Server access Previous / Next rows and first / last row from partitioned resultset

SQL Server 2016 - Drop Objects IF EXISTS

SQL Server services information

SQL Server - Subquery - Be careful in passing column names in the subqueries

T-SQL - Storing and retrieving multi lingual data

SQL Server - Effects Of Renaming a Column Of a Table 

T-SQL: Script to Find the Names of Stored Procedures that Use Dynamic SQL ( Method 2 ) 

SQL Server - Dynamic SQL - SQL Injection - EXEC [ QUOTENAME() , REPLACE() , EXECUTE AS ] - Sp_executesql - [ RECOMPILE ] 

TSQL Script to Find the Names of Stored Procedures that Use XQUERY 

TSQL Script to Generate Create ColumnStore Index Script   -

SQL Server - FOR XML clause can be used within CTE

T-SQL - INSERT Statement with Columnslist inside Stored procedure -

SQL Server ORDER BY clause 

SQL Server ORDER BY using Alias name of the column mentioned in the SELECT statement -

SQL Server - ORDER BY with CASE statement - Example

SQL Server - Concatenating string / integer with NULL - 


SQL Server - Script to find particular column from all tables/views except system databases -

SQL Server - Display dynamically horizontal rows vertically

T-SQL Script to generate Index Creation Scripts for all tables in a database 

T-SQL Script to get information about Index settings 

T-SQL Script for inserting rows repeatedly based on particular count 

How to check the syntax of dynamic SQL before execution  -

T-SQL Script to compare two tables definition / metadata in different databases -

T-SQL - Using Order By clause to return resultset with exact matches first and then partial matches -

 T-SQL Group By with CASE statement  -

T-SQL Script to Split a column with delimited string into multiple columns -

T-SQL Script to find the names of the StoredProcedure that has used dynamic SQL  -

Passing comma separated values (SSRS - multivalued parameter) as input to the stored procedure -

SQL Server  - Split delimited string into separate columns -

T-SQL: Remove Leading and Trailing Zeros -

T-SQL - Create temp table with dynamic columns -

T-SQL - Example for SUBSTRING with CASE statement -

SQL Server  - PARSENAME function - To split delimited data -

T-SQL Script to update string NULL with NULL -

T-SQL - RESEED identity if the table has zero records  -

SQL Server - [T-SQL Handling single quotes within a string] -

SQL Server - Dynamic Pivoting -

SQL Server - Combine separate row values as CSV -

TSQL script - to identify all the columns with specific datatype in specific database -

TSQL script - List All Stored Procedure Modified in Last N Days -

TSQL script - to Display Foreign Key Relationships and Name of the Constraint for Each Table in Database -

TSQL script - to Find ByteSize of All the Tables in Database -

TSQL Script - to Find Details About TempDB -

Sqlserver TRIM() Function – Remove Trailing Spaces, Leading Spaces, White Space, Tabs, Carriage Returns, Line Feeds -

TSQL script - To List Primary Keys and Foreign Keys of Database -

TSQL script - To Find Most Expensive Queries -

TSQL tip - Finding Apostrophes in String and Text -

TSQL script- To get database restore history -

TSQL script - CTE to remove duplicate rows -

TSQL Script - To find no. of Rows in all tables of a database -

TSQL Script- To find tables without primary key & heap tables -

TSQL Script - To change Primary key names to standard naming convention across the DB -

T SQL script- to get tables with no clustered indexes -

T-SQL script - Find Currently Running Query -

TSQL script - Find Highest / Most Used Stored Procedure -

T-SQL script - Find Stored Procedure & Functions Related to Table in Database – Search in All Stored Procedure -

T-SQL script -List columns and attributes for every table in a SQL Server database

T-SQL script - Backup History Analysis -

T-SQL script to list object dependencies -

No comments: