Development

SQL Server – String_Escape function in SQL Server 2016

Hi friends, in SQL server 2016 another string function that introduced is String_Escape. This function can escape special characters within texts and will return text with escaped characters. Syntax STRING_ESCAPE (expression, type) Currently only the value that is supported for type argument is ‘json’ only. If you try to specify another type it will result… Continue reading SQL Server – String_Escape function in SQL Server 2016

Certification

Microsoft SQL Server 2016 Certifications Announced

Hi friends, Microsoft has announced the release of three new SQL 2016 certifications, based on the different working database professional’s roles. MCSA: SQL 2016 Database Development can be achieved by passing the following two exams: 70-761 – Querying Data with Transact-SQL 70-762 – Developing SQL Databases MCSA: SQL 2016 Database Administration can be achieved by passing the… Continue reading Microsoft SQL Server 2016 Certifications Announced

Development

SQL Server – STRING_SPLIT function in SQL Server 2016

Hi friends, in SQL server 2016 another new function STRING_SPLIT gets introduced which helps in splitting the character expression using separator. Previously, to do this type of work we need to write some code or function to split the character expression but in SQL 2016 function STRING_SPLIT reduce that work to write multiple lines of… Continue reading SQL Server – STRING_SPLIT function in SQL Server 2016

Development

SQL Server – Rollback transaction completely in case of error

Hi friends, I recently found an issue while inserting data into table during transactions that transaction will not completely rollback if we use multiple insert statement in transaction. Let me give you a demo on this how to handle such situation. Create table Test_tran (               ID Int Primary… Continue reading SQL Server – Rollback transaction completely in case of error

Development

SQL Server – Conditions when value of @@error changes

Hi friends, when we do error handling in our SQL code we use different methods like TRY/CATCH, RAISERROR etc. to return the error messages. We also use global variable @@error to print the error value of the last T-SQL statement executed. But many folks doesn’t know that value of @@error gets reset with every execution… Continue reading SQL Server – Conditions when value of @@error changes

Development · Performance Tuning

SQL Server – Cleaning Procedure Cache for a particular database

HI friends, most of the time we used DBCC FREEPROCCACHE to clear the procedure cache, clears the specific plan from cache by specifying plan handle or SQL handle. DBCC FREEPROCCACHE does not require any parameters. To clear the plan cache we just need to execute below query – DBCC FREEPROCCACHE Whenever we execute this command,… Continue reading SQL Server – Cleaning Procedure Cache for a particular database

Development

SQL Server – Row Level Security in SQL Server 2016 – Part 3

Hi friends, continuing from the previous post in this post we will learn how to add the blocking predicate to restrict the users to perform DML operation (INSERT, UPDATE, DELETE) for others users data. If you want to read the previous posts on Row Level Security you can find those post here: https://kapilsqlgeek.com/2016/05/03/sql-server-row-level-security-in-sql-server-2016-part-1/ https://kapilsqlgeek.com/2016/05/05/sql-server-row-level-security-in-sql-2016-part-2/ Let’s… Continue reading SQL Server – Row Level Security in SQL Server 2016 – Part 3