Click here to Skip to main content
15,883,336 members
Home / Discussions / Database
   

Database

 
AnswerRe: LastModifiedDate Pin
nelsonpaixao4-Sep-08 14:16
nelsonpaixao4-Sep-08 14:16 
GeneralRe: LastModifiedDate Pin
geekfromindia5-Sep-08 4:15
geekfromindia5-Sep-08 4:15 
QuestionHelp me with the query strings. Pin
shashi_code4-Sep-08 4:29
shashi_code4-Sep-08 4:29 
AnswerRe: Help me with the query strings. [modified] Pin
Blue_Boy4-Sep-08 5:21
Blue_Boy4-Sep-08 5:21 
GeneralRe: Help me with the query strings. Pin
Meenal Ronghe12-Sep-10 23:34
Meenal Ronghe12-Sep-10 23:34 
GeneralRe: Help me with the query strings. Pin
nelsonpaixao4-Sep-08 13:57
nelsonpaixao4-Sep-08 13:57 
AnswerRe: Help me with the query strings. Pin
ahsan sarfraz8-Sep-08 4:45
ahsan sarfraz8-Sep-08 4:45 
QuestionInserting data from an XML string in a table Pin
ONeil Tomlinson4-Sep-08 1:37
ONeil Tomlinson4-Sep-08 1:37 
i wnat to inset the following data into a table. The data is an xml file as folows
-------------
<root>
<employee>
<id>20</id>
<fname>tom</fname>
<lname>smith</lname>
</employee>
</root>
---------------------

i have the follwoing stored procedure that takes the xml text as a parameter, insert the data and return the table data back to me - but im getting this error = "Incorrect syntax near the keyword 'FROM'" and "Incorrect syntax near the keyword 'with'. If this statement is a common table expression or an xmlnamespaces clause, the previous statement must be terminated with a semicolon."

Help Please

--------------------------------
set ANSI_NULLS ON
set QUOTED_IDENTIFIER ON
go

create PROC [dbo].[sp_add_employee1]
@empdata text
AS
DECLARE @hDoc int


exec sp_xml_preparedocument @hDoc OUTPUT,@empdata


INSERT into Employee (id, fname, lname)
SELECT FROM OPENXML (@hDoc, '/root/Employee')
WITH Employee (id varchar(50),fname varchar(50), lname varchar(50))


EXEC sp_xml_removedocument @hDoc


SELECT *
from Employee
FOR XML AUTO
-------------------------------------------
AnswerRe: Inserting data from an XML string in a table Pin
Wendelius4-Sep-08 8:29
mentorWendelius4-Sep-08 8:29 
QuestionBcp error Pin
si_694-Sep-08 0:29
si_694-Sep-08 0:29 
AnswerRe: Bcp error Pin
Wendelius4-Sep-08 8:26
mentorWendelius4-Sep-08 8:26 
QuestionReg: Handling Text Column in Trigger implementation Pin
Member 40084923-Sep-08 23:38
Member 40084923-Sep-08 23:38 
AnswerRe: Reg: Handling Text Column in Trigger implementation Pin
Wendelius4-Sep-08 8:17
mentorWendelius4-Sep-08 8:17 
QuestionUnion query.. I guess:) Pin
Muammar©3-Sep-08 9:19
Muammar©3-Sep-08 9:19 
AnswerRe: Union query.. I guess:) Pin
TheFM2343-Sep-08 9:32
TheFM2343-Sep-08 9:32 
GeneralRe: Union query.. I guess:) Pin
Muammar©3-Sep-08 9:51
Muammar©3-Sep-08 9:51 
GeneralRe: Union query.. I guess:) Pin
Muammar©3-Sep-08 10:33
Muammar©3-Sep-08 10:33 
AnswerRe: Union query.. I guess:) Pin
Wendelius3-Sep-08 9:35
mentorWendelius3-Sep-08 9:35 
GeneralRe: Union query.. I guess:) Pin
Muammar©3-Sep-08 9:56
Muammar©3-Sep-08 9:56 
GeneralRe: Union query.. I guess:) Pin
Wendelius3-Sep-08 10:01
mentorWendelius3-Sep-08 10:01 
QuestionProblems with connecting with ODBC source Pin
Deques3-Sep-08 8:00
Deques3-Sep-08 8:00 
AnswerRe: Problems with connecting with ODBC source Pin
Wendelius3-Sep-08 11:11
mentorWendelius3-Sep-08 11:11 
GeneralRe: Problems with connecting with ODBC source Pin
Deques3-Sep-08 20:56
Deques3-Sep-08 20:56 
GeneralRe: Problems with connecting with ODBC source Pin
Wendelius4-Sep-08 8:56
mentorWendelius4-Sep-08 8:56 
Question[Message Deleted] Pin
TheMandolinMan3-Sep-08 7:58
TheMandolinMan3-Sep-08 7:58 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.