Execute stored procedure by passing the Script File(.sql) as Parameter
I have a stored procedure, in wWhich I m passing the script file (
.sql file) as a parameter.
I want to know how
.sql file gets executed through command (not command prompt).
exec my_sp VersionNumber, SqlDeltaScript.sql (it is a file)
I want my stored procedure to execute
Can anyone please help regarding this …
Thanks in advance …
One Solution collect form web for “Execute stored procedure by passing the Script File(.sql) as Parameter”
This does not sound like an ideal situation, but if you have to do this then you could use xp_cmdshell to run the sqlcmd utility to run your script file.
The xp_cmdshell SP must be enabled in order ot use it – see Enable ‘xp_cmdshell’ SQL Server.