hello all
I have table1 with two columns
Name existence
Apple 0
Banana 1
where 0 means doesnt exist ,and 1 means exist..
I want to make a copy of table1 so that the copy ( in this case I named it table2)
So in table2 existense column change from the int value to boolean value.
How to do that ?
tq
denny
Loading
Sam HobbsPosted Mar 6, 2010, 9:15 PM
I am not familiar with SQL Server's tools enough to say specifically how to do it, but I assume it can be done easy enough using SQL Server without writing any code, or at most writing a script. Is that what you are asking?
Alternatively, you could write a console program that reads the table in and writes out the new table. Is that what you are asking for?
theLizardPosted Mar 7, 2010, 7:05 PM
There is a simple solution to your problem.
If you have sql management studion, you can create your new table if you have not already done so with the fields, the table should have the same number of fields.
Open the old table in 'TABLE' view. (Right click of the table name then select "Open Table"
select all the records you want to move to the new table, right click --> Copy.
Open the new table, should be empty, click in firs cell --> Right Click --> Paste
I have tested this with the sample values here and changed existance to a tinyint which is a bool value.
worked ok in sql 2005 so should work the same in other version.
And yes, you are right it is easy if you know how, I would have replied sooner but I had major issues with windows.
denny simonPosted Mar 7, 2010, 6:36 PM
difficult is easy if you know
tq
denny