Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

Column name contains an invalid XML identifier as required Expand / Collapse
Author
Message
Posted Monday, June 01, 2009 12:45 PM
SSChasing Mays

SSChasing MaysSSChasing MaysSSChasing MaysSSChasing MaysSSChasing MaysSSChasing MaysSSChasing MaysSSChasing Mays

Group: General Forum Members
Last Login: Yesterday @ 12:00 PM
Points: 644, Visits: 1,116
Hey everyone. Weird error today that I haven't seen before and can't seem to find a lot on. Anyone see anything in my code below that would cause the following error to occur?

Column name 'TEXT()' contains an invalid XML identifier as required by FOR XML; '('(0x0028) is the first character at fault.


UPDATE t
SET InventoryList = SUBSTRING(tmp2.Products, 1, LEN(tmp2.products) - 1)
FROM #temp AS t
INNER JOIN (SELECT List AS Products, t.BCKey
FROM #temp AS t
CROSS APPLY(SELECT CONVERT(NVARCHAR(30), i.productid) + '|' AS [TEXT()]
FROM orders AS o WITH(NOLOCK)
INNER JOIN orderstatus AS os WITH(NOLOCK) ON o.statusid = os.statusid
INNER JOIN orderdetails AS od WITH(NOLOCK) ON o.orderid = od.orderid
INNER JOIN inventory AS I WITH(NOLOCK) ON od.inventoryid = i.inventoryid
INNER JOIN inventorymisc AS im WITH(NOLOCK) ON i.inventoryid = im.inventoryid
WHERE o.subjectid = t.bckey
AND os.official = 1
AND secondarysubjecttypeid = 0
AND (im.DistributorSignupPack = 1
OR im.distributorUpgradepack = 1
OR gfRanktypeid IS NOT NULL
)
AND o.bonusdate BETWEEN @qualifyStart AND @qualifyEnd
FOR XML PATH('')
) AS DUMMY(List)
WHERE list IS NOT NULL
AND t.ID = @bonusrunid
) AS TMP2 ON TMP2.BCKey = T.BCKey
WHERE t.ID = @bonusrunid

Thanks,

Fraggle
Post #726908
Posted Monday, June 01, 2009 1:07 PM


SSChampion

SSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampion

Group: General Forum Members
Last Login: Today @ 10:54 AM
Points: 14,818, Visits: 19,073
Have you tried changing this, 'TEXT()' , to this 'TEXT'?


Lynn Pettis

For better assistance in answering your questions, click here
For tips to get better help with Performance Problems, click here
For Running Totals and its variations, click here or when working with partitioned tables
For more about Tally Tables, click here
For more about Cross Tabs and Pivots, click here and here
Managing Transaction Logs

SQL Musings from the Desert Fountain Valley SQL (My Mirror Blog)
Post #726921
Posted Monday, June 01, 2009 1:11 PM
SSChasing Mays

SSChasing MaysSSChasing MaysSSChasing MaysSSChasing MaysSSChasing MaysSSChasing MaysSSChasing MaysSSChasing Mays

Group: General Forum Members
Last Login: Yesterday @ 12:00 PM
Points: 644, Visits: 1,116
Actually, I was able to figure out the error thanks to help from a .NET guy (embarrassing ain't it). TEXT() should be text(). The only thing he couldn't tell me what why this was the case. Thoughts?

Nathan
Post #726925
Posted Thursday, August 06, 2009 11:59 AM
SSC Journeyman

SSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC Journeyman

Group: General Forum Members
Last Login: Sunday, January 15, 2012 11:05 PM
Points: 84, Visits: 441
Actually, I was able to figure out the error thanks to help from a .NET guy (embarrassing ain't it). TEXT() should be text(). The only thing he couldn't tell me what why this was the case. Thoughts?

Yes...I believe that is because text() represents an XML data type and XML is very case-sensitive!



Post #766438
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse