Insert Dataset into SQL Server Table

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • David

    #1

    Insert Dataset into SQL Server Table

    All

    I have a dataset that I have returned from a SQL Server instance and I want
    to insert the records from the datatable in the dataset to a table in another
    SQL Server instance.

    Is there a way to insert the datatable without interating through each row.
    What I am looking for is insert into sqlservertable datatable?

    Thanks
  • Ken Tucker [MVP]

    #2
    Re: Insert Dataset into SQL Server Table

    Hi,



    Ken
    ---------------------
    "David" <David@discussi ons.microsoft.c om> wrote in message
    news:6A566E43-2FDC-4621-A092-5F1F9C3EBC22@mi crosoft.com...[color=blue]
    > All
    >
    > I have a dataset that I have returned from a SQL Server instance and I
    > want
    > to insert the records from the datatable in the dataset to a table in
    > another
    > SQL Server instance.
    >
    > Is there a way to insert the datatable without interating through each
    > row.
    > What I am looking for is insert into sqlservertable datatable?
    >
    > Thanks[/color]


    Comment

    • Cor Ligthert [MVP]

      #3
      Re: Insert Dataset into SQL Server Table

      David,

      First of all iterating takes almost no time, so I don't see what is the
      problem with that, be sure that it is done often behind the scene when here
      is a method.

      However, maybe can you rephrase the answer, because I think that the answer
      from Ken is not the answer on your question.

      But what is the question, because I can give as well probably 2 different
      answers which probably are not the answers on your question.

      By instance do you just want to copy a table from SQLServer 1 to SQLServer2?

      Do you want to add a table to your existing dataset based on an old one?

      Or do you what Ken's shows want to merge a datatable from server 1 in a
      datatable you got frorm server 2?

      So please rephrase

      Cpr


      Comment

      Working...