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 2008 Forums
 Transact-SQL (2008)
 I need help with this error!

Author  Topic 

pauleds2109
Starting Member

1 Post

Posted - 2011-02-15 : 10:59:28
Hi all

I have a stored procedure that includes the following code:


/*** temporary table for shredded XML records ***/
DECLARE @Temp TABLE
(
orderid INT,
cargoready SMALLDATETIME,
estpallets INT,
estweight INT,
estvolume REAL,
updguid VARCHAR(30),
companyid INT,
userid INT,
dtupdated SMALLDATETIME
)

/*** parse XML file and dump into temp ***/
INSERT INTO @Temp
(orderid, cargoready, estpallets, estweight, estvolume, updguid, companyid, userid, dtupdated)
SELECT
T0.Item.value('@orderid', 'INT') orderid,
T0.Item.value('@cargoready', 'SMALLDATETIME') cargoready,
T0.Item.value('@estpallets', 'INT') estpallets,
T0.Item.value('@estweight', 'INT') estweight,
T0.Item.value('@estvolume', 'REAL') estvolume,
T0.Item.value('@updguid', 'VARCHAR(30)') estvolume,
T0.Item.value('@companyid', 'INT') companyid,
T0.Item.value('@userid', 'INT') userid,
@dateupdated dtupdated
FROM @XMLCargo.nodes('/root/row') as T0(Item);


This works on my test server but not on my live server, when I look at the procedure in the sql editor I have this message:

cannot find either column "T0" or the user-defined function "T0.item.value" or aggregate, or the name is ambiguous

I urgently neeed to get his working. Thanks in asdvance for any advice!

DonAtWork
Master Smack Fu Yak Hacker

2167 Posts

Posted - 2011-02-15 : 11:46:40
Check your COMPATIBILITY_LEVEL setting for the database on your prod server.

http://weblogs.sqlteam.com/jeffs/archive/2008/05/13/question-needed-not-answer.aspx
How to ask: http://weblogs.sqlteam.com/brettk/archive/2005/05/25/5276.aspx

For ultra basic questions, follow these links.
http://www.sql-tutorial.net/
http://www.firstsql.com/tutor.htm
http://www.w3schools.com/sql/default.asp
Go to Top of Page
   

- Advertisement -