Help needed...

  • hi all

    i m testing a batch job tht involves a lot of OSQL

    there is a statement like NOW >> \\some path\file.log

    but this NOW is not recognised by the system

    i typed NOW /? in command prompt but got error "bad command"

    Can u help whether is part of osql or not?

    Thanks In advance.

  • Now is the KEY WORD IN VB. If you simply use DOS command, you may try DATE. If you use either OSQL or ISQL, you may try to use GETDATE() in your output file.

  • OSQL is just a program that allows you to pipe Transact-SQL commands into a SQL Server instance. Its command syntax, aside from the syntax specific to OSQL (which you can get by typing OSQL -?) is T-SQL.

    If you're invoking OSQL from a command file, you can use DATE /T and TIME /T in the same fashion as how you were trying to use NOW >>..., the difference is that you'll have two lines for your time stamp instead of one.

    There used to be a Norton Utility program called DT that gave you both on one line, I believe you could also use it as a timer. It should be a pretty simple task to write a VB program to give yourself NOW functionality, for that matter there's probably one lurking online somewhere.

    -----
    [font="Arial"]Knowledge is of two kinds. We know a subject ourselves or we know where we can find information upon it. --Samuel Johnson[/font]

  • O-SQL is the command line utility which allows you to connect any sql sever instance locally or on netwrk and perform T-SQL operation within it. It means O-SQL supports T-SQL language so you can use with in the O-SQL.

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

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