SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
ALTER VIEW [dbo].[viewProductExportUpdated2]
AS
SELECT dbo.ProductCategories.ProductCategoryID AS ProductCode, dbo.ProductCategories.ProductCategoryName AS ProductTitle,
dbo.Products.ShortDescription AS ProductShortDesc, dbo.Products.LongDescription AS ProductLongDesc,
CAST(dbo.Products.ProductXML AS XML) AS ProdXml, ProdXml.value('data(Products/PackSize)[1]', 'nvarchar(max)') AS ProductPackSize
FROM dbo.ProductCategories INNER JOIN
dbo.Products ON dbo.ProductCategories.ProductCategoryID = dbo.Products.ProductCategoryID
WHERE (dbo.ProductCategories.Deleted = 0)
GO
SET ANSI_NULLS OFF
GO
SET QUOTED_IDENTIFIER OFF
GO
ntext列(ProductXML)をxmlにキャストしようとしていて、その上で選択を実行しようとしています。Sqlがxmlにキャストされ、キャスト時に.valueを実行します。
が、私は次のエラーを取得しています: メッセージ4121、レベル16、状態1、プロシージャviewProductExportUpdated2、ライン4 はコラム「ProdXml」またはユーザー定義関数または集計「ProdXml.value」のいずれかを見つけることができません、またはその名前はあいまいです。
サイトは古いサイトであり、我々はなどをXMLにcoloumnを変更する時間を持っていけない...
おかげ
マイク