Wednesday, March 21, 2012

Diff Result Between SQL 7 & SQL 2000

Hi.

When I execute the following sql statement in SQL 2000 DTS or query analyzer, I received the following error message. I used [ ] because my field names have spaces in between.

The same sql statement ran perfect in SQL 7. What could be wrong? Please advise. Thanks a million.

Update SAPvsSQL set [Sales Organisation] = sales_org,
[Value Out By] = val_diff, [Qty Out By] = qty_diff

Error message:

Server: Msg 16882, Level 11, State 1, Procedure sp_runwebtask, Line ...

SQL Web Assistant: Web task not found. Verify the name of the name for possible errors.

Best regardsYou sure you just didn't execute all of the code in the QA window, and you're executing something you don't see?|||And also, what are you setting the columns to?

Those aren't local variables...is there more to the statement?|||Originally posted by Brett Kaiser
And also, what are you setting the columns to?

Those aren't local variables...is there more to the statement?

Hi,

Thank you for your email reply.

Those in [ ] were actual field names in my database table. I used them for display purposes so instead of showing Sales_organation, I display Sales Organisation, Value Out By instead of val_diff and finally Qty Out By instead of qty_diff (look more meanful to the users).

You are right that I didn't show all the script in my previous message because they worked ok until this line. I am just being curious why the same script work PERFECT in SQL 7 but not in SQL 2000. I have been running this same set of script for more than a year and still running fine as at this morning. Reason why I am trying it on SQL 2000 because we will be moving to SQL 2000 totally by end this month.|||No problems here...your doing something else wrong...

USE Northwind
GO

CREATE TABLE SAPvsSQL (
[Sales Organisation] varchar(10)
, [Value Out By] varchar(10)
, [Qty Out By] varchar(10)
)
GO

DECLARE @.Sales_Org varchar(10), @.val_diff varchar(10), @.qty_diff varchar(10)

SELECT @.Sales_Org = 'A', @.val_Diff = 'B', @.qty_diff = 'C'

INSERT INTO SAPvsSQL ([Sales Organisation], [Value Out By], [Qty Out By])
SELECT 'X', 'Y', 'Z'

SELECT * FROM SAPvsSQL

UPDATE SAPvsSQL
SET [Sales Organisation] = @.sales_org
, [Value Out By] = @.val_diff
, [Qty Out By] = @.qty_diff

SELECT * FROM SAPvsSQL
GO

DROP TABLE SAPvsSQL
GO

No comments:

Post a Comment