question

balu.arunkumar avatar image
balu.arunkumar asked

I have one update statement. It will update, when we manually run the query.

But it will not update when we put the same statement in Job. Pls find below query. UPDATE EXISTING_TOPUP SET [DESCRIPTION]=B.[DESCRIPTION] FROM EXISTING_TOPUP A,mis.dbo.LT_ALL B WHERE A.ACCOUNT=B.MSISDN AND B.recharge_date=convert(varchar(8),getdate()-1,112) UPDATE EXISTING_TOPUP SET [DESCRIPTION]=B.[DESCRIPTION] FROM EXISTING_TOPUP A,mis.dbo.LT_ALL B WHERE A.ACCOUNT=B.MSISDN AND B.recharge_date= convert(varchar(8),getdate()-1,112)
update
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

·
ThomasRushton avatar image
ThomasRushton answered
Have you told the job which database to execute the statement in? Either prefix your statement with: USE DatabaseName or fully qualify the object name: UPDATE DatabaseName.SchemaName.Existing_topup ... FROM DatabaseName.Existing_topup A, MIS.dbo.LT_ALL B ... or, when setting up the job, there's an option to say which database...
1 comment
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

eaglescout avatar image eaglescout commented ·
Great thinking @ThomasRushton ! I've made this mistake before and correcting it to the full data source path name solved it.
0 Likes 0 ·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.