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

Wednesday, March 7, 2012

Error ["Unspecified Error"] while inserting data from XML to database using a Stored P

I am gettng the following error message when I try inserting data from a XML to the database (using a Stored Proc). The value of an attribute in the XML tag is very long, and when I try splitting that into multiple strings and insert each one separately to the database, to analyze the issue, I find that all the strings are getting inserted individually without any problem. But when I insert the concatenated form of the string as a whole then it gives me this problem.

Msg 6602, Level 16, State 2, Procedure sp_xml_preparedocument, Line 1

The error description is 'Unspecified error'.

Msg 8179, Level 16, State 5, Procedure InsertWinAPIInfo, Line 61

Could not find prepared statement with handle 0.

The statement has been terminated.

Msg 6607, Level 16, State 3, Procedure sp_xml_removedocument, Line 1

sp_xml_removedocument: The value supplied for parameter number 1 is invalid.

I have tried searching on the net and did not find any possible solution for this. Please help me.You are probably hitting some limit on attribute length of the tag, and this is causing sp_xml_preparedocument to fail.|||You are probably hitting some limit on attribute length of the tag, and this is causing sp_xml_preparedocument to fail. I could not find any documentation as to the maximum length allowed for an attribute but internally I think sp_xml_preparedocument uses msxml parser so you can review docs for msxml parser to see what the limits are.

Sunday, February 26, 2012

ERROR : Host-file columns may be skipped only when copying into the Server

Hi All,

I need to make a query from the SQL Server 2K and save this data as an XML file. What i am trying to do is to execute a bcp utility as follows:

EXEC master..xp_cmdshell 'bcp "SELECT CustID,CustName,CustSurname,CustEmail FROM myOwenDB..T_Customers FOR XML RAW" queryout "c:\customers.xml" -fc:\bcp.fmt -Sservername -Usa -Ppwd -C RAW -r -t'

with bcp.fmt file formatted as

8.0
4
1 SQLCHAR 0 9 "\t" 1 CustID Turkish_CI_AS
2 SQLCHAR 0 100 "\t" 2 CustName Turkish_CI_AS
3 SQLCHAR 0 100 "\t" 3 CustSurname Turkish_CI_AS
4 SQLCHAR 0 100 "\t" 4 CustEmail Turkish_CI_AS

The error is as follows:

Error = [Microsoft][ODBC SQL Server Driver]Host-file columns may be skipped only when copying into the Server

Does anyone have an idea about the problem? Also other techniques to generate XML file are also welcomed:)

Thanks in advance,

Bahtiyar KARANLIKYour select statment only returns one column and you are using a format file that says bcp will be receiving four columns from the select statment.|||Hi,
How can my SQL statement can return only one column? When i execute the statement via Query Analyzer it displays the correct information?

Am i missing a point??

Bahtiyar KARANLIK|||If you execute
SELECT CustID,CustName,CustSurname,CustEmail FROM myOwenDB..T_Customers
In QA you will get four columns, CustID, CustName,CustSurname and CustEmail.

If you execute
SELECT CustID,CustName,CustSurname,CustEmail FROM myOwenDB..T_Customers FOR XML RAW
In QA you will have a resultset with one column. Within the one column you will have an XML string that contains the four above mentioned columns, but they will be contained in one column!

If you execute
select au_id,au_lname,phone,contract from pubs.dbo.authors

you should get something like:

au_id au_lname phone contract
---- ------------ ---- ---
172-32-1176 White 408 496-7223 1

If you execute
select au_id,au_lname,phone,contract from pubsdbo.authors for xml raw

you should get something like:

XML_F52E2B61-18A1-11d1-B105-00805F49916B
------------------------
<row au_id="172-32-1176" au_lname="White" phone="408 496-7223" contract="1"/>

The first has four colums in the result set the second has only one.

Friday, February 24, 2012

Error "Line too long" - Report too large?

I'm working with a report which is being generated dynamically through
an XML and XSLT transform which generates the .rdl file which is then
pasted in to the code view of a report file in Visual Studio. This
process has worked so far for various reports until we came to this
latest report.
This report is a bit larger in scale, all together the final file size
of the .rdl file is just about 2MB. Of course it's a bit slow to work
with in Visual Studio, but the goal again was to generate the .rdl
dynamically so that editing the file(s) in Visual Studio would not be
necessary.
The report loads fine into Visual Studio and the layout view of the
report looks fine as well, but when we attempt to preview the report,
we get a build error which states:
[rsUnexpectedCompilerError] An unexpected error occurred while
compiling expressions. Native compiler return value: '[BC30494] Line
is too long.'.
I've attempted to locate information on the error message or the error
code itself but can't find any references anywhere. The error is
occurring on compilation of the report - because the same error occurs
when we select 'Build' from the context menu of the report.
So since it's a compilation error and the message seems to indicate
that the error occured while compiling expressions (and expressions use
VB.NET syntax) my assumption is that the source of the report is
somehow being passed in as a parameter to a version of the VB.NET
compiler and then spit back out for further processing.
If you follow that logic, my first thought was that perhaps one of the
expressions was literally too long and perhaps needed to be broken up
into smaller lines. But this was not the case. As the longest 'line' in
the report is 384 characters. Not long enough to cause any problems.
And we have other reports with lines just as long which do compile.
My next thought was that the entire source of the .rdl file was being
passed in to the compiler as a single string for parsing and execution
(e.g. turning the expressions into actual values or something similar).
If this is the case, then perhaps it's the actual size (in characters
or bytes) of the .rdl file that was the problem.
That's currently where I am now. I've narrowed it down to a theoretical
file size limit.
While trimming the report down piece by piece, I've discovered that the
same report works when it is in the area of 1.63 MB in size. However,
as soon as the report reaches 1.79 MB in size, this error returns and
the report fails to build.
I've seen other posts and documentation regarding the theoretical or
imposed limits of IIS and other platforms for uploading reports to
report server, but we are still below the 4MB limit.
I've also seen other posts by users who have asked about reports in the
range of <1MB, but ours is clearly outside that range.
So, does anyone have any information related to this error message, any
limits on .rdl file size, or suggestions for getting this to work?In case anyone is interested about this later on, I haven't found a
solution to the problem yet, but have found a workaround.
I was able to break the report up into smaller, more manageable chunks
(each one around 1MB in size) and create a master report and include
each chunk in a subreport.
So that's how I'm dealing with the problem for now, but I'm still
wondering if the errors I've encountered are really related to the size
of the report or something else.|||will.s.smith@.gmail.com wrote:
> In case anyone is interested about this later on, I haven't found a
> solution to the problem yet, but have found a workaround.
> I was able to break the report up into smaller, more manageable chunks
> (each one around 1MB in size) and create a master report and include
> each chunk in a subreport.
> So that's how I'm dealing with the problem for now, but I'm still
> wondering if the errors I've encountered are really related to the size
> of the report or something else.
Hi,
Iam have a RDL file where the file size is over 4MB
I have been workiing with it and deploying various versions of this
file size for the past couple of weeks ,without any errors and now
unexpectedly when iam to go live tomm Iam getting this error ,
I really don;t have any clue on how to handle this
Any help would really be appreciated
this is the compiler error iam having
[rsUnexpectedCompilerError] An unexpected error occurred while
compiling expressions. Native compiler return value: '[BC30494] Line
is too long.'.
Basically iam having 24 table data regions each pulling data from the
same dataset with different filtering options
only when i add the last 4 table regions iam gettign this error
Keep in mind that i was not getting this error last week with the same
24 data regions

Error ! SQL XML Bulkload Please help

Hi guys
I am running COM component from SQL server jobs.
The COM component uses SQLXML bulk object to copy the data to SQL server.
I do get following error. The error comes some times only some. It is not consistant
can anyone tell me why it is happening some times only and how to resolve it
thanks in advance
error :-
Executed as user: myserver\Administrator. Error Code: 0 Error Source= Microsoft XML Bulkload for SQL Server Error Description: The error log file could not be created. Make sure you have the appropriate permissions and that the ErrorLogFilePath is valid
. Error on Line 1. The step failed.
Did you check the obvious permission and size issues for the log file
location?
Thanks
Michael
"Nitin" <Nitin@.discussions.microsoft.com> wrote in message
news:D780E0E2-3FA2-4F6B-BFFD-987E528682C8@.microsoft.com...
> Hi guys
> I am running COM component from SQL server jobs.
> The COM component uses SQLXML bulk object to copy the data to SQL server.
> I do get following error. The error comes some times only some. It is not
> consistant
> can anyone tell me why it is happening some times only and how to resolve
> it
> thanks in advance
> error :-
> Executed as user: myserver\Administrator. Error Code: 0 Error Source=
> Microsoft XML Bulkload for SQL Server Error Description: The error log
> file could not be created. Make sure you have the appropriate permissions
> and that the ErrorLogFilePath is valid. Error on Line 1. The step
> failed.
|||Yes
I did check the permission and size thats not the problem
funny thing is that if i run the job explicitly it does runs properly but if i schedule it to run automatically it gives me this error
thanks
Nitin
"Michael Rys [MSFT]" wrote:

> Did you check the obvious permission and size issues for the log file
> location?
> Thanks
> Michael
> "Nitin" <Nitin@.discussions.microsoft.com> wrote in message
> news:D780E0E2-3FA2-4F6B-BFFD-987E528682C8@.microsoft.com...
>
>
|||This sounds like you run the scheduled job with less permissions than when
you do. Is the scheduled job running as a different user?
Michael
"Nitin" <Nitin@.discussions.microsoft.com> wrote in message
news:C6033E80-4C72-44D5-B59C-3B750EE27C23@.microsoft.com...[vbcol=seagreen]
> Yes
> I did check the permission and size thats not the problem
> funny thing is that if i run the job explicitly it does runs properly but
> if i schedule it to run automatically it gives me this error
> thanks
> Nitin
> "Michael Rys [MSFT]" wrote:
|||Hi Michael
The schedule job gets run by SQL server Agent and the SQL server agent is running under administrator user. The SQL server job is calling is COM+ (in which i am using SQLXML bulkupload) and it runs under seperate user which has also got the administrator
permission. I dont know this happens some times only.
thanks for your kind support
Nitin
"Michael Rys [MSFT]" wrote:

> This sounds like you run the scheduled job with less permissions than when
> you do. Is the scheduled job running as a different user?
> Michael
> "Nitin" <Nitin@.discussions.microsoft.com> wrote in message
> news:C6033E80-4C72-44D5-B59C-3B750EE27C23@.microsoft.com...
>
>
|||Hi Michael
The schedule job gets run by SQL server Agent and the SQL server agent is running under administrator user. The SQL server job is calling is COM+ (in which i am using SQLXML bulkupload) and it runs under seperate user which has also got the administrator
permission. I dont know this happens some times only.
thanks for your kind support
Nitin
"Michael Rys [MSFT]" wrote:

> This sounds like you run the scheduled job with less permissions than when
> you do. Is the scheduled job running as a different user?
> Michael
> "Nitin" <Nitin@.discussions.microsoft.com> wrote in message
> news:C6033E80-4C72-44D5-B59C-3B750EE27C23@.microsoft.com...
>
>
|||Hi Michael
The schedule job gets run by SQL server Agent and the SQL server agent is running under administrator user. The SQL server job is calling is COM+ (in which i am using SQLXML bulkupload) and it runs under seperate user which has also got the administrator
permission. I dont know this happens some times only.
thanks for your kind support
Nitin
"Michael Rys [MSFT]" wrote:

> This sounds like you run the scheduled job with less permissions than when
> you do. Is the scheduled job running as a different user?
> Michael
> "Nitin" <Nitin@.discussions.microsoft.com> wrote in message
> news:C6033E80-4C72-44D5-B59C-3B750EE27C23@.microsoft.com...
>
>
|||Hi Michael
The schedule job gets run by SQL server Agent and the SQL server agent is running under administrator user. The SQL server job is calling is COM+ (in which i am using SQLXML bulkupload) and it runs under seperate user which has also got the administrator
permission. I dont know this happens some times only.
thanks for your kind support
Nitin
"Michael Rys [MSFT]" wrote:

> This sounds like you run the scheduled job with less permissions than when
> you do. Is the scheduled job running as a different user?
> Michael
> "Nitin" <Nitin@.discussions.microsoft.com> wrote in message
> news:C6033E80-4C72-44D5-B59C-3B750EE27C23@.microsoft.com...
>
>
|||Are you possibly running two jobs at once and one can not access the file
because the other still has it open?
Irwin
Irwin Dolobowsky
Program Manager - SqlXml
http://blogs.msdn.com/irwando
This posting is provided "AS IS" with no warranties, and confers no rights.
"Nitin" <Nitin@.discussions.microsoft.com> wrote in message
news:75EB6BBE-9E47-4279-9D89-D2D5BC418B59@.microsoft.com...[vbcol=seagreen]
> Hi Michael
> The schedule job gets run by SQL server Agent and the SQL server agent is
> running under administrator user. The SQL server job is calling is COM+
> (in which i am using SQLXML bulkupload) and it runs under seperate user
> which has also got the administrator permission. I dont know this happens
> some times only.
> thanks for your kind support
> Nitin
>
> "Michael Rys [MSFT]" wrote:
|||Irwin
Possibly this could be the cause , I will keep different file name and try to run the jobs so that it wont use same file name
will let you know whats the outcome
thanks for your help
Nitin
"Irwin Dolobowsky [MS]" wrote:

> Are you possibly running two jobs at once and one can not access the file
> because the other still has it open?
> Irwin
> --
> Irwin Dolobowsky
> Program Manager - SqlXml
> http://blogs.msdn.com/irwando
> This posting is provided "AS IS" with no warranties, and confers no rights.
> "Nitin" <Nitin@.discussions.microsoft.com> wrote in message
> news:75EB6BBE-9E47-4279-9D89-D2D5BC418B59@.microsoft.com...
>
>