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 query problem

Author  Topic 

starnold
Yak Posting Veteran

83 Posts

Posted - 2008-02-04 : 11:05:59
I am DOS batching a Transact-SQL query and keep getting an error of field not found! I am importing in some data and then running a SQL script to manipulate some fields.

The error is on the below query:

UPDATE Model_RMS_SNMS
SET [T06RMSc0_ValEmp_£] = ([T06RMSc0_ValEmp]/1.8)

All the above tables/fields exist and the scripts works when running from SQL Query Analyzer?

rmiao
Master Smack Fu Yak Hacker

7266 Posts

Posted - 2008-02-04 : 23:04:52
Did you specify correct db name in osql?
Go to Top of Page

starnold
Yak Posting Veteran

83 Posts

Posted - 2008-02-05 : 04:10:52
My osql is:

osql -S USBHBIAS1 -d SFDC -E -e -i E:\SFDC\SQL\Model_Ammend.sql > E:\SFDC\LOGS\Model_Ammend.LOG
Go to Top of Page

rmiao
Master Smack Fu Yak Hacker

7266 Posts

Posted - 2008-02-05 : 23:12:20
Which schema the table is under? Have to specify schema if it's not under dbo.
Go to Top of Page

starnold
Yak Posting Veteran

83 Posts

Posted - 2008-02-06 : 04:43:50
It is under the dbo schema
Go to Top of Page

rmiao
Master Smack Fu Yak Hacker

7266 Posts

Posted - 2008-02-07 : 00:01:32
Then have to ensure you connect to correct sql instance and you have proper permission.
Go to Top of Page

jezemine
Master Smack Fu Yak Hacker

2886 Posts

Posted - 2008-02-07 : 02:03:04
also, since you are using 2005, you should be using sqlcmd, not osql. osql is deprecated in 2005.


elsasoft.org
Go to Top of Page
   

- Advertisement -