Results 1 to 13 of 13
  1. #1
    Join Date
    Mar 2004
    Posts
    74

    Unanswered: How to export data with encolsed Insert clauses

    Good day All,

    Would like to check with expert here, is there a way when we extract out the data in table and it provide us enclose insert clauses

    for instance,

    i have table call student and it contains record of the student's name, address, when i export, how can i get following :-
    Code:
    Insert into student (name, address) values ('John','Address1')
    thank you for guidance !

  2. #2
    Join Date
    Feb 2004
    Location
    One Flump in One Place
    Posts
    14,912
    You mean you want to generate insert data based on the content of the table?

    I've been doing something like that today using SSMS Toolpack - google it - I recommend it.
    Testimonial:
    pootle flump
    ur codings are working excelent.

  3. #3
    Join Date
    Jun 2003
    Location
    Ohio
    Posts
    12,592
    Provided Answers: 1
    Not built in, no.
    You have to write this code yourself.
    Plus, this is a very bad way to transfer data. I'm currently suffering with a MySQL database where the data was "backed up" as a file of insert statements...26 GB for a single table. Took a whole week of churning to reload it.
    If it's not practically useful, then it's practically useless.

    blindman
    www.chess.com: "sqlblindman"
    www.LobsterShot.blogspot.com

  4. #4
    Join Date
    Feb 2004
    Location
    One Flump in One Place
    Posts
    14,912
    Quote Originally Posted by blindman
    Plus, this is a very bad way to transfer data.
    Depends.
    Quote Originally Posted by blindman
    I'm currently suffering with a MySQL database where the data was "backed up" as a file of insert statements
    Yeah - that is a poor application.

    It is handy for generating rollout scripts of pre-populated lookup tabl.....I mean referenced tables.
    Testimonial:
    pootle flump
    ur codings are working excelent.

  5. #5
    Join Date
    Nov 2004
    Posts
    1,427
    Provided Answers: 4
    That would need a script like
    Code:
    SELECT 'Insert into student (name, address) values ('' + 
            name + '', '' + address + '')'
    FROM student;
    With kind regards . . . . . SQL Server 2000/2005/2012
    Wim

    Grabel's Law: 2 is not equal to 3 -- not even for very large values of 2.
    Pat Phelan's Law: 2 very definitely CAN equal 3 -- in at least two programming languages

  6. #6
    Join Date
    May 2004
    Location
    Seattle
    Posts
    1,313

  7. #7
    Join Date
    Feb 2004
    Location
    One Flump in One Place
    Posts
    14,912
    Quote Originally Posted by jezemine
    this is a solved problem.
    That isn't the point. It is an opportunity for regulars to bicker about how flawed the idea is (or not).
    Testimonial:
    pootle flump
    ur codings are working excelent.

  8. #8
    Join Date
    May 2004
    Location
    Seattle
    Posts
    1,313
    ok, i'll bite.

    the idea is flawed. use bcp.

  9. #9
    Join Date
    Mar 2004
    Posts
    74
    Hey Guys, thanks for warm input .....i do install SSMS Toolpack and it is amazing ..Wim 's idea is good for my case actually, but SSMS really a good tool to use

    Thanks again all for the guidance

  10. #10
    Join Date
    Jun 2003
    Location
    Ohio
    Posts
    12,592
    Provided Answers: 1
    Quote Originally Posted by pootle flump
    It is handy for generating rollout scripts of pre-populated lookup tabl.....I mean referenced tables.
    Nice catch, pootle. Glad somebody is paying attention to me!
    If it's not practically useful, then it's practically useless.

    blindman
    www.chess.com: "sqlblindman"
    www.LobsterShot.blogspot.com

  11. #11
    Join Date
    Feb 2004
    Location
    One Flump in One Place
    Posts
    14,912
    Quote Originally Posted by blindman
    Glad somebody is paying attention to me!
    Did anyone hear anything? I'm sure I heard some high pitched whining - did anyone else?
    Testimonial:
    pootle flump
    ur codings are working excelent.

  12. #12
    Join Date
    Jun 2003
    Location
    Ohio
    Posts
    12,592
    Provided Answers: 1
    That high-pitched whining noise is just the targeting computer indicating that it has acquired a positive lock.
    Just ignore it....
    If it's not practically useful, then it's practically useless.

    blindman
    www.chess.com: "sqlblindman"
    www.LobsterShot.blogspot.com

  13. #13
    Join Date
    Jun 2004
    Location
    Long Island
    Posts
    696
    Quote Originally Posted by blindman
    Not built in, no.
    You have to write this code yourself.
    Plus, this is a very bad way to transfer data. I'm currently suffering with a MySQL database where the data was "backed up" as a file of insert statements...26 GB for a single table. Took a whole week of churning to reload it.
    DBArtisan does the same thing.

Posting Permissions

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