Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 OSQL help

Author  Topic 

dirtydavey
Yak Posting Veteran

80 Posts

Posted - 2008-05-15 : 05:35:25
Hi All,

I am trying to use OSQL (somthing I am new too)

I have the folllowing syntax, but it does not seam to work. Any ideas would be very gratfull.

osql -Usa -Ppassword -SServername -Q"select @@version"

Thanks in advance

Dave


Dave Dunckley says there is a law for the rich and a law for the poor and a law for
Dirty Davey.

harsh_athalye
Master Smack Fu Yak Hacker

5581 Posts

Posted - 2008-05-15 : 05:50:21
What error do you get?

Harsh Athalye
India.
"The IMPOSSIBLE is often UNTRIED"
Go to Top of Page

dirtydavey
Yak Posting Veteran

80 Posts

Posted - 2008-05-15 : 05:55:14
It says The filename, directory name, or volume lable syntax is incorrect


Dave Dunckley says there is a law for the rich and a law for the poor and a law for
Dirty Davey.
Go to Top of Page

harsh_athalye
Master Smack Fu Yak Hacker

5581 Posts

Posted - 2008-05-15 : 05:58:36
make sure you are in SQL Server's tools\binn directory while executing the command.

Harsh Athalye
India.
"The IMPOSSIBLE is often UNTRIED"
Go to Top of Page

dirtydavey
Yak Posting Veteran

80 Posts

Posted - 2008-05-15 : 06:05:55
Its funny if I use -E it works fine!

I cant figure it out.

Dave Dunckley says there is a law for the rich and a law for the poor and a law for
Dirty Davey.
Go to Top of Page

harsh_athalye
Master Smack Fu Yak Hacker

5581 Posts

Posted - 2008-05-15 : 06:08:23
Are you able to connect to SQL Server using same SQL Server authentication while connecting from SSMS?

Harsh Athalye
India.
"The IMPOSSIBLE is often UNTRIED"
Go to Top of Page

dirtydavey
Yak Posting Veteran

80 Posts

Posted - 2008-05-15 : 06:13:44
Yep no problems! Its very strange

Dave Dunckley says there is a law for the rich and a law for the poor and a law for
Dirty Davey.
Go to Top of Page

dirtydavey
Yak Posting Veteran

80 Posts

Posted - 2008-05-15 : 06:51:43
Got it, I had a funny char in my password, and it was chciking it out. I put ""'s round the password and it works fine now.

Thanks for your help

Dave


Dave Dunckley says there is a law for the rich and a law for the poor and a law for
Dirty Davey.
Go to Top of Page
   

- Advertisement -