I need to add a column to my SQL Server table. Is it possible to do so without losing the data, I already have?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Of course! Just use the
ALTER TABLE...syntax.Example
Or
In SQL Server 2008 the first one is a metadata only change. The second will update all rows.
In SQL Server 2012+ Enterprise edition the second one is a metadata only change too.