How to generate sql server script from c#.net?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • nirmalsingh
    New Member
    • Sep 2006
    • 218

    How to generate sql server script from c#.net?

    hai all,
    for example i am having a table: customer(sql server 2005), i want to generate a script for that table (insert) in which customer id > 10, and then i want to delete that table, and then again i want to restore it by running the insert script. how should i do this in c#.net? its very urgent.
    Thanx in advance
    Regards
    Nirmal.
  • nmsreddi
    Contributor
    • Jul 2006
    • 366

    #2
    Hello

    In c# you have separate concept for SQLServer management called SMO ,have a look at it, using SMO objects you can do almost all possibilities using C#.

    other wise simply you can generate script using SQLServer any you can run it at runtime in c# which also useful to solve your problem

    Regards
    nmsreddi

    Comment

    • nirmalsingh
      New Member
      • Sep 2006
      • 218

      #3
      Originally posted by nmsreddi
      Hello

      In c# you have separate concept for SQLServer management called SMO ,have a look at it, using SMO objects you can do almost all possibilities using C#.

      other wise simply you can generate script using SQLServer any you can run it at runtime in c# which also useful to solve your problem

      Regards
      nmsreddi
      Thanx a lot. it works fine.

      Comment

      Working...