Inconsistent sqlcmd output

  • I ran across something I can't explain whilst applying some changes to an environment today.

    As part of our release process we script changes (T-SQL/DDL) and apply them to each of our test environments in turn. The output is saved, so that it can be checked for errors and, ultimately, compared to the output produced when the changes are deployed to production, as a check.

    The changes are applied by calling sqlcmd like so (except that it's part of a batch file):

    sqlcmd -S server.domain.co.uk:port -e -i DeploymentScript.sql

    All the output of the batch file gets piped to a file. This includes all the sql plus any messages.

    When deployed to the 2nd environment, sometimes the standard rowcount message after a statement was not produced. In the first environment (same schema) they were. Also I have checked the data and rows were affected, so as far as I can tell the statements did run and did affect rows. The only difference being the output.

    output from 1st environment (trimmed):

    merge dbo.table1

    with ....

    print 'merge 1 complete'

    merge dbo.table2

    with ....

    print 'merge 2 complete'

    merge dbo.table3

    with ....

    print 'merge 3 complete'

    (1234 rows affected)

    merge 1 complete

    (5678 rows affected)

    merge 2 complete

    (9123 rows affected)

    merge 3 complete

    output from 2nd environment (trimmed):

    merge dbo.table1

    with ....

    print 'merge 1 complete'

    merge dbo.table2

    with ....

    print 'merge 2 complete'

    merge dbo.table3

    with ....

    print 'merge 3 complete'

    merge 1 complete

    (4681 rows affected)

    merge 2 complete

    merge 3 complete

    The 3 merge statements were in the same script, just how they were outputted in the output. A similar thing happened somewhere else in the deployment.

    I can't think of any scenario that would cause this to happen.

    Any ideas?

  • This was removed by the editor as SPAM

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

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