Execute T-SQL file in osql

  • Hello, is there a way to execute a T-SQL file that is stored on my computer from with in osql? In Oracle once you have logged into the database you just use the @ sign followed by the file name and it will execute. Is there an equivalent to this in SQL Server?

    Thank you.

    David

    Best Regards,

    ~David

  • You need shell access, xp_cmdshell, or use a job and give rights to start the job.

    I'd actually set up a job to check a small table, look for 1 , if it's there, run the script. If not, don't.

    Then let the user insert a 1 if they need the script run.

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply