locked
how to pass xml file name as parameter to stored procedure RRS feed

  • Question

  • User-1176759479 posted
    hi,

    i have created a stored procedure to read xml data


    CREATE PROCEDURE InsertXML(@xml varchar(1000))
    AS
    DECLARE @XmlHandle int
    EXEC sp_xml_preparedocument @XmlHandle output,@xml
    insert into Employee(Name,ID,Sal,Address)
    (SELECT Name,ID,Sal,Address
    FROM  OPENXML (@XmlHandle, 'emp:EmployeeDetails/emp:Employee',2)
                WITH (Name varchar(30) 'Name',
                          ID int 'ID',
                          Sal int 'sal',
            Address varchar(30) 'Address'))
    EXECUTE sp_xml_removedocument @XmlHandle


    but it is taking only xml text as input.
    but i want to send the file name as input.
    how to do it.
    Wednesday, November 30, 2005 6:36 AM

All replies