September 6, 2001 at 1:27 am
I have one table in my database Employee
There are three columns in employee table and in table i have 10 records.Now I want to create new table having the columns which are in Employee Table But i don't want when i create table using the employee table the records resides in employee table should not be transferred to new tables using The SQL Query i.e Create Table Or Some other.
September 6, 2001 at 2:27 am
SELECT * INTO newtable
FROM employee
WHERE 1 = 0
Chris Hedgate @ Apptus Technologies (http://www.apptus.se)
September 6, 2001 at 2:30 am
If I understand what you want correctly, you want to create a table with the same structure as your employee table but you don't want the new table to have the records that are in employee (i.e. the new table should be empty).
In which case, I suggest you do a select into and then a truncate. Both of these operations are non-logged and so should be quite quick. Not that the 10 records in employee is going to cause a major performance bottleneck.
SELECT * INTO <newtable> FROM Employee
GO
TRUNCATE TABLE <newtable>
Regards,
Karl Grambow
September 6, 2001 at 2:32 am
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply