473,509 Members | 2,880 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

i have got an error when i execute an internal representation of the XML document.

2 New Member
Declare @xmlDoc nvarchar(100)
Declare @handle int
SET @xmlDoc = N'
<students>
<StudentID> 100-252-1658</StudentID>
<StudentFName>Suresh</StudentFName>
<StudentLName>Prabhu</StudentLName>
</students>'

EXEC sp_xml_preparedocument @handle OUTPUT, @xmlDoc

If i execute bold statement i am getting an error called
Msg 137, Level 15, State 2, Line 1
Must declare the scalar variable "@idoc".
Apr 4 '11 #1
2 1835
Sureshrajiv
2 New Member
jhkljhlgvkghccdfhdfbhdfhghfdfhdfgsdfgdfgdfgdfgdfgd fgdf
Apr 4 '11 #2
deepuv04
227 Recognized Expert New Member
try the following

Expand|Select|Wrap|Line Numbers
  1. create procedure xmlread
  2.  @xmlDoc text = ''
  3. as
  4. begin
  5.      --nvarchar(100)
  6.     Declare @handle int
  7.     SET @xmlDoc = N'
  8.     <students>
  9.     <StudentID> 100-252-1658</StudentID>
  10.     <StudentFName>Suresh</StudentFName>
  11.     <StudentLName>Prabhu</StudentLName>
  12.     </students>'
  13.  
  14.     EXEC sp_xml_preparedocument @handle OUTPUT, @xmlDoc
  15.  
  16.     SELECT  *
  17.     FROM    OpenXML(@handle,'students', 1)    
  18.             WITH (StudentID varchar(50) 'StudentID[1]',
  19.                   StudentFName varchar(50) 'StudentFName[1]',
  20.                   StudentLName varchar(100) 'StudentLName[1]') 
  21. end
  22.  
Apr 8 '11 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

1
5092
by: errorQuest | last post by:
Hi There, I have a problem with the IIS running. Whenever I try to ru http://localhost/aaa.asp i got this error "HTTP 500-Internal Serve Error". I use very simple code in aaa.asp. I try to look...
9
8970
by: Arun Goel | last post by:
Hi, I came across this question from a website.. According to the C++ standard, what is an object's internal representation in memory guaranteed to be? a) Initialized b) On a word boundary...
5
3472
by: Sathyaish | last post by:
When you say char in C, it internally means "an unsigned small integer with 1-byte memory", right? More importantly, the internal representation of char does not mean "int" as in...
1
9445
by: chanmm | last post by:
I hit the problem in my WinXP can someone help me: The Web server reported the following error when attempting to create or open the Web project located at the following URL:...
1
1882
by: D A H | last post by:
I have gotten the same exception in multiple projects. I have solved the underlying problem. My question is if anyone knew of a setting that would cause this exception to be thrown. A...
3
1264
by: Mantorok | last post by:
Hi I'm getting the following when clicking a link to a word doc: System.Web.HttpException: Path 'OPTIONS' is forbidden. at System.Web.HttpMethodNotAllowedHandler.ProcessRequest(HttpContext...
9
2081
by: archana | last post by:
Hi all, I have one question regarding hashing in .net I have two string containing same data. When i see hashcode by calling gethascode, i am getting same value. I want to know how...
15
3723
by: khan | last post by:
Hi, I read that pointer representation can non-zero bit pattern, machine specific.Compiler when comes accross value '0' in pointer context, converts it to machine specific null pointer...
0
2257
by: palabat | last post by:
Hello. I'm getting this error , "XML error parsing SOAP payload : Empty Document" when I try to execute a NuSOAP client in consuming a .NET web service. The response from the web service server...
1
9490
by: Anonymous | last post by:
My code has suddenly stopped compiling after some refactoring I carried out last week. I am using VC8 on W2K professional I get the following cryptic error: Error 77 fatal error C1001: An...
0
7137
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7347
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7416
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
7073
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
1
5062
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4732
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
1571
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
779
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
443
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.