Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Job not running 1

Status
Not open for further replies.

Cpreston

MIS
Mar 4, 2015
972
GB
Hi

I have set a scheduled task to run but it keeps complaining the code is incorrect and does not run.

If I run the code in in a query window it runs fine. Could someone advise how the code should be so it runs in a job.

UPDATE "148-SalesAnalysisReportData" SET ManualDescription = ProductDescription where ManualDescription is null
go


It is set tot he correct database and is using the SA log in.

Thanks
 
GO is not T-SQL command.
It is used as batch terminator in query window.
Remove it from the code.


Borislav Borissov
VFP9 SP2, SQL Server
 
Hi

Ok I have taken the GO out so the code is as below

UPDATE "148-SalesAnalysisReportData"
SET ManualDescription = ProductDescription where ManualDescription is null

I tired to run it but still the same issue
The type is set to Transact-SQL Script (T-sql) should this be something else, if so what please?

Thanks
 
try

use dbname; -- replace with correct name
UPDATE [148-SalesAnalysisReportData]
SET ManualDescription = ProductDescription where ManualDescription is null;

and what is the exact error given?

and you should not be using SA as the job owner, neither as a runas.

Regards

Frederico Fonseca
SysSoft Integrated Ltd

FAQ219-2884
FAQ181-2886
 
Hi

Ok I just added your code and then ran , and it ran successfully.
It was syantax error.

So I will see how it works, many thanks.

 
I'm a little late on this but the issue was most likely due to the double quotes ("). Those should have been single quotes (') or square brackets, which is why Frederico's suggestion worked.

-SQLBill

The following is part of my signature block and is only intended to be informational.
Posting advice: FAQ481-4875
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top