Wednesday 15 April 2015

sql server 2008 - Create XML from input parameter in stored procedure -


I want to write processed stored in sqlserver2008, this proc is a table (user, roles, group, ...), 1 Log in to other user table, I call it and write my proc whit XML input parameter and call adduser proc in it, how to get xml parameter and use it in my proc? Thanks

optional functions [dbo]. [Usp_SaveInvoice] - Add to the stored procedure parameters @ Aksmeldi XML, or Aksmelditi announced start as XML @ record INT DECLARE @DTOUT INT @ Makskod Hourly construction table # Mssaj (mid Smalling, Mmsssgei Vecrar (200))

  EXEC SP_XML_PREPAREDOCUMENT @HDOUT oUTPUT, @XMLHD EXEC SP_XML_PREPAREDOCUMENT @DTOUT output @ XMLDT SELECT * in Opanaksmel (@ Acdiuuti, "Head", 1) with (Invoisino VARCHAR (500), Grahkkod INT, date date of); SELECT / OPENXML (# DTOUT, 'SAVE / INVOIEC', 1) of #dt (a INT, ItemCode INT, volume Decimal (18,2), rate decimal (18,2), amount decimal (18,2)) ; If present (the Siaf Aedbluoanoodio from Diboktron Inwvoisan these (Invoisino for # HD)) INSTERISE #MESSAGE SELECT 1, select the INNOVOICE NO ALREADYEXIST '* and # Mmsaji message to the XML auto elements selected Akssaianaiel returns and @ Makskod Do = Isnull (max (invhdcode), 0) start to try to insert transactions +1 dbo.trnInvoiceHD (invhdcode, invInvoiceNO, invDate, invCusCode) from dbo.trnInvoiceHD @maxcode, invoiceno, invDate, #hd in dmbo Select the customer code from Select TrnInvoiceDt (invDtTrncode, invdtSlNo, invdtitemcode, invDtRate, invDtQty, invDtAmount) @max code, no, item code, rate, quantity, amount #dt INSERT # MSGG selection 1, select 'Incorporated successfully' * XML From #Message Message For Remittance, Begin Elementals XINIL Transaction End Attention #MESSAGE SELECT 1, ERROR_MESSAGE () in Catch Rollback Transactions * For XML Auto #MESSAGE Message, Element XSINIL End Catch  

No comments:

Post a Comment