Click here to Skip to main content
15,893,663 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
How to INSERT new column(Field) into MyTable
1. FirstName nvarchar(50)
2. LastName nvarchar(100)
3. Student bit Checked
4. CreateDate datetime
5. HwoOld float Checked
Posted
Updated 7-Jun-15 18:34pm
v4
Comments
Member 11702607 7-Jun-15 23:43pm    
How to INSERT column(Field) into MyTable
Afzaal Ahmad Zeeshan 7-Jun-15 23:45pm    
Your question isn't clear. What do you want to insert? A new column or just the values in that column?
Member 11702607 7-Jun-15 23:47pm    
New column
Afzaal Ahmad Zeeshan 7-Jun-15 23:55pm    
Read my answer below, Solution 1.

To add a new column to your current table, you would alter the table and add a new column. Intuitively.

SQL
ALTER table_name
ADD column_name type


Above commend when executed would add a new column with name column_name in the table named table_name. Alter these values (table_name, column_name) to suit your own requirements. For more on this, please read https://msdn.microsoft.com/en-us/library/ms190273.aspx[^]
 
Share this answer
 
Comments
Member 11702607 8-Jun-15 2:26am    
Thanks
Afzaal Ahmad Zeeshan 8-Jun-15 3:44am    
You can also mark this as Accepted answer by clicking the green button. :)
I need some more info.

Are you trying to insert a record into the Database? What type of database?
 
Share this answer
 
Comments
Member 11702607 7-Jun-15 23:43pm    
How to INSERT column(Field) into MyTable

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900