Showing posts with label xml. Show all posts
Showing posts with label xml. Show all posts

Sunday, March 25, 2012

Data Source Credentials problem

Hi guys.

I've got an Xml DataSource in my report server, used to talk to a web service to retrieve it's data. Now, since this is an Xml DataSource that talks to a Web service, i shouldn't have to give it credentials to run with, or - since the web service runs on the machine right next to my report server - I could use Windows Integrated Auth.

However ... when I try to use Windows Integrated auth. I get back the error:

"This

data source is configured to use Windows integrated security. Windows integrated

security is either disabled for this report server or your report server is

using Trusted Account mode. "


And when I tried to use no credentials, before I can even see the report, I get the error:

"the user data source credentials that are required to execute this report are

not stored in the report server database." - where I just told it that it doesn't need credentials to run this datasource !!!

For the first error you got, there are two possible causes:

1. If you are running RS in sharepoint integrate mode, make sure the authentication mode you set in sharepoint central admin is Windows Integrated, not Trusted Account mode.

2. If you are running RS in non-sharepoint integrate mode, make sure this system properties is set to be true: "EnableIntegratedSecurity".

For the second error, if you set to be none, RS uses a fixed credential configured in Report Server config file to connect to your data source, you have to add it.

|||For the second issue make sure that unattended execution account is initialized. Open Reporting Services Config Manager and goto Execution Account tab|||No, I'm not running in Sharepoint Integrated mode, but I'll try the second resolution and let you guys know what happened, thanx :)|||

Well, here goes the whole story ...

First of all, we're using the Forms Authentication sample in our installation. Thought I should mention that in view of the error I'm about to write ...

Well, I've used the R. Services Configuration tool to set the execution account to a user in my domain. The config tool accepted it fine, only when I tried to run the report I got back:

  • |||

    Finally, i got it to work !!! I created a new user account fot the execution account, one that had no xml special characters in it's uname/pwd and it worked fine.

    Now, you guys should forward this to the implementing team because it's just rediculous ...

    If the username / password of the Execution Account has any sort of "XML special characters" in it, the WMIProvider will fail to set the exec. account details. Although those credentials actually get written encrypted in the xml config file, so that doesn't seem really necessary.

    Anyway, that WOULD be ok, u n l e s s ... if you try to type in the credentials, replacing those special characters with their &xxx; equivalents, the tool will succeed, and write out those details encrypted in the xml file. BUT !!! It won't replace the & to an & in the encrypted string it writes out, so when you try to run reports, login will fail, and you're left there wondering what went wrong.

  • Sunday, March 11, 2012

    Data not Exported to CSV/XML

    I have a table where one of the columns is hidden based on the following criteria:
    =IIF(Fields!ChildIsEmpty5.Value, true, false)

    If the Fields!ChildIsEmpty5.Value is false (so the column is showing), and I export the report to CSV or XML, the data in that column is not exported.

    Is there another property I can select to get this data to be exported? Or is this functionality not supported?

    Thanks for any help you can provide!
    Jessica

    Jessica,

    This functionality is by design. Fields where visibility (hidden) is expression-based are not output to CSV/XML by default.

    If you always want this column present in the CSV/XML output, you can set DataElementOutput property of the column to 'Yes'(or in Data Output tab, set data output to 'Yes')

    Thanks!

    |||But what to do if i need to show or hide object, depending on some condition(expression) in export also?|||

    Still not working.

    I selected the report item (textbox), right click, select properties, data output tab and I set the output from auto to yes. This item still does not show up in the xml output file.

    thanks,

    Helmut.

    Data not Exported to CSV/XML

    I have a table where one of the columns is hidden based on the following criteria:
    =IIF(Fields!ChildIsEmpty5.Value, true, false)

    If the Fields!ChildIsEmpty5.Value is false (so the column is showing), and I export the report to CSV or XML, the data in that column is not exported.

    Is there another property I can select to get this data to be exported? Or is this functionality not supported?

    Thanks for any help you can provide!
    Jessica

    Jessica,

    This functionality is by design. Fields where visibility (hidden) is expression-based are not output to CSV/XML by default.

    If you always want this column present in the CSV/XML output, you can set DataElementOutput property of the column to 'Yes'(or in Data Output tab, set data output to 'Yes')

    Thanks!

    |||But what to do if i need to show or hide object, depending on some condition(expression) in export also?|||

    Still not working.

    I selected the report item (textbox), right click, select properties, data output tab and I set the output from auto to yes. This item still does not show up in the xml output file.

    thanks,

    Helmut.

    Saturday, February 25, 2012

    Data migration into SQL server 2005 from xml files

    Friends

    Any one of you please provide step by step info for migrating sql server 2005 from xml files.

    cheers :)

    satish

    Try to provide as much detail as you can so that someone can help you.

    Data mapping and Importing app for SQL server

    Hello,

    Our company often receives data from outside sources to add to our application. This data is usually provided to us in Excel, CSV, XML, etc. The files that we receive usually have different columns from the columns in our database, so we have to map these columns to our table structure to import.

    I'm looking for an application that will easily allow me to load up the data file (whatever type it may be), expose the columns in the data file, allow me to map these columns in our SQL server, then import the data. I know that this can be done as DTS, however I'm looking for alternatives. Does anyone have any recommendations?

    Thanks in advance.

    I just dont have a solution to your post but i have the same problem. I just want to get notifications on reply event of this thread. Hopefully some one will answer you and i will benefit.

    Friday, February 24, 2012

    data length more than ...

    Hello
    I have problem with reading from XML when XML is to large.
    Program delare 1-n variables where is declaration but can no make more
    delarations than length 8000 :((

    drop table tblBooksEx
    CREATE TABLE [tblBooksEx] (
    [Row_ID] [int] IDENTITY (1, 1) NOT NULL ,
    [BooksData] [text] COLLATE Polish_CI_AS NULL ,
    CONSTRAINT [PK__tblBooksEx__17036CC0] PRIMARY KEY CLUSTERED
    (
    [Row_ID]
    ) ON [PRIMARY]
    ) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
    GO
    insert into tblBooksEx(booksdata) values('')
    exec master..xp_cmdshell 'TextCopy.exe /S serv /U usr /Ppsv /D Northwind /T
    tblBooksEx /C BooksData /F c:\SCN.xml /W "WHERE Row_ID=1" /I'

    /*PART 1*/
    DECLARE @.id int
    DECLARE @.idoc int
    SET @.id = 1 -- or whatever the id

    DECLARE @.datalen int
    DECLARE @.sql varchar(8000)
    DECLARE @.sql1 varchar(8000)
    DECLARE @.cnt int
    -- get the length
    SELECT @.datalen = DATALENGTH (booksdata) / 4000 + 1 FROM tblBooksEx WHERE
    row_id = @.id

    -- phase 1 collect into @.sql declarations of @.str1, @.str2,...@.strn
    SET @.cnt = 1
    SET @.sql='DECLARE '
    SET @.sql1 = ''
    WHILE (@.cnt <= @.datalen)
    BEGIN
    SELECT
    @.sql = @.sql + CASE @.cnt
    WHEN 1 THEN ''
    ELSE ', ' + CHAR(13)
    END
    + ' @.str'+CONVERT(varchar(10),@.cnt)+' VARCHAR(4000)'
    SET @.cnt = @.cnt + 1
    END
    -- phase 2 collect into @.sql selection of chunks (takng care of length)
    SET @.cnt = 1
    WHILE (@.cnt <= @.datalen)
    BEGIN
    IF LEN(@.sql) < 7850
    SELECT @.sql = @.sql + CHAR (13) +
    'SELECT @.str' + CONVERT(VARCHAR(10), @.cnt) + ' =
    REPLACE(SUBSTRING(booksdata, ' +
    CONVERT(VARCHAR(30), (@.cnt-1)*4000+1) + ', 4000),CHAR(39),
    CHAR(39)+CHAR(39) ) ' +
    'FROM tblBooksEx ' +
    'WHERE row_id = ''' + cast(@.id as varchar) + ''''
    ELSE
    SELECT @.sql1 = @.sql1 + CHAR (13) +
    'SELECT @.str' + CONVERT(VARCHAR(10), @.cnt) + ' =
    REPLACE(SUBSTRING(booksdata, ' +
    CONVERT(VARCHAR(30), (@.cnt-1)*4000+1) + ', 4000),CHAR(39),
    CHAR(39)+CHAR(39) ) ' +
    'FROM tblBooksEx ' +
    'WHERE row_id = ''' + cast(@.id as varchar) + ''''
    SET @.cnt = @.cnt + 1
    END

    /*PART 2*/
    -- phase 3 preparing the 2nd level dynamic sql
    SELECT @.sql1 = @.sql1 + CHAR(13) + 'EXEC ('+ CHAR(13) + '''DECLARE @.idoc
    int'+ CHAR(13) +
    'EXEC sp_xml_preparedocument @.idoc OUT, ''' + '
    SET @.cnt = 1
    WHILE (@.cnt <= @.datalen)
    BEGIN
    SELECT @.sql1 = @.sql1 + CHAR (13) + '@.str' + CONVERT (varchar(10), @.cnt) + '
    +'
    SET @.cnt = @.cnt + 1
    END
    SET @.sql1 = @.sql1 + ' ''' '
    SET @.sql1 = @.sql1 + CHAR(13) + 'DECLARE idoc_cur CURSOR FOR SELECT @.idoc'''
    +CHAR(13) + ')'
    --debug code
    /*
    PRINT @.sql
    PRINT '@.sql length=' +convert(varchar(5),datalength(@.sql))
    PRINT '----'
    PRINT @.sql1
    PRINT '@.sql1 length=' +convert(varchar(5),datalength(@.sql1))
    */
    EXEC (@.sql + @.sql1)
    OPEN idoc_cur
    FETCH NEXT FROM idoc_cur into @.idoc
    DEALLOCATE idoc_cur

    select * from OpenXML(@.idoc, '//transfer/body', 2) WITH (ng int, nk int, dw
    nvarchar(50))
    --When Complete
    --/*
    exec sp_xml_removedocument @.idoc
    --*/

    How to solve this problem??

    Best Regards
    AJA
    "AJA" <ajanospam74@.gazeta.plwrote in message
    news:eudi64$2c3$1@.inews.gazeta.pl...

    Quote:

    Originally Posted by

    Hello
    I have problem with reading from XML when XML is to large.
    Program delare 1-n variables where is declaration but can no make more
    delarations than length 8000 :((


    If this is SQL 2005, try varchar(max)

    Quote:

    Originally Posted by

    >
    drop table tblBooksEx
    CREATE TABLE [tblBooksEx] (
    [Row_ID] [int] IDENTITY (1, 1) NOT NULL ,
    [BooksData] [text] COLLATE Polish_CI_AS NULL ,
    CONSTRAINT [PK__tblBooksEx__17036CC0] PRIMARY KEY CLUSTERED
    (
    [Row_ID]
    ) ON [PRIMARY]
    ) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
    GO
    insert into tblBooksEx(booksdata) values('')
    exec master..xp_cmdshell 'TextCopy.exe /S serv /U usr /Ppsv /D Northwind
    /T
    tblBooksEx /C BooksData /F c:\SCN.xml /W "WHERE Row_ID=1" /I'
    >
    >
    /*PART 1*/
    DECLARE @.id int
    DECLARE @.idoc int
    SET @.id = 1 -- or whatever the id
    >
    DECLARE @.datalen int
    DECLARE @.sql varchar(8000)
    DECLARE @.sql1 varchar(8000)
    DECLARE @.cnt int
    -- get the length
    SELECT @.datalen = DATALENGTH (booksdata) / 4000 + 1 FROM tblBooksEx WHERE
    row_id = @.id
    >
    -- phase 1 collect into @.sql declarations of @.str1, @.str2,...@.strn
    SET @.cnt = 1
    SET @.sql='DECLARE '
    SET @.sql1 = ''
    WHILE (@.cnt <= @.datalen)
    BEGIN
    SELECT
    @.sql = @.sql + CASE @.cnt
    WHEN 1 THEN ''
    ELSE ', ' + CHAR(13)
    END
    + ' @.str'+CONVERT(varchar(10),@.cnt)+' VARCHAR(4000)'
    SET @.cnt = @.cnt + 1
    END
    -- phase 2 collect into @.sql selection of chunks (takng care of length)
    SET @.cnt = 1
    WHILE (@.cnt <= @.datalen)
    BEGIN
    IF LEN(@.sql) < 7850
    SELECT @.sql = @.sql + CHAR (13) +
    'SELECT @.str' + CONVERT(VARCHAR(10), @.cnt) + ' =
    REPLACE(SUBSTRING(booksdata, ' +
    CONVERT(VARCHAR(30), (@.cnt-1)*4000+1) + ', 4000),CHAR(39),
    CHAR(39)+CHAR(39) ) ' +
    'FROM tblBooksEx ' +
    'WHERE row_id = ''' + cast(@.id as varchar) + ''''
    ELSE
    SELECT @.sql1 = @.sql1 + CHAR (13) +
    'SELECT @.str' + CONVERT(VARCHAR(10), @.cnt) + ' =
    REPLACE(SUBSTRING(booksdata, ' +
    CONVERT(VARCHAR(30), (@.cnt-1)*4000+1) + ', 4000),CHAR(39),
    CHAR(39)+CHAR(39) ) ' +
    'FROM tblBooksEx ' +
    'WHERE row_id = ''' + cast(@.id as varchar) + ''''
    SET @.cnt = @.cnt + 1
    END
    >
    >
    /*PART 2*/
    -- phase 3 preparing the 2nd level dynamic sql
    SELECT @.sql1 = @.sql1 + CHAR(13) + 'EXEC ('+ CHAR(13) + '''DECLARE @.idoc
    int'+ CHAR(13) +
    'EXEC sp_xml_preparedocument @.idoc OUT, ''' + '
    SET @.cnt = 1
    WHILE (@.cnt <= @.datalen)
    BEGIN
    SELECT @.sql1 = @.sql1 + CHAR (13) + '@.str' + CONVERT (varchar(10), @.cnt) +
    '
    +'
    SET @.cnt = @.cnt + 1
    END
    SET @.sql1 = @.sql1 + ' ''' '
    SET @.sql1 = @.sql1 + CHAR(13) + 'DECLARE idoc_cur CURSOR FOR SELECT
    @.idoc'''
    +CHAR(13) + ')'
    --debug code
    /*
    PRINT @.sql
    PRINT '@.sql length=' +convert(varchar(5),datalength(@.sql))
    PRINT '----'
    PRINT @.sql1
    PRINT '@.sql1 length=' +convert(varchar(5),datalength(@.sql1))
    */
    EXEC (@.sql + @.sql1)
    OPEN idoc_cur
    FETCH NEXT FROM idoc_cur into @.idoc
    DEALLOCATE idoc_cur
    >
    >
    >
    >
    select * from OpenXML(@.idoc, '//transfer/body', 2) WITH (ng int, nk int,
    dw
    nvarchar(50))
    --When Complete
    --/*
    exec sp_xml_removedocument @.idoc
    --*/
    >
    How to solve this problem??
    >
    >
    Best Regards
    AJA
    >


    --
    Greg Moore
    SQL Server DBA Consulting Remote and Onsite available!
    Email: sql (at) greenms.com http://www.greenms.com/sqlserver.html|||>Hello

    Quote:

    Originally Posted by

    Quote:

    Originally Posted by

    >I have problem with reading from XML when XML is to large.
    >Program delare 1-n variables where is declaration but can no make more
    >delarations than length 8000 :((


    >
    If this is SQL 2005, try varchar(max)


    Sorry i forgot tell its MSSQL 2k :(( any other idea?

    AJA

    Quote:

    Originally Posted by

    >
    >

    Quote:

    Originally Posted by

    >>
    >drop table tblBooksEx
    >CREATE TABLE [tblBooksEx] (
    >[Row_ID] [int] IDENTITY (1, 1) NOT NULL ,
    >[BooksData] [text] COLLATE Polish_CI_AS NULL ,
    >CONSTRAINT [PK__tblBooksEx__17036CC0] PRIMARY KEY CLUSTERED
    >(
    > [Row_ID]
    >) ON [PRIMARY]
    >) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
    >GO
    >insert into tblBooksEx(booksdata) values('')
    >exec master..xp_cmdshell 'TextCopy.exe /S serv /U usr /Ppsv /D Northwind
    >/T
    >tblBooksEx /C BooksData /F c:\SCN.xml /W "WHERE Row_ID=1" /I'
    >>
    >>
    >/*PART 1*/
    >DECLARE @.id int
    >DECLARE @.idoc int
    >SET @.id = 1 -- or whatever the id
    >>
    >DECLARE @.datalen int
    >DECLARE @.sql varchar(8000)
    >DECLARE @.sql1 varchar(8000)
    >DECLARE @.cnt int
    >-- get the length
    >SELECT @.datalen = DATALENGTH (booksdata) / 4000 + 1 FROM tblBooksEx WHERE
    >row_id = @.id
    >>
    >-- phase 1 collect into @.sql declarations of @.str1, @.str2,...@.strn
    >SET @.cnt = 1
    >SET @.sql='DECLARE '
    >SET @.sql1 = ''
    >WHILE (@.cnt <= @.datalen)
    >BEGIN
    >SELECT
    >@.sql = @.sql + CASE @.cnt
    >WHEN 1 THEN ''
    >ELSE ', ' + CHAR(13)
    >END
    >+ ' @.str'+CONVERT(varchar(10),@.cnt)+' VARCHAR(4000)'
    >SET @.cnt = @.cnt + 1
    >END
    >-- phase 2 collect into @.sql selection of chunks (takng care of length)
    >SET @.cnt = 1
    >WHILE (@.cnt <= @.datalen)
    >BEGIN
    >IF LEN(@.sql) < 7850
    >SELECT @.sql = @.sql + CHAR (13) +
    >'SELECT @.str' + CONVERT(VARCHAR(10), @.cnt) + ' =
    >REPLACE(SUBSTRING(booksdata, ' +
    >CONVERT(VARCHAR(30), (@.cnt-1)*4000+1) + ', 4000),CHAR(39),
    >CHAR(39)+CHAR(39) ) ' +
    >'FROM tblBooksEx ' +
    >'WHERE row_id = ''' + cast(@.id as varchar) + ''''
    >ELSE
    >SELECT @.sql1 = @.sql1 + CHAR (13) +
    >'SELECT @.str' + CONVERT(VARCHAR(10), @.cnt) + ' =
    >REPLACE(SUBSTRING(booksdata, ' +
    >CONVERT(VARCHAR(30), (@.cnt-1)*4000+1) + ', 4000),CHAR(39),
    >CHAR(39)+CHAR(39) ) ' +
    >'FROM tblBooksEx ' +
    >'WHERE row_id = ''' + cast(@.id as varchar) + ''''
    >SET @.cnt = @.cnt + 1
    >END
    >>
    >>
    >/*PART 2*/
    >-- phase 3 preparing the 2nd level dynamic sql
    >SELECT @.sql1 = @.sql1 + CHAR(13) + 'EXEC ('+ CHAR(13) + '''DECLARE @.idoc
    >int'+ CHAR(13) +
    >'EXEC sp_xml_preparedocument @.idoc OUT, ''' + '
    >SET @.cnt = 1
    >WHILE (@.cnt <= @.datalen)
    >BEGIN
    >SELECT @.sql1 = @.sql1 + CHAR (13) + '@.str' + CONVERT (varchar(10), @.cnt) +
    >'
    >+'
    >SET @.cnt = @.cnt + 1
    >END
    >SET @.sql1 = @.sql1 + ' ''' '
    >SET @.sql1 = @.sql1 + CHAR(13) + 'DECLARE idoc_cur CURSOR FOR SELECT
    >@.idoc'''
    >+CHAR(13) + ')'
    >--debug code
    >/*
    >PRINT @.sql
    >PRINT '@.sql length=' +convert(varchar(5),datalength(@.sql))
    >PRINT '----'
    >PRINT @.sql1
    >PRINT '@.sql1 length=' +convert(varchar(5),datalength(@.sql1))
    >*/
    >EXEC (@.sql + @.sql1)
    >OPEN idoc_cur
    >FETCH NEXT FROM idoc_cur into @.idoc
    >DEALLOCATE idoc_cur
    >>
    >>
    >>
    >>
    >select * from OpenXML(@.idoc, '//transfer/body', 2) WITH (ng int, nk int,
    >dw
    >nvarchar(50))
    >--When Complete
    >--/*
    >exec sp_xml_removedocument @.idoc
    >--*/
    >>
    >How to solve this problem??
    >>
    >>
    >Best Regards
    >AJA
    >>


    >
    --
    Greg Moore
    SQL Server DBA Consulting Remote and Onsite available!
    Email: sql (at) greenms.com
    http://www.greenms.com/sqlserver.html
    >
    >

    |||On Mar 28, 4:05 pm, "AJA" <ajanospa...@.gazeta.plwrote:

    Quote:

    Originally Posted by

    Hello
    I have problem with reading from XML when XML is to large.
    Program delare 1-n variables where is declaration but can no make more
    delarations than length 8000 :((
    >
    drop table tblBooksEx
    CREATE TABLE [tblBooksEx] (
    [Row_ID] [int] IDENTITY (1, 1) NOT NULL ,
    [BooksData] [text] COLLATE Polish_CI_AS NULL ,
    CONSTRAINT [PK__tblBooksEx__17036CC0] PRIMARY KEY CLUSTERED
    (
    [Row_ID]
    ) ON [PRIMARY]
    ) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
    GO
    insert into tblBooksEx(booksdata) values('')
    exec master..xp_cmdshell 'TextCopy.exe /S serv /U usr /Ppsv /D Northwind /T
    tblBooksEx /C BooksData /F c:\SCN.xml /W "WHERE Row_ID=1" /I'
    >
    /*PART 1*/
    DECLARE @.id int
    DECLARE @.idoc int
    SET @.id = 1 -- or whatever the id
    >
    DECLARE @.datalen int
    DECLARE @.sql varchar(8000)
    DECLARE @.sql1 varchar(8000)
    DECLARE @.cnt int
    -- get the length
    SELECT @.datalen = DATALENGTH (booksdata) / 4000 + 1 FROM tblBooksEx WHERE
    row_id = @.id
    >
    -- phase 1 collect into @.sql declarations of @.str1, @.str2,...@.strn
    SET @.cnt = 1
    SET @.sql='DECLARE '
    SET @.sql1 = ''
    WHILE (@.cnt <= @.datalen)
    BEGIN
    SELECT
    @.sql = @.sql + CASE @.cnt
    WHEN 1 THEN ''
    ELSE ', ' + CHAR(13)
    END
    + ' @.str'+CONVERT(varchar(10),@.cnt)+' VARCHAR(4000)'
    SET @.cnt = @.cnt + 1
    END
    -- phase 2 collect into @.sql selection of chunks (takng care of length)
    SET @.cnt = 1
    WHILE (@.cnt <= @.datalen)
    BEGIN
    IF LEN(@.sql) < 7850
    SELECT @.sql = @.sql + CHAR (13) +
    'SELECT @.str' + CONVERT(VARCHAR(10), @.cnt) + ' =
    REPLACE(SUBSTRING(booksdata, ' +
    CONVERT(VARCHAR(30), (@.cnt-1)*4000+1) + ', 4000),CHAR(39),
    CHAR(39)+CHAR(39) ) ' +
    'FROM tblBooksEx ' +
    'WHERE row_id = ''' + cast(@.id as varchar) + ''''
    ELSE
    SELECT @.sql1 = @.sql1 + CHAR (13) +
    'SELECT @.str' + CONVERT(VARCHAR(10), @.cnt) + ' =
    REPLACE(SUBSTRING(booksdata, ' +
    CONVERT(VARCHAR(30), (@.cnt-1)*4000+1) + ', 4000),CHAR(39),
    CHAR(39)+CHAR(39) ) ' +
    'FROM tblBooksEx ' +
    'WHERE row_id = ''' + cast(@.id as varchar) + ''''
    SET @.cnt = @.cnt + 1
    END
    >
    /*PART 2*/
    -- phase 3 preparing the 2nd level dynamic sql
    SELECT @.sql1 = @.sql1 + CHAR(13) + 'EXEC ('+ CHAR(13) + '''DECLARE @.idoc
    int'+ CHAR(13) +
    'EXEC sp_xml_preparedocument @.idoc OUT, ''' + '
    SET @.cnt = 1
    WHILE (@.cnt <= @.datalen)
    BEGIN
    SELECT @.sql1 = @.sql1 + CHAR (13) + '@.str' + CONVERT (varchar(10), @.cnt) + '
    +'
    SET @.cnt = @.cnt + 1
    END
    SET @.sql1 = @.sql1 + ' ''' '
    SET @.sql1 = @.sql1 + CHAR(13) + 'DECLARE idoc_cur CURSOR FOR SELECT @.idoc'''
    +CHAR(13) + ')'
    --debug code
    /*
    PRINT @.sql
    PRINT '@.sql length=' +convert(varchar(5),datalength(@.sql))
    PRINT '----'
    PRINT @.sql1
    PRINT '@.sql1 length=' +convert(varchar(5),datalength(@.sql1))
    */
    EXEC (@.sql + @.sql1)
    OPEN idoc_cur
    FETCH NEXT FROM idoc_cur into @.idoc
    DEALLOCATE idoc_cur
    >
    select * from OpenXML(@.idoc, '//transfer/body', 2) WITH (ng int, nk int, dw
    nvarchar(50))
    --When Complete
    --/*
    exec sp_xml_removedocument @.idoc
    --*/
    >
    How to solve this problem??
    >
    Best Regards
    AJA


    If you make an SP(stored Procedure) out of the Code , you can send
    xml to SP as a text parameter|||

    Quote:

    Originally Posted by

    If you make an SP(stored Procedure) out of the Code , you can send
    xml to SP as a text parameter
    >


    Can you tell me clearly because i do not understand ..

    AJA|||On Mar 29, 4:05 pm, "AJA" <ajanospa...@.gazeta.plwrote:

    Quote:

    Originally Posted by

    Quote:

    Originally Posted by

    If you make an SP(stored Procedure) out of the Code , you can send
    xml to SP as a text parameter


    >
    Can you tell me clearly because i do not understand ..
    >
    AJA


    Need to do in an SP . You need to send text from client side. Sending
    text within sql server not possible for SQL 2000

    create proc usp_getxml
    @.xmltext TEXT
    as
    Declare @.hdoc INT
    --Create XML document.
    EXEC sp_xml_preparedocument @.hdoc OUTPUT, @.xmltext

    Data into XML

    Hi, I have a select statement which returns data in sql server 2000, however i need to convert this into an XML document. I have the option of doing it via VB6 however, i do not want to do this as there will be up to 50, 000 records conveting, there must be a simple way just to convert it on the server.

    Any ideas appretiatedJust bumping this back up the chain|||Not too sure if this is what you are looking for.

    Dim comp As New Data.DataSet

    After reading all the data required into your data adapter ect.

    Use the final coding to write to an xml file in the spcified location:

    comp.WriteXml("C:\xml\TestXml_Complete.xml")

    \TestXml_Complete.xml is the name of the xml you will be saving...

    Tuesday, February 14, 2012

    data format of XML data in datafile generated by bcp -n

    Hi,

    The XML column data stored in the data file generated by using bcp -n is in two different formats. one is storing the actual length of the data prefixed by an 8 byte length infront of the data; the other one whithout the prefixed length but "FEFFFFFFFFFFFFFFFC030000" infront of the data.

    Could any body please tell me what the binary means?

    Thanks,

    Lijie

    In native mode, the length prefix for xml data is of 8 bytes. There are 3 variations of this length:

    a) If it's 0xFFFFFFFFFFFFFFFF then the column value is NULL

    b) If it's 0xFFFFFFFFFFFFFFFE (FEFFFFFFFFFFFFFFF in little endian), that means the data is stored as chunks, so following this length indicator there will be chunks of xml column data with 4 bytes length prefix and then chunk data and so on, until a chunk is hit whose length is specified by 0x00000000 indicating end of column data.

    c) Length prefixed data, for any value other than (a) and (b) this indicates the actual length of data.

    Thanks

    Waseem Basheer

    SDE - Data Programmability Group

    Microsoft Corp.

    data format of XML data in datafile generated by bcp -n

    Hi,

    The XML column data stored in the data file generated by using bcp -n is in two different formats. one is storing the actual length of the data prefixed by an 8 byte length infront of the data; the other one whithout the prefixed length but "FEFFFFFFFFFFFFFFFC030000" infront of the data.

    Could any body please tell me what the binary means?

    Thanks,

    Lijie

    In native mode, the length prefix for xml data is of 8 bytes. There are 3 variations of this length:

    a) If it's 0xFFFFFFFFFFFFFFFF then the column value is NULL

    b) If it's 0xFFFFFFFFFFFFFFFE (FEFFFFFFFFFFFFFFF in little endian), that means the data is stored as chunks, so following this length indicator there will be chunks of xml column data with 4 bytes length prefix and then chunk data and so on, until a chunk is hit whose length is specified by 0x00000000 indicating end of column data.

    c) Length prefixed data, for any value other than (a) and (b) this indicates the actual length of data.

    Thanks

    Waseem Basheer

    SDE - Data Programmability Group

    Microsoft Corp.