Advertisement

07.15.2005 at 10:49AM PDT, ID: 21493269
[x]
Attachment Details

Add column to existing table, populate with default value

Asked by trailblazzyr55 in MS SQL Server

Tags: , , ,

Curious how to accomplish/correct syntax for the following in T-SQL...

Database Name: TestDB
Existing table name: MyTable
Existing Column Names: ID, NameFirst, NameLast, MyDate

Want to add Column: "AvailabilityStat"
With Default Value= "1"
SQLType= "INT"
  (the value of this column will either be 1 or 2, so I'm assuming "INT" length will be 1.)

What would be the best/most efficient way to go about this?
~trail


Start Free Trial
[+][-]07.15.2005 at 10:52AM PDT, ID: 14453343

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zone: MS SQL Server
Tags: add, column, sql, table
Sign Up Now!
Solution Provided By: angelIII
Participating Experts: 4
Solution Grade: A
 
 
[+][-]07.15.2005 at 10:54AM PDT, ID: 14453368

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07.15.2005 at 11:06AM PDT, ID: 14453473

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]07.15.2005 at 11:43AM PDT, ID: 14453791

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07.15.2005 at 11:45AM PDT, ID: 14453817

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07.15.2005 at 12:24PM PDT, ID: 14454228

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07.16.2005 at 02:06AM PDT, ID: 14456925

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32