alter statement

Posted on 2009-05-24
Medium Priority
Last Modified: 2012-05-07
I need to add the following:

[IndexTicketServiceID] [int] IDENTITY
[TicketID] [int]
[ServiceTypeID] [int]  - (will be phased out)
[DateAdded] [datetime]
[AgentAdded] [nvarchar](50)
[DateCreated] [datetime]

[ServiceID] [int]  - (the new way links to a company service)
[FlagRemoved] [bit] NULL DEFAULT ((0))
[AgentRemoved] [nvarchar](50)
[DateRemoved] [datetime]
Question by:mathieu_cupryk
LVL 60

Expert Comment

ID: 24464037
Great...what is your question?
LVL 75

Expert Comment

by:Aneesh Retnakaran
ID: 24464121
Assuming that you need to add 4 columns

ALTER TABLE dbo.tbl_index_ticket_services ADD
      ServiceID int NULL,
      FlagRemoved bit NULL default 0 ,
      AgentRemoved nchar(50) NULL,
      DateRemoved datetime NULL
LVL 15

Accepted Solution

rob_farley earned 2000 total points
ID: 24464318
alter table dbo.tbl_index_ticket_services
[ServiceID] [int] ,
[FlagRemoved] [bit] NULL DEFAULT ((0)),
[AgentRemoved] [nvarchar](50),
[DateRemoved] [datetime] ;

And later, when you want to remove the other one:

alter table dbo.tbl_index_ticket_services
drop column [ServiceTypeID];


Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

So every once in a while at work I am asked to export data from one table and insert it into another on a different server.  I hate doing this.  There's so many different tables and data types.  Some column data needs quoted and some doesn't.  What …
Data architecture is an important aspect in Software as a Service (SaaS) delivery model. This article is a study on the database of a single-tenant application that could be extended to support multiple tenants. The application is web-based develope…
SQL Database Recovery Software repairs the MDF & NDF Files, corrupted due to hardware related issues or software related errors. Provides preview of recovered database objects and allows saving in either MSSQL, CSV, HTML or XLS format. Ensures recov…
Stellar Phoenix SQL Database Repair software easily fixes the suspect mode issue of SQL Server database. It is a simple process to bring the database from suspect mode to normal mode. Check out the video and fix the SQL database suspect mode problem.
Suggested Courses

624 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question