0

Possible Duplicate:
SQL Server 2005 - Export table programatically (run a .sql file to rebuild it)
Generate INSERT statements from a SQL Server Table

I have a table in SQL Server 2005 and want to get a printout out of inserts so I can copy and paste them into my production server (I cannot directly link to production server).

I just want a print out of X number of records from a very large table.

select * from data where tableID > 10100;

The above is the condition I want to use to figure out which records to generate the inserts for.

Community
  • 1
  • 1
cdub
  • 24,555
  • 57
  • 174
  • 303
  • Try to gernarate SQL script with data and run it on server. Steps: http://blog.sqlauthority.com/2007/08/21/sql-server-2005-create-script-to-copy-database-schema-and-all-the-objects-stored-procedure-functions-triggers-tables-views-constraints-and-all-other-database-objects/ – Nalaka526 Nov 22 '12 at 03:06

1 Answers1

0

Try one of the many third-party tools around that do this:

  1. SQL Server 2008 R2 - generating INSERT statements for a table (I believe this also works / is also available for the 2005 version)

  2. See this other SO question on the same topic (and the answers!)

  3. SQL Server 2005 Script to Generate INSERT statements

  4. Generate Insert Statements For a SQL Server Table

or just plain Google (or Bing) for it! There's tons of material out there....

Community
  • 1
  • 1
marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459