| Author |
Topic |
|
craigmacca
Posting Yak Master
142 Posts |
Posted - 2011-04-24 : 16:32:56
|
| Hi i need to exec a sql command on a server without SQL. this will exec a insert statement on a remote sql server. i found SSEUtil.exe but the sytax is not working, is there a way to install the SQLCMD on it own without installing the whole SQL server install? |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
|
|
nigelrivett
Master Smack Fu Yak Hacker
3385 Posts |
Posted - 2011-04-24 : 16:40:10
|
| I think you just need to install the sql sever native client.==========================================Cursors are useful if you don't know sql.SSIS can be used in a similar way.Beer is not cold and it isn't fizzy. |
 |
|
|
craigmacca
Posting Yak Master
142 Posts |
Posted - 2011-04-24 : 17:10:28
|
| Ok yes i installed sql native client and then the SQLCMD. when i try and run the code below i get SQLCMD is not recongnizedsqlcmd.exe -S serverIpAddress -U username -P password -d database -Q "insert into SimCardReceived (NumberFrom, Message, SimNumber) values ('_FROM_','_BODY_','03')"any ideas? |
 |
|
|
craigmacca
Posting Yak Master
142 Posts |
Posted - 2011-04-24 : 17:28:20
|
| if i do cd "C:\Program Files\Microsoft SQL Server\100\Tools\Binn" and then run the script it works fine, how can i add this to 1 line of code i have tried a few variations but cant get it to work |
 |
|
|
craigmacca
Posting Yak Master
142 Posts |
Posted - 2011-04-24 : 17:33:49
|
| ok sorted it thanks |
 |
|
|
craigmacca
Posting Yak Master
142 Posts |
Posted - 2011-04-24 : 17:57:12
|
| I still have a problem, i can run the code below in cmd and it works fine, i have a windows appliaction which execs this code this stripps out the quotes around the path so it causes an error. is there a way to map "sqlcmd" so windows knows the path. so i can just runthissqlcmd.exe -S ipaddress -U username -P pass -d atabase -Q "insert into SimCardReceived (NumberFrom, Message, SimNumber) values ('_FROM_','_BODY_','02')"instead of this"C:\Program Files\Microsoft SQL Server\100\Tools\Binn\sqlcmd.exe" -S ipaddress -U username -P pass -d atabase -Q "insert into SimCardReceived (NumberFrom, Message, SimNumber) values ('_FROM_','_BODY_','02')" |
 |
|
|
sunitabeck
Master Smack Fu Yak Hacker
5155 Posts |
Posted - 2011-04-24 : 18:22:37
|
| You could try to add C:\Program Files\Microsoft SQL Server\100\Tools\Binn to the system path variable. Here is a description of how to do that in Windows 7. http://geekswithblogs.net/renso/archive/2009/10/21/how-to-set-the-windows-path-in-windows-7.aspx |
 |
|
|
craigmacca
Posting Yak Master
142 Posts |
Posted - 2011-04-24 : 18:51:13
|
| No that didnt work, i am using window server 2003, i updated the path restarted the server and typing sqlcmd into run did not work, any other ideas how i can do this? |
 |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
|
|
|