Home > Forum > Sql Server > SQL query for copy a table in same database.

SQL query for copy a table in same database.

by Thamil   on Sep 09, 2013   Category: Sql Server  |  Views: 1434    |  Points: 5   |  Gold 
  Reply
Hi Friends,

I need a sql query for copy a table(table structure and data).

Example: table name is <sample>, now copy the <sample> table into <sample_07092013>
(new table name is current table name added with current date).

Question posted on behalf of Mohanakrishnan

Bookmark and Share:
 
  User Reply  | Ask a question  |   Reply 
  Re :SQL query for copy a table in same database.   
by Thamil
on Sep 9 2013 3:50AM
Points : 10
Gold 
Hello Mohanakrishnan,

use the below query to copy the structure & data into new table

SELECT * INTO sample_07092013 FROM sample;

Recent Post

Latest Posts

1 3D model and 2D View New! Forum