OSQL help

I am trying to create a batch file to automate a process for RMS. When I type in the sql statement in RMS Administrator it runs fine. But when I create a batch file I get an error message as follows:

Msg 208, Level 16, State 1, Server ******, Line 1 Invalis object name 'CUSTOMER'.

Here is the statement I am using (with the proper username and server name of course):

OSQL -U sa -P -S -Q "UPDATE CUSTOMER SET CustomText4=left(newid(),6) WHERE Customer.CustomText4=' '"

I then tried running several very simple osql statements from the command prompt and kept geting errors for invalid objects, syntax, etc. It seems like it did not recognize the table names. I'll venture a guess that RMS Administrator fills in some information or syntax on the back end that I am missing in my command prompt statement.

Any help would be appreciated!

An FYI for anyone using NitroSell's website integration (and possibly other

3rd party solutions)... ALL of your customer accounts are accessible via your website, not just the ones created via the website. Therefore if you have a non-web created account it will have a blank password field which in turn means that all you need to access the account (and personal information) is the account number. I think we can all agree that account number schemes are not to hard to figure out and therfore creates a security issue.
Reply to
AL
Loading thread data ...

hi Al, First of all the statement is not good written, you haven't mentioned the database name so how come it will update which database. like normally sql server install with master, msdb, temp and other youre crated database so it won't going to rms db. second you haven't speicy the Password, the server name which is also require becuase you are entering the -P and -S clause. See below the caluse

osql -U sa -P sa -S -d RMSSample -Q "UPDATE Customer SET CustomText4=left(newid(),6) WHERE CustomText4=''"

Change the server name and -d databse name to run the query for. Rate once work.

"AL" wrote:

Reply to
Akber Alwani

Akber,

Thank you! I actually had the correct server and username in my statement I just did not want to publish them here in the newsgroup for all the world to see. The part I was missing was the database name. This makes sense now as RMS Administrator is already connected to the RMS database and therefore would not need that portion in the sql statement.

Thank you again for your help!!!

"Akber Alwani" wrote:

Reply to
AL

Reply to
Akber Alwani

BeanSmart website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.