SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


there is any Way in SQL-Server?


there is any Way in SQL-Server?

Author
Message
Saravanan_tvr
Saravanan_tvr
SSC-Addicted
SSC-Addicted (424 reputation)SSC-Addicted (424 reputation)SSC-Addicted (424 reputation)SSC-Addicted (424 reputation)SSC-Addicted (424 reputation)SSC-Addicted (424 reputation)SSC-Addicted (424 reputation)SSC-Addicted (424 reputation)

Group: General Forum Members
Points: 424 Visits: 1349
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....

Many Thanks!
S.saravanan
“I am a slow walker, but I never walk backwards-
Abraham Lincoln”
SA-CrackSQL
SA-CrackSQL
SSC Journeyman
SSC Journeyman (83 reputation)SSC Journeyman (83 reputation)SSC Journeyman (83 reputation)SSC Journeyman (83 reputation)SSC Journeyman (83 reputation)SSC Journeyman (83 reputation)SSC Journeyman (83 reputation)SSC Journeyman (83 reputation)

Group: General Forum Members
Points: 83 Visits: 547
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
Saravanan_tvr
Saravanan_tvr
SSC-Addicted
SSC-Addicted (424 reputation)SSC-Addicted (424 reputation)SSC-Addicted (424 reputation)SSC-Addicted (424 reputation)SSC-Addicted (424 reputation)SSC-Addicted (424 reputation)SSC-Addicted (424 reputation)SSC-Addicted (424 reputation)

Group: General Forum Members
Points: 424 Visits: 1349
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'.

Many Thanks!
S.saravanan
“I am a slow walker, but I never walk backwards-
Abraham Lincoln”
SA-CrackSQL
SA-CrackSQL
SSC Journeyman
SSC Journeyman (83 reputation)SSC Journeyman (83 reputation)SSC Journeyman (83 reputation)SSC Journeyman (83 reputation)SSC Journeyman (83 reputation)SSC Journeyman (83 reputation)SSC Journeyman (83 reputation)SSC Journeyman (83 reputation)

Group: General Forum Members
Points: 83 Visits: 547
Open a notepad file..type in the below command

sqlcmd -s -E -Q<"Your Query">
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
Saravanan_tvr
Saravanan_tvr
SSC-Addicted
SSC-Addicted (424 reputation)SSC-Addicted (424 reputation)SSC-Addicted (424 reputation)SSC-Addicted (424 reputation)SSC-Addicted (424 reputation)SSC-Addicted (424 reputation)SSC-Addicted (424 reputation)SSC-Addicted (424 reputation)

Group: General Forum Members
Points: 424 Visits: 1349
THANKS WORKING FINE....

Many Thanks!
S.saravanan
“I am a slow walker, but I never walk backwards-
Abraham Lincoln”
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search