I have a problem :
I Build a procedure :CREATE PROCEDURE sp_Add_Table@InvData ntext, @TableName varchar(30)AS DECLARE @queryStr varchar(1000)--BEGIN TRAN CAPNHAT--SAVE TRAN FIRSTset @queryStr='Declare @hdoc intExec sp_xml_preparedocument @hDoc OUTPUT,''' + convert(nvarchar(1000),@InvData) +''' Insert into ' +@TableName +' Select * from OPENXML(@hdoc,''ROOT/Item1'') with ' + @TableName +' EXEC sp_xml_removedocument @hDoc'Exec (@queryStr)
IF @@ERROR<>0 BEGIN ROLLBACK TRAN FIRST RETURN -100 ENDCOMMIT TRANSACTION
GO
Then I Using this procedure by code:
string mSQMXML ="<ROOT><Item1 Ma='0' ten ='gdsfgsdf' SDT='45456'></Item1></ROOT>";
string mTableName ="User";
SqlCommand
mycom.CommandType =
mycom.Parameters.Add(
mycom.Parameters(
{
mycom.ExecuteScalar();
}
help me! Thanks