• 0

[SQL] Script Table Contents


Question

Hi,

I need to script off the contents of two configuration tables i have created in sql 2008 for when i deploy a project to live.

There are only around 20 or so lines in each, so I could spend 30mins writing a population script, but wondered if anyone knew of any 3rd party tools that would generate it for me?

The reason being that I can foresee this table growing a fair bit and it will be come quite difficult to maintain.. and also i'm sure there are other situations where i will need to do this in future :D

cheers! :)

Link to comment
Share on other sites

5 answers to this question

Recommended Posts

  • 0

If there aren't a ton of columns it can be faster to just generate the SQL with a select like

select 'insert into TABLE_NAME (COL1_NAME, COL2_NAME ...) VALUES (' + COL1_NAME + ',' + COL2_NAME + ',' .... + ')'
from TABLE_NAME

Link to comment
Share on other sites

  • 0

yeah there are a load of columns :(

i might need to resort to writing it out by hand... that will be such a snooze fest *sigh*

Doesn't SQL Server have an import/export wizard for this sort of stuff?

Link to comment
Share on other sites

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.