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
 SQL Server 2005 Forums
 Other SQL Server Topics (2005)
 bulk load of xml file in sqlserver

Author  Topic 

parvathaneni.vk
Starting Member

3 Posts

Posted - 2008-06-18 : 03:01:46
i have the stored procedure...



ALTER procedure [dbo].[xmlpaths]

as
Declare @xml VARCHAR(MAX)
Declare @i as int
select @xml=BulkColumn from openrowset(bulk 'C:\Documents and Settings\Kasi\Desktop\note.xml', single_clob)as cse
EXEC sp_xml_preparedocument @i OUTPUT,@xml
Select * From OpenXML(@i,'/college/cse',2) With (name varchar(50), rollno int, year int)


i got the output...
but i want to give path as parameter during execution of procedure name. can anyone help me..

thanks in advance

spirit1
Cybernetic Yak Master

11752 Posts

Posted - 2008-06-18 : 05:07:28
you have to use dynamic sql then:
http://weblogs.sqlteam.com/mladenp/archive/2007/06/18/60235.aspx

_______________________________________________
Causing trouble since 1980
Blog: http://weblogs.sqlteam.com/mladenp
Speed up SSMS development: www.ssmstoolspack.com <- version 1.0 out!
Go to Top of Page
   

- Advertisement -