Contents
How to check SQL Server stored procedures are the same on multiple servers?
Get the object definition from the standardized server, i.e. the server which we know has the correct version. Get the object definition from the server (s) we are checking. Place both into a variable and compare the two. Notify us of the results so we can take action as necessary.
What is the best way to version control my SQL Server stored procedures?
Please check out here What is the best way to version control my SQL server stored procedures?. Might help you identify couple of solutions to this issue. I have previously used a Visual Studio Database Project to manage create table scripts, stored procedure scripts etc.
Can a stored procedure be executed multiple times concurrently?
And this is exactly what this post is about: a stored procedure that is not supposed to be executed multiple times concurrently. You can start a stored procedure, and before it is finished, can start it again from a different connection.
How to protect your stored procedures against multiple transactions?
CATCH block .. In this stored procedure example (of which you can download the script) sp_getapplock is used with @LockOwner = ‘Session’. An “advantage” of using the session might be that you can also use it, when you do not want to use a transaction within your stored procedure.
Is there a way to execute on multiple databases?
Using the sp_MSForEachDB stored procedure you should be able execute on multiple databases of same server. There are two ways I can suggest if you want to avoid doing it programmatically. 1) Use Registered Servers in SSMS. Each target database can be created as a Registered Server within a Server Group.
Is the stored procedure in SQL server encrypted?
A thing to note here is that SQL Server gives us the definition of the stored procedure (assuming it’s not encrypted), but we also see that the output can be quite verbose.
Is there a way to query multiple servers?
To get the hashed value of other servers to compare with the original we’re going to make use of the SQL Server management console’s ability to query multiple remote servers. Tim Ford’s tip on querying multiple servers is a good place to review this technology and it’s the method we’ll use here.