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).

  • Group and Label with trip Number
  • ASP.NET Web Service for android
  • SQL Server : table with foreign key to itself with cascade delete
  • SQL CLR trigger: name of the context DB
  • How do I get list of all tables in a database using TSQL?
  • Repair Suspected TFS database
  • exec my_sp VersionNumber, SqlDeltaScript.sql (it is a file)

    I want my stored procedure to execute SqlDeltaScript.sql

    Can anyone please help regarding this …

    Thanks in advance …

  • is it possible to save metadata about mdf file inside the file?
  • Not Exists not playing well with multiple columns
  • Is there a way to determine if a parameter in a stored proc has a default value (and thus not required) in code - .Net?
  • How to return multiple values from a SQL Case subquery without grouping
  • How do I remove non-breaking spaces from a column in SQL server?
  • Get Average from last 26 entries
  • 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.

    MS SQL Server is a Microsoft SQL Database product, include sql server standard, sql server management studio, sql server express and so on.