Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
mcupryk
Yak Posting Veteran
91 Posts |
Posted - 2011-03-09 : 10:14:38
|
| I have the following columns to add[FinancialContactPrefix] [nvarchar](4) NULL, [FinancialContact] [nvarchar](50) NULL, [FinancialPosition] [nvarchar](50) NULL, [FinancialPhone] [nvarchar](14) NULL, [FinancialExtension] [nvarchar](4) NULL, [FinancialFax] [nvarchar](14) NULL, [FinancialEmail] [nvarchar](50) NULL,------------------------------CREATE TABLE [dbo].[tblContactHistory]( [HistoryID] [int] NOT NULL, [ProviderID] [int] NULL, [Type] [nvarchar](20) NULL, [EffectiveDate] [datetime] NULL, [Information] [nvarchar](250) NULL, CONSTRAINT [PK_tblContactHistory_1] PRIMARY KEY CLUSTERED ( [HistoryID] ASC)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]) ON [PRIMARY]GOALTER TABLE [dbo].[tblContactHistory] WITH CHECK ADD CONSTRAINT [FK_tblContactHistory_tblServiceProvider] FOREIGN KEY([ProviderID])REFERENCES [dbo].[tblServiceProvider] ([ProviderID])GOALTER TABLE [dbo].[tblContactHistory] CHECK CONSTRAINT [FK_tblContactHistory_tblServiceProvider]GOAny help would be awesome. |
|
|
djj55
Constraint Violating Yak Guru
352 Posts |
Posted - 2011-03-09 : 10:28:25
|
| Are you creating the table? or had the table been created with the code provided?You could try:ALTER TABLE tblContactHistory ADD [FinancialContactPrefix] [nvarchar](4) NULL, [FinancialContact] [nvarchar](50) NULL, [FinancialPosition] [nvarchar](50) NULL, [FinancialPhone] [nvarchar](14) NULL, [FinancialExtension] [nvarchar](4) NULL, [FinancialFax] [nvarchar](14) NULL, [FinancialEmail] [nvarchar](50) NULL |
 |
|
|
mcupryk
Yak Posting Veteran
91 Posts |
Posted - 2011-03-09 : 10:35:35
|
| the table is created.Any help would be awesome. |
 |
|
|
mcupryk
Yak Posting Veteran
91 Posts |
Posted - 2011-03-09 : 10:46:11
|
| nice job djj55Any help would be awesome. |
 |
|
|
|
|
|
|
|