帮帮忙,求助写一sql server存储过程, 读某一文件下所有 .sql文件的 内容并执行
求助写一sql   server存储过程,   读某一文件下所有   .sql文件的   内容并执行   
 自己找半天了。。没有头绪哦。。。
------解决方案--------------------這個似乎還要搜索這個文件夾下面的所有.sql文檔先...
------解决方案--------------------才40分 懒的写
------解决方案--------------------要遍历文件夹,然后执行?很多个.sql文件?这应该在程序中执行才对. 
 --------------------------------------------- 
 乳沟看样子常在这儿混啊...天天写程序,SQL都很少再搞了,退步罗.. 
------解决方案--------------------[VB] 执行SQL脚本文件(.sql)的两种方法  
 1. 
 Public Sub ExecuteSQLScriptFile(cn as ADODB.Connection,sqlFile As String) 
 Dim strSql As String, strTmp As String           
       Open sqlFile For Input As #1 
       strSql =  " " 
       Do While Not EOF(1) 
           Line Input #1, strTmp 
           If UCase$(strTmp) =  "GO " Then 
               cn.Execute strSql 
               strSql =  " " 
           Else 
               strSql = strSql & strTmp & vbCrLf 
           End If 
       Loop 
       If strSql  <>   " " Then cn.Execute strSql 
       Close #1 
 End Sub   
 2. 
 Public Sub ExecuteSQLScriptFile(cn as ADODB.Connection,sqlFile As String) 
 Dim sql as string  
        sql= "master.dbo.xp_cmdshell  ' osql -U username -P password -i  " & sqlFile 
        cn.execute sql 
 End Sub 
------解决方案--------------------o