Jump to content
Sign in to follow this  
Willow

run(@Comspec and OSQL syntax issue

Recommended Posts

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

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  

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...