Category: Stored Procedures
Hello everyone, In this article, I will provide information on how to remove all procedures in SQL Server. In SQL Server we may want to remove all procedures in some cases. You can easily do this using the code below. DECLARE @procName VARCHAR(500); DECLARE cur CURSOR FOR SELECT [name] FROM...
Hello everyone, In this article, I will give information about what are the Differences Between Function and Procedure in SQL Server. This question especially comes to mind of curious friends who are just learning SQL Server. This question may come up in job interviews. It is useful to know briefly,...
Hello everyone, In this article, I will try to give information about finding the last used Stored Procedure in SQL Server. In SQL Server in some cases you may want to find the last used Stored Procedure. You can easily do this using the script below. SELECT DB_NAME(qt.[dbid]) AS [DatabaseName],...
Hello everyone, In this article, I will talk about how to list disk spaces in SQL Server. In SQL Server, in some cases, it may be desired to display disk spaces with a query. In such cases, we can list the disk spaces using the following query. EXEC master..xp_fixeddrives; When...
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...
The process we will do is to create the script of the key fields of a table, namely the Primary Key, Foreign Key and Index Key fields. Even though I don’t use it much, in SQL Server, in some cases, we may only need to create a script for the...
Hello everyone, In this article, I will try to share information about searching words in all tables in SQL Server. In SQL Server, in some cases, we may want to find a word we want in all tables. You can easily do this using the procedure below. Note: It may...
Hello everyone, In this article, I will give information about the prime number checking procedure in SQL Server. You can constantly improve yourself by making such examples in SQL Server. You can easily do this with the help of the code below. CREATE PROC IsNumberPrime @Number INT AS DECLARE @Counter...