declare @xml xml
declare @propertyName varchar(50)
declare @str nvarchar(max)
set @propertyName = ‘s_Code‘
set @xml = ‘<root> <row propertyName="s_Code">test</row><row propertyName="s_Posword">admin</row></root>‘
SELECT @str [email protected](‘(/root/row[@propertyName=sql:variable("@propertyName")])[1]‘, ‘nvarchar(max)‘)
select @str
declare @xml xml
declare @propertyName varchar(50)
declare @str nvarchar(max)
set @propertyName = ‘s_Posword‘
set @xml = ‘<root> <row propertyName="s_Code">test</row><row propertyName="s_Posword">admin</row></root>‘
SELECT @str [email protected](‘(/root/row[@propertyName=sql:variable("@propertyName")])[1]‘, ‘nvarchar(max)‘)
select @str
时间: 2024-10-13 23:26:18