OSQL utility space char

  • I am using OSQL utility to update DB table with a batch file.

    expl:

    OSQL -l 30 -b -d DCL -S TEST -U dclsql -P test -Q "declare @r INT; execute @r = UPDATE_UNITNAME "@UnitName='Test1',

    @Comment='no comments'"

    if comment field is one word there is no problem, if it has couple of words (space separator between words) it gives an error.

    Please help to resolve this problem

    Thank you

  • there was an extra double quote....try this

    OSQL -l 30 -b -d DCL -S TEST -U dclsql -P test -Q "declare @r INT; execute @r = UPDATE_UNITNAME @UnitName='Test1',@Comment='no comments'"

    Prakash Heda
    Lead DBA Team - www.sqlfeatures.com
    Video sessions on Performance Tuning and SQL 2012 HA

  • I am sorry there was a typo, I had one quote and it doesn't work

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

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