How to Find the List of Functions in SQL Server
Query to find the list of Functions in SQL Server [sql] SELECT name FROM sys.objects WHERE type IN (‘AF ‘,’FN’, ‘IF’, ‘TF’, ‘FS’, ‘FT’) [/sql]
View ArticleConcatenating Data From Different Rows into Single Column Row
Consider a scenario where a table has multiple rows, and each of these rows belong to a group and the data from all the rows should be concatenated based on the group. This post explains different ways...
View ArticleTSQL Script to remove TAB, LINE FEED and CARRIAGE RETURN
The below script removes the TAB(Horozontal Tab), Line feed(New line), Carriage Return Characters in a variable @String [sql] SET NOCOUNT ON DECLARE @String VARCHAR(100) DECLARE @CorrectedString...
View ArticleInteresting Observation – Declaring Table Variables impact on Tempdb
Following was an intresting observation when creating table variables. 1. Table variables are created in tempdb. 2. Table variables are created in tempdb even before the declare table is called. Steps...
View ArticleImpact of TEMPDB Collations on Other Databases
When you create databases with different collations then you have to be very careful when using the temporary tables. In the below script let us analyze such a scenario. Creating Sample database with...
View ArticleHOW TO CONVERT TABLE DATA TO XML AND XML TO TABLE
HOW TO CONVERT TABLE DATA TO XML AND VICEVERSA. The below code explains how to convert the data in a table to xml form and then convert the xml back into table data. Creating sample table with data:...
View ArticleTSQL Script to Clear SQL Server Cache
Below script that can be used to clear SQL Server Cache. Helpful while working on performance tuning of SQL Scripts. CHECKPOINT; GO DBCC DROPCLEANBUFFERS DBCC FREEPROCCACHE DBCC FREESYSTEMCACHE ('ALL')...
View Article