MSSQL Articles
- 
                    MS SQL Server stored procedure slowing down over time and then speeding up again after opening and saving
                     Murugan Andezuthu Dharmaratnam  | Murugan Andezuthu Dharmaratnam  | 20 March 2024 | 20 March 2024 | 1779 1779Experiencing with MS SQL Server stored procedure slowing down over time and then speeding up again after opening and saving … CONTINUE READING 
- 
                    cursor to loop through records in mssql database
                     Murugan Andezuthu Dharmaratnam  | Murugan Andezuthu Dharmaratnam  | 12 December 2023 | 12 December 2023 | 1856 1856While working with a SQL database you want to create a cursor to loop through records in a table. Here is an example for the same. lets loop though a table named Country with columns Name and ModifiedBy, the sample code below can help you get started. … CONTINUE READING 
- 
                    backup MSSQL database using sqlpackage
                     Murugan Andezuthu Dharmaratnam  | Murugan Andezuthu Dharmaratnam  | 26 September 2023 | 26 September 2023 | 2178 2178Execute the script to backup the database from the command prompt using sqlpackage. … CONTINUE READING 
- 
                    mssql stored procedure create read update delete into database table
                     Murugan Andezuthu Dharmaratnam  | Murugan Andezuthu Dharmaratnam  | 11 May 2023 | 11 May 2023 | 2392 2392sample mssql stored procedure create read update delete into database table. Stored procedures in MSSQL for CRUD operations are not just about performing basic database functions. They are about ensuring that these operations are performed in a way that is efficient, secure, and in line with the best practices of database management. As businesses continue to rely heavily on data, the importance of well-crafted stored procedures in managing this data cannot be overstated. … CONTINUE READING 
- 
                    Microsoft sql server naming conventions best practices
                     Murugan Andezuthu Dharmaratnam  | Murugan Andezuthu Dharmaratnam  | 09 May 2023 | 09 May 2023 | 3304 3304Explore best practices for SQL Server naming conventions. Discover the importance of consistency, clarity, and organization in database object naming for optimal database management. … CONTINUE READING 
- 
                    mssql useful functions
                     Murugan Andezuthu Dharmaratnam  | Murugan Andezuthu Dharmaratnam  | 04 April 2021 | 04 April 2021 | 1852 1852
- 
                    mssql performance turning 
                     Murugan Andezuthu Dharmaratnam  | Murugan Andezuthu Dharmaratnam  | 01 April 2021 | 01 April 2021 | 1915 1915
- 
                    mssql group by id other column comma separated
                     Murugan Andezuthu Dharmaratnam  | Murugan Andezuthu Dharmaratnam  | 12 March 2021 | 12 March 2021 | 3235 3235How to use group by clause with comma-separated column values in ms sql. I have a table … CONTINUE READING 
- 
                    mssql comma separated string to rows
                     Murugan Andezuthu Dharmaratnam  | Murugan Andezuthu Dharmaratnam  | 11 March 2021 | 11 March 2021 | 3049 3049how to convert a comma separated string to individual rows in mssql … CONTINUE READING 
- 
                    mssql query to list tables where new rows has been inserted updated or deleted
                     Murugan Andezuthu Dharmaratnam  | Murugan Andezuthu Dharmaratnam  | 05 February 2021 | 05 February 2021 | 3620 3620sql query to find list of table with insert updated or delete in the last one hour … CONTINUE READING 
- 
                    mssql how to alter column length from max to specific value without dropping the table
                     Murugan Andezuthu Dharmaratnam  | Murugan Andezuthu Dharmaratnam  | 22 January 2021 | 22 January 2021 | 3079 3079I have a table named Purchase with several columns including PurchaseOrderNumber and PurchaseOrderLine with column data type nvarchar(max) I would like to change the data type to nvarchar(64) without dropping the table. … CONTINUE READING 
- 
                    mssql how to join two tables by multiple columns
                     Murugan Andezuthu Dharmaratnam  | Murugan Andezuthu Dharmaratnam  | 18 January 2021 | 18 January 2021 | 3737 3737
- 
                    mssql select into multiple variables
                     Murugan Andezuthu Dharmaratnam  | Murugan Andezuthu Dharmaratnam  | 28 November 2020 | 28 November 2020 | 3290 3290sql server select columns into multiple variables from a table … CONTINUE READING 
- 
                    mssql how to get the previous row and next row value using select statement
                     Murugan Andezuthu Dharmaratnam  | Murugan Andezuthu Dharmaratnam  | 27 November 2020 | 27 November 2020 | 3144 3144mssql how to get the previous row and next row value using select statement … CONTINUE READING 
- 
                    sql server get identity value before insert
                     Murugan Andezuthu Dharmaratnam  | Murugan Andezuthu Dharmaratnam  | 27 November 2020 | 27 November 2020 | 3196 3196mssql how to get the current identity of a table before insert statement … CONTINUE READING 
- 
                    ssms error script generation failed click on help for known solutions
                     Murugan Andezuthu Dharmaratnam  | Murugan Andezuthu Dharmaratnam  | 09 November 2020 | 09 November 2020 | 4108 4108ssms error/exception script generation failed, click on help for known solutions. I am getting this error while I was trying to take a backup of the database using generate script … CONTINUE READING 
- 
                    mssql query to remove duplicate from a table
                     Murugan Andezuthu Dharmaratnam  | Murugan Andezuthu Dharmaratnam  | 03 November 2020 | 03 November 2020 | 3180 3180how to remove duplicate from a table using mssql query … CONTINUE READING 
- 
                    mssql select all if the where clause parameter is null or empty
                     Murugan Andezuthu Dharmaratnam  | Murugan Andezuthu Dharmaratnam  | 23 October 2020 | 23 October 2020 | 3180 3180In an MSSQL stored procedure, I am passing the Name parameter how to select all if the name parameter in the where clause is null … CONTINUE READING 
- 
                    mssql how to use exists in select list
                     Murugan Andezuthu Dharmaratnam  | Murugan Andezuthu Dharmaratnam  | 18 October 2020 | 18 October 2020 | 3229 3229How to use EXISTS in a select statement where you want to return a boolean column … CONTINUE READING 
- 
                    mssql how to filter from select where in list only if the list is not null
                     Murugan Andezuthu Dharmaratnam  | Murugan Andezuthu Dharmaratnam  | 15 October 2020 | 15 October 2020 | 3418 3418mssql how to filter from select where in list only if the list is not null or how to handle empty IN clause parameter list in mssql. … CONTINUE READING 
- 
                    mssql check if the output from select returns empty or null
                     Murugan Andezuthu Dharmaratnam  | Murugan Andezuthu Dharmaratnam  | 15 October 2020 | 15 October 2020 | 3684 3684mssql how to check if the output from select returns empty or null … CONTINUE READING 
- 
                    msql how to copy the result from select statement into a temp table
                     Murugan Andezuthu Dharmaratnam  | Murugan Andezuthu Dharmaratnam  | 15 October 2020 | 15 October 2020 | 3233 3233SQL script to copy the result from the select statement into a temp table. Please note that the temporary table is automatically created for you. … CONTINUE READING 
- 
                    mssql how to pass user defined table type to stored procedure from ssms
                     Murugan Andezuthu Dharmaratnam  | Murugan Andezuthu Dharmaratnam  | 15 October 2020 | 15 October 2020 | 4108 4108from sql server management studio how do I pass a parameter of type user defined table type to a stored procedure … CONTINUE READING 
- 
                    mssql replace string
                     Murugan Andezuthu Dharmaratnam  | Murugan Andezuthu Dharmaratnam  | 26 September 2020 | 26 September 2020 | 3858 3858how to replace a string in a column in mssql … CONTINUE READING 
- 
                    mssql rows to comma separated string
                     Murugan Andezuthu Dharmaratnam  | Murugan Andezuthu Dharmaratnam  | 26 September 2020 | 26 September 2020 | 3760 3760how to convert multiple rows to comma-separated string in mssql … CONTINUE READING 
- 
                    mssql exception Operand type clash dbo.type_name1 is incompatible with dbo.type_name2
                     Murugan Andezuthu Dharmaratnam  | Murugan Andezuthu Dharmaratnam  | 24 September 2020 | 24 September 2020 | 3615 3615mssql exception Operand type clash: dbo.type_name1 is incompatible with dbo.type_name2 … CONTINUE READING 
- 
                    mssql update from select inner join
                     Murugan Andezuthu Dharmaratnam  | Murugan Andezuthu Dharmaratnam  | 23 September 2020 | 23 September 2020 | 4331 4331
- 
                    list of temp tables in sql server
                     Murugan Andezuthu Dharmaratnam  | Murugan Andezuthu Dharmaratnam  | 23 September 2020 | 23 September 2020 | 3300 3300There are a couple of ways you can find the list of temporary tables in sql server. … CONTINUE READING 
- 
                    mssql create temp table
                     Murugan Andezuthu Dharmaratnam  | Murugan Andezuthu Dharmaratnam  | 23 September 2020 | 23 September 2020 | 4242 4242Creating a temporary table in mssql is one of the easiest things to do. You can use the same syntax as creating a table, the only difference prepend a # to the table name … CONTINUE READING 
- 
                    mssql exception subquery returned more than 1 value
                     Murugan Andezuthu Dharmaratnam  | Murugan Andezuthu Dharmaratnam  | 15 September 2020 | 15 September 2020 | 3539 3539Subquery returned more than 1 value. This is not permitted when the subquery follows =, !=, <, <= , >, >= or when the subquery is used as an expression. … CONTINUE READING 
- 
                    mssql convert from number to words
                     Murugan Andezuthu Dharmaratnam  | Murugan Andezuthu Dharmaratnam  | 10 September 2020 | 10 September 2020 | 3967 3967ms sql server function to convert from number to words … CONTINUE READING 
- 
                    mssql depth of a tree
                     Murugan Andezuthu Dharmaratnam  | Murugan Andezuthu Dharmaratnam  | 10 September 2020 | 10 September 2020 | 3946 3946we will write a function to find the depth of a tree. Depth of node N in the tree is the length of the path from the root of the tree to node N … CONTINUE READING 
- 
                    mssql insert if not exist else update
                     Murugan Andezuthu Dharmaratnam  | Murugan Andezuthu Dharmaratnam  | 29 August 2020 | 29 August 2020 | 3753 3753sql query to insert if item is not found else update the item … CONTINUE READING 
