In sql server, I have once column in the table, i want to make the column in two column, in the other table [new table]. Can you help me.
------------------------
Type
------------------------
UserDefine
UserDefine
AutoGenerate
AutoGenerate
UserDefine
-------------------------
The above is my column in one of my table now i want to make the column in two like UserDefine and Autogenerate column in different table
-----------------------------------
UserDefine | AutoGener |
------------------------------------|
UserDefine | AutoGenerate |
| |
UserDefine | AutoGenerate |
---------------------------------------
Like the above, help me thank you.
I would use two inserts, one for the "UserDefine" value and another one for the "AutoGenerate"
Changing the where clause to the apropiate conditions to discriminate between the two types.
Try this:
SQL Fiddle Demo