there is any Way in SQL-Server?

  • My Job role is Client Back-end Support and Back-end Coding..

    If there is any problem in client live database...

    here i have to write a query it may be set of Tsql query , altering procedure,fn,trigger..etc..

    After Finishing my task I have to create a small program in vb,.net etc..

    and then converting exe file ,finally send to them .. After they can executes

    Reason.. They are don't know to execute that set of tsql in sql server,

    I need to Know?

    Is there any way in Sql server can we create a executable file for set of tsql Like Batch File....

  • Yes, its very much possible using sqlcmd..hopefully you are using SQL 2005 version...

    Sample script

    sqlcmd -S. -E -Q "select * from sys.objects"

    pause

    save the above file as .bat and try

  • In 2005 ,

    If i running in query window that gives the below error..

    tell me clearly.. like step by step...

    Msg 102, Level 15, State 1, Line 1

    Incorrect syntax near 'S'.

  • Open a notepad file..type in the below command

    sqlcmd -s -E -Q

    pause

    save the file as .bat file and just double click on the file..it will run the required commond...for testing initially you can specify just a select statement for your query

  • THANKS WORKING FINE....

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

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