My database has had several successive maintainers over the years and any naming guidelines that may have once been in place have been ignored.
I'd like to rename the stored procedures to a consistent format. Obviously I can rename them from within SQL Server Management Studio, but this will not then update the calls made in the website code behind (C#/ASP.NET).
Is there anything I can do to ensure all calls get updated to the new names, short of searching for every single old procedure name in the code? Does Visual Studio have the ability to refactor such stored procedure names?
NB I do not believe my question to be a duplicate of this question as the latter is solely about renaming within the database.
To rename a stored procedureExpand Stored Procedures, right-click the procedure to rename, and then click Rename. Modify the procedure name. Modify the procedure name referenced in any dependent objects or scripts.
Yes, two or more procedures can have the same name. This is also known as polymorphism which is a core principle of Object Oriented Programming. Procedures are written for code reuse and to prevent the same code repetition. So they can be called as many times as required by the program.
Single Stored Procedure per CALL StatementA single executable statement can call only one stored procedure. In contrast, a single SQL statement can call multiple functions. Similarly, a stored procedure, unlike a function, cannot be called as part of an expression.
You could make the change in stages:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With