August 7, 2008 at 5:35 am
Hey, this is my code, it doesn't return any rows
(I copied it, so I hope for no type mistakes)
Declare @EnvCode nvarchar(100);
Declare @Operation nvarchar(100);
Declare @Xml xml;
Set @Xml = '
';
Declare @iDoc int;
Declare @Doc nvarchar(1000);
Set @Doc = cast(@xml as nvarchar(1000));
Exec sp_xml_preparedocument @idoc output, @doc
Select @Operation = Operation, @EnvCode = WORK_ENV_ID
From OPENXML(@idoc, '/*', 2)
with work_env_id nvarchar(100),
Work_env_name nvarchar(100),
operation nvarchar(100),
created_timestamp nvarchar(100),
Deleted timestamp nvarchar(100));
Select @Operation, @EnvCode;
but, if i will remove the xmlns, it will work
Declare @EnvCode nvarchar(100);
Declare @Operation nvarchar(100);
Declare @Xml xml;
Set @Xml = '
';
Declare @iDoc int;
Declare @Doc nvarchar(1000);
Set @Doc = cast(@xml as nvarchar(1000));
Exec sp_xml_preparedocument @idoc output, @doc
Select @Operation = Operation, @EnvCode = WORK_ENV_ID
From OPENXML(@idoc, '/*', 2)
with work_env_id nvarchar(100),
Work_env_name nvarchar(100),
operation nvarchar(100),
created_timestamp nvarchar(100),
Deleted timestamp nvarchar(100));
Select @Operation, @EnvCode;
August 7, 2008 at 8:48 am
Could you check the code, what's the datatype for @Xml on line 3?
August 7, 2008 at 2:48 pm
ok
i have found a way to pass it
select *
from openxml(@idoc, '/*')
it will give you the xml sorted as a table, use it
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply