Hi All
I have spent the last couple of days re-writing stored procedures for one of our systems. These sprocs are rather complicated with branches in the code depending on both params and the results of selects within the sproc. Now SSMS does some syntactical validation on the code but as we all know SQL Server does not do referencial checks on the tsql statements(insert, update,delete...) at creation time.
The only way you find out if the statement in the stored proc has a typeo or references a column or table that does not exist is if you execute the procedure and the execution plan includes the statement in question. With the size of - and number of statements in these stored procedures this is a problem for me. Does anyone know how I can validate all the statements in a stored procedure without having to run the stored procedure with parameters and data that will test every conceveble execution plan? All I need is for SQL server to check if the tables I reference in the sproc and their related columns exist and tell me if they dont'
any help and suggestions would be great
I have spent the last couple of days re-writing stored procedures for one of our systems. These sprocs are rather complicated with branches in the code depending on both params and the results of selects within the sproc. Now SSMS does some syntactical validation on the code but as we all know SQL Server does not do referencial checks on the tsql statements(insert, update,delete...) at creation time.
The only way you find out if the statement in the stored proc has a typeo or references a column or table that does not exist is if you execute the procedure and the execution plan includes the statement in question. With the size of - and number of statements in these stored procedures this is a problem for me. Does anyone know how I can validate all the statements in a stored procedure without having to run the stored procedure with parameters and data that will test every conceveble execution plan? All I need is for SQL server to check if the tables I reference in the sproc and their related columns exist and tell me if they dont'
any help and suggestions would be great