MSSQL Query Blog
Generating the Code to Remove All Procedures in SQL Server
Hello everyone, In this article, I will talk about how to dynamically generate code for removing all procedures in SQL Server. In SQL Server, in some cases, instead of removing the procedures by manually writing the code, we can remove the relevant procedures by dynamically generating code. You can see...
Finding Version in SQL Server
Hello everyone, In this article, you will learn about learning version information in SQL Server. You can learn your SQL Server version information by using the code below. SELECT CAST(SUBSTRING( CAST(SERVERPROPERTY(‘productversion’) AS VARCHAR(20)), 1, CHARINDEX(‘.’, CAST(SERVERPROPERTY(‘productversion’) AS VARCHAR(20))) – 1 ) AS INT); When you run the above code, you...
Cursor Disconnecting Database Before Detach Operation in SQL Server
Hello everyone, In this article, I will talk about the use of cursor that disconnects the database before detach in SQL Server. Actually I wrote this Cursor on a question. Thinking it might be useful to someone. While detaching in SQL Server, you may encounter errors upon connection. These errors...