Incorrect syntax near 'S'.

  • osql -S VCDB02\Core -E -e -Q "EXEC master.dbo.xp_backup_database @database='xapi', @filename='\\VCDB02\j$\Microsoft SQL Server\MSSQL.2\MSSQL\Backup\Step_11_xapi_backup.BAK', @init= 1, @threads = 3" >> \\vslpbapp1\Phoenix\archive\LogFiles\UpgradeBackupLog_20080912_Step_11.txt

    Incorrect syntax near 'S'.

    Can't figure out why the -S is wrong..

  • i'm guessing it's the wrong S?

    @filename='\\VCDB02\j$\Microsoft SQL Server\MSSQL.2\MSSQL\Backup\Step_11_xapi_backup.BAK'

    should that be

    @filename='"\\VCDB02\j$\Microsoft SQL Server\MSSQL.2\MSSQL\Backup\Step_11_xapi_backup.BAK"'

    note the path is wrapped in double quotes to allow file names with spaces?

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • Not sure, it looks okay. What happens if you run the same command, but specify -E before the -S parameter?

    Joie Andrew
    "Since 1982"

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

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