Jump to content
Sign in to follow this  
Willow

run(@Comspec and OSQL syntax issue

Recommended Posts

Willow

I am attempting to back a SQL Server database via @compspec and OSQL.

When I do not use the @sw_hide syntax, the script runs, however I cannot determine why it will not run with @sw_hide.

This works:
run(@Comspec & " /c osql -E -Q ""backup database Master TO DISK = 'c:\backups\master.bak'")

This does not work, and does not produce an error message.
run(@Comspec & " /c osql -E -Q ""backup database Master TO DISK = 'c:\backups\master.bak'", @SW_HIDE)

Thanks

Share this post


Link to post
Share on other sites
Willow

Thanks for the hint Jos!

This now the working code:

run(@Comspec & " /c osql -E -Q ""backup database Master TO DISK = 'c:\backups\master.bak'", "",@SW_HIDE)

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.