如题,文本文件中有单独的 select 语句 ,也有create   proc 的存取过程

解决方案 »

  1.   

    @echo off
    OSQL -E -i CreateStoredProcedures.sql
    echo .
    echo Scripts Created 将文本做成.sql可以吗?
      

  2.   

    用c#读文件using System;using System.IO;using System.Collections;class Anagrams {public static void Main(String[] args){StreamReader din = File.OpenText ("words.txt");String str;StringTable st = new StringTable(); Console.WriteLine("Reading data and insterting into a StringTable.");while ((str=din.ReadLine()) != null) {st.Add(str);}Console.WriteLine("Printing out the StringTable.");foreach (string s in st){Console.WriteLine (s);}Console.WriteLine ("\r\nPress Return to exit.");Console.Read();}}将文本读出来再用SqlCommand执行就行了。
      

  3.   

    我用的c#.net, 用sql文件也可以,不过我看文本文件和sql文件只是后缀不同,其他的没有区别啊?
    to SassyBoy(dp->tdd->xp)
      如果只是一句sql SqlCommand 执行我会, 要是很多语句那?
      

  4.   

    一样滴,sql用";"分开就行了。
      

  5.   

    如果有 create   proc  ,create   table  就有错
      

  6.   

    如果使用标准sql做成的文本文件的话,可以使用程序调用bcp的方法执行的呵呵