Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 XML file name

Author  Topic 

moodi_z
Starting Member

38 Posts

Posted - 2009-08-23 : 10:09:29
Hi,
How can I get the name of xml file that a stored procedure gets?!

Thanks.

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2009-08-23 : 15:04:04
What do you mean?



N 56°04'39.26"
E 12°55'05.63"
Go to Top of Page

moodi_z
Starting Member

38 Posts

Posted - 2009-08-24 : 01:16:18
I dont want to add a new parameter to the stored procedure that get the name of the xml file to store it in a varchar field, because other customers use it.
so, if I send xml file content to the stored procedure:


XmlTextReader reader = new XmlTextReader (fi.FullName );
reader.WhitespaceHandling = WhitespaceHandling.None;
XmlDocument xmlDoc = new XmlDocument();
xmlDoc.Load(reader);
reader.Close();
SqlParameter param = new SqlParameter("@XML", SqlDbType.Xml);
param.Value = new SqlXml(new XmlTextReader(xmlDoc.InnerXml.ToString ().Trim() , XmlNodeType.Document, null));


but i stell need the name of the xml file to store it in informative field in my DB.. so how can I extract it from the parameter inside the stored procedure?!

hope that I was clear.

quote:
Originally posted by Peso

What do you mean?



N 56°04'39.26"
E 12°55'05.63"


Go to Top of Page

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2009-08-24 : 02:43:13
1) Pass fi.FullName as a parameter to the procedure
2) Have the fi.FullName be an atribute, or element, in the XMl file



N 56°04'39.26"
E 12°55'05.63"
Go to Top of Page
   

- Advertisement -