Torna al Thread

DECLARE @strxml xml DECLARE @valstr varchar(MAX) SET @strxml = '<SAV xmlns="http://sav.sap.com/ko" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <xp:Utente> <xp:Anagrafica> <xp:Cognome>ROSSI</xp:Cognome> <xp:Nome>MAURO</xp:Nome> <xp:CodiceFiscale>GHLJNL75A26Z129Y</xp:CodiceFiscale> <xp:Sesso>M</xp:Sesso> </xp:Anagrafica> </xp:Utente> </SAV>' /* @valstr, verrà impostata come parametro di stored procedure in quanto il file xsd può variare */ SET @valstr = 'declare namespace xp="http://sav.sap.com/ko"; (/SAV/xp:Utente/xp:Anagrafica/xp:CodiceFiscale)[1]' SELECT [CodiceFiscale] = @strxml.value('sql:variable("@valstr")', 'varchar(16)')
Copyright © dotNetHell.it 2002-2025
Running on Windows Server 2008 R2 Standard, SQL Server 2012 & ASP.NET 3.5