Results 1 to 3 of 3
  1. #1
    Join Date
    Jan 2002
    Location
    UK
    Posts
    7

    Unanswered: Export data into a script as "insert into"'s

    Hello,

    I am using a Web based front end to a SQL Server db installed at my host that only lets me import data into tables either manually (in a 'datasheet' view) or with a SQL query.

    Does anybody know if I can export data from my local db as a script such as

    insert into TestTable(Id, Name) values ("1", "Test1")
    insert into TestTable(Id, Name) values ("2", "Test2")
    .
    .
    .

    ... so that I can run this script on the Web front end and insert data into the db at my host?

    Many thanks in advance.

  2. #2
    Join Date
    Apr 2003
    Location
    Phoenix, AZ
    Posts
    177
    Here's a link to some stored procedures you might find useful. I think the DataAs InsCommand may be what you are looking for.

    http://www.mssqlcity.com/Scripts/scrImpExp.htm
    Fred Prose

  3. #3
    Join Date
    Jan 2002
    Location
    UK
    Posts
    7
    Thanks for your help Fred.

    That stored procedure mostly does the job but looks like it needs a few slight mods because some data types aren't implemented (such as text which is written out as 'None Yet')...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •