T-SQL Scripts

SQL Server Import/Export to Excel using Python script
https://www.allaboutmssql.com/2019/07/sql-server-importexport-to-excel-using.html

T-SQL : Data profiling in On-premise SQL Server / Azure SQL database
https://www.allaboutmssql.com/2019/07/t-sql-data-profiling-in-on-premise-sql.html

T-SQL : Search for string or phrase in SQL Server database
http://www.allaboutmssql.com/2019/05/t-sql-search-for-string-or-phrase-in.html

Import csv or text file into SQL Server table
http://www.allaboutmssql.com/2019/01/import-csv-or-text-file-into-sql-server.html

SQL Server export adhoc SQL or table to CSV file
http://www.allaboutmssql.com/2019/01/sql-server-export-adhoc-sql-or-table-to.html

SQL Server Export/Import excel using R script
http://www.allaboutmssql.com/2018/12/sql-server-exportimport-excel-using-r_59.html

How to concatenate values with specified delimiter
http://www.allaboutmssql.com/2018/01/how-to-concatenate-values-with.html

How to combine separate row values into delimited string
http://www.allaboutmssql.com/2018/01/how-to-combine-separate-row-values-into.html 

How to split delimited string into separate row
http://www.allaboutmssql.com/2018/01/how-to-split-delimited-string-into.html

SQL Server 2017 - Graph tables
http://www.allaboutmssql.com/2017/06/sql-server-2017-graph-tables.html

SQL Server access Previous / Next rows and first / last row from partitioned resultset
http://www.allaboutmssql.com/2016/01/sql-server-access-previous-next-rows.html

SQL Server 2016 - Drop Objects IF EXISTS
http://www.allaboutmssql.com/2015/12/sql-server-2016-drop-objects-if-exists.html


SQL Server services information
http://www.allaboutmssql.com/2015/11/sql-server-services-information.html

SQL Server - Subquery - Be careful in passing column names in the subqueries
http://www.allaboutmssql.com/2014/08/sql-server-subquery-be-careful-in.html


T-SQL - Storing and retrieving multi lingual data http://www.allaboutmssql.com/2014/08/t-sql-storing-and-retrieving-multi.html

SQL Server - Effects Of Renaming a Column Of a Table  
http://www.allaboutmssql.com/2014/02/sql-server-effects-of-renaming-column.html 

T-SQL: Script to Find the Names of Stored Procedures that Use Dynamic SQL ( Method 2 )
http://www.allaboutmssql.com/2014/01/t-sql-script-to-find-names-of-stored.html 

SQL Server - Dynamic SQL - SQL Injection - EXEC [ QUOTENAME() , REPLACE() , EXECUTE AS ] - Sp_executesql - [ RECOMPILE ]  
http://www.allaboutmssql.com/2014/01/sql-server-dynamic-sql-sql-injection.html 

TSQL Script to Find the Names of Stored Procedures that Use XQUERY
http://www.allaboutmssql.com/2013/12/tsql-script-to-find-names-of-stored.html 


TSQL Script to Generate Create ColumnStore Index Script   - 
http://www.allaboutmssql.com/2013/12/tsql-script-to-generate-create.html

SQL Server - FOR XML clause can be used within CTE
http://www.allaboutmssql.com/2013/11/sql-server-for-xml-clause-can-be-used.html

T-SQL - INSERT Statement with Columnslist inside Stored procedure -
http://www.allaboutmssql.com/2013/10/t-sql-insert-statement-with-columnslist.html

SQL Server ORDER BY clause
http://www.allaboutmssql.com/2013/10/sql-server-order-by-clause.html 


SQL Server ORDER BY using Alias name of the column mentioned in the SELECT statement -
http://www.allaboutmssql.com/2013/10/sql-server-order-by-using-alias-name-of.html


SQL Server - ORDER BY with CASE statement - Example
http://www.allaboutmssql.com/2013/09/sql-server-order-by-with-case-statement.html


SQL Server - Concatenating string / integer with NULL - 
http://www.allaboutmssql.com/2013/09/sql-server-concatenating-string-integer.html 

SQL Server - ISNUMERIC
http://www.allaboutmssql.com/2013/09/sql-server-isnumeric.html


SQL Server - Script to find particular column from all tables/views except system databases -  http://www.allaboutmssql.com/2013/09/sql-server-script-to-find-particular.html

SQL Server - Display dynamically horizontal rows vertically
http://www.allaboutmssql.com/2013/09/sql-server-display-dynamically.html


T-SQL Script to generate Index Creation Scripts for all tables in a database
http://www.allaboutmssql.com/2013/09/t-sql-script-to-generate-index-creation.html 


T-SQL Script to get information about Index settings
http://www.allaboutmssql.com/2013/09/t-sql-script-to-get-information-about.html 


T-SQL Script for inserting rows repeatedly based on particular count
http://gallery.technet.microsoft.com/scriptcenter/T-SQL-Script-for-inserting-f36b3dc1 


How to check the syntax of dynamic SQL before execution  -
http://www.allaboutmssql.com/2013/08/how-to-check-syntax-of-dynamic-sql.html

T-SQL Script to compare two tables definition / metadata in different databases -
http://www.allaboutmssql.com/2013/08/t-sql-script-to-compare-two-tables.html
 

T-SQL - Using Order By clause to return resultset with exact matches first and then partial matches -  http://www.allaboutmssql.com/2013/08/t-sql-using-order-by-clause-to-return.html
 

 T-SQL Group By with CASE statement  -
http://www.allaboutmssql.com/2013/08/t-sql-group-by-with-case-statement.html


T-SQL Script to Split a column with delimited string into multiple columns -
http://www.allaboutmssql.com/2013/08/t-sql-script-to-split-column-with.html

T-SQL Script to find the names of the StoredProcedure that has used dynamic SQL  -
http://www.allaboutmssql.com/2013/08/t-sql-script-to-find-names-of.html

Passing comma separated values (SSRS - multivalued parameter) as input to the stored procedure - http://social.technet.microsoft.com/wiki/contents/articles/17104.passing-comma-separated-values-ssrs-multivalued-parameter-as-input-to-the-stored-procedure.aspx

SQL Server  - Split delimited string into separate columns -
http://gallery.technet.microsoft.com/scriptcenter/SQL-Server-2012-Split-bdbf6fc2

T-SQL: Remove Leading and Trailing Zeros - http://social.technet.microsoft.com/wiki/contents/articles/17777.t-sql-remove-leading-and-trailing-zeros.aspx

T-SQL - Create temp table with dynamic columns - http://www.allaboutmssql.com/2013/05/t-sql-create-temp-table-with-dynamic.html

T-SQL - Example for SUBSTRING with CASE statement - http://www.allaboutmssql.com/2013/04/t-sql-example-for-substring-with-case.html

SQL Server  - PARSENAME function - To split delimited data -  http://www.allaboutmssql.com/2013/04/sql-server-2012-parsename-function-to.html

T-SQL Script to update string NULL with NULL -  http://www.allaboutmssql.com/2013/03/t-sql-script-to-update-string-null-with.html

T-SQL - RESEED identity if the table has zero records  - http://www.allaboutmssql.com/2013/03/t-sql-reseed-identity-if-table-has-zero.html

SQL Server - [T-SQL Handling single quotes within a string] - http://www.allaboutmssql.com/2013/02/sql-server-t-sql-handling-single-quotes.html

SQL Server - Dynamic Pivoting -  http://www.allaboutmssql.com/2012/10/sql-server-dynamic-pivoting.html

SQL Server - Combine separate row values as CSV -  http://www.allaboutmssql.com/2012/10/sql-server-combine-separate-row-values.html

TSQL script - to identify all the columns with specific datatype in specific database - http://www.allaboutmssql.com/2012/04/tsql-script-to-identify-all-columns.html

TSQL script - List All Stored Procedure Modified in Last N Days -  http://www.allaboutmssql.com/2012/04/tsql-script-list-all-stored-procedure.html

TSQL script - to Display Foreign Key Relationships and Name of the Constraint for Each Table in Database -  http://www.allaboutmssql.com/2012/04/tsql-script-to-display-foreign-key.html

TSQL script - to Find ByteSize of All the Tables in Database -  http://www.allaboutmssql.com/2012/04/tsql-script-to-find-bytesize-of-all.html

TSQL Script - to Find Details About TempDB - http://www.allaboutmssql.com/2012/04/tsql-script-to-find-details-about.html

Sqlserver TRIM() Function – Remove Trailing Spaces, Leading Spaces, White Space, Tabs, Carriage Returns, Line Feeds -  http://www.allaboutmssql.com/2012/04/sqlserver-trim-function-remove-trailing.html

TSQL script - To List Primary Keys and Foreign Keys of Database -  http://www.allaboutmssql.com/2012/04/tsql-script-to-list-primary-keys-and.html

TSQL script - To Find Most Expensive Queries -  http://www.allaboutmssql.com/2012/04/tsql-script-to-find-most-expensive.html

TSQL tip - Finding Apostrophes in String and Text -  http://www.allaboutmssql.com/2012/04/tsql-tip-finding-apostrophes-in-string.html

TSQL script- To get database restore history -  http://www.allaboutmssql.com/2012/04/tsql-script-to-get-database-restore.html

TSQL script - CTE to remove duplicate rows -  http://www.allaboutmssql.com/2012/03/tsql-script-cte-to-remove-duplicate.html

TSQL Script - To find no. of Rows in all tables of a database - http://www.allaboutmssql.com/2012/03/tsql-script-to-find-no-of-rows-in-all.html

TSQL Script- To find tables without primary key & heap tables - http://www.allaboutmssql.com/2012/03/tsql-script-to-find-tables-without.html

TSQL Script - To change Primary key names to standard naming convention across the DB -  http://www.allaboutmssql.com/2012/03/tsql-script-to-change-primary-key-names.html

T SQL script- to get tables with no clustered indexes - http://www.allaboutmssql.com/2012/03/t-sql-script-to-get-tables-with-no.html

T-SQL script - Find Currently Running Query - http://www.allaboutmssql.com/2012/03/t-sql-script-find-currently-running.html

TSQL script - Find Highest / Most Used Stored Procedure - http://www.allaboutmssql.com/2012/03/tsql-script-find-highest-most-used.html

T-SQL script - Find Stored Procedure & Functions Related to Table in Database – Search in All Stored Procedure -  http://www.allaboutmssql.com/2012/03/t-sql-script-find-stored-procedure.html

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

http://www.allaboutmssql.com/2012/03/t-sql-script-list-columns-and.html

T-SQL script - Backup History Analysis - http://www.allaboutmssql.com/2012/03/tsql-script-backup-history-analysis.html

T-SQL script to list object dependencies -  http://www.allaboutmssql.com/2012/03/t-sql-script-to-list-object.html




No comments: