September 27, 2006 at 7:39 am
[in_PatientID] [int] IDENTITY(1,1) NOT NULL,
[tx_PatientName] [varchar](250) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
[tx_PatientUniqueCode] [varchar](20) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
[tx_PatientNumber] [varchar](20) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[tx_Physician] [varchar](50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[tx_PatientNotes] [varchar](1024) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[in_GenderLookupID] [int] NULL,
[dt_DateOfBirth] [datetime] NULL,
[in_HomeBedID] [int] NULL,
[in_CurrentBedID] [int] NULL,
[dt_CurrentBedTime] [datetime] NULL,
[tx_UserName] [varchar](15) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[dt_LastChanged] [datetime] NOT NULL CONSTRAINT [DF_TD_PATIENT_dt_LastChanged] DEFAULT (getdate()),
CONSTRAINT [PK__TD_PATIENT] PRIMARY KEY CLUSTERED
(
[in_PatientID] ASC
) ON [PRIMARY],
CONSTRAINT [UQ__TD_PATIENT_UNIQUECODE] UNIQUE NONCLUSTERED
(
[tx_PatientUniqueCode] ASC
) ON [PRIMARY]
) ON [PRIMARY]
September 27, 2006 at 7:42 am
how are you attempting to change it ? using enterprise manager or are you scripting the change?
MVDBA
September 27, 2006 at 7:43 am
Is this field in a relation?
Does this code run?
ALTER TABLE dbo.PATIENT
ALTER COLUMN tx_PatientUniqueCode varchar(125) COLLATE SQL_Latin1_General_CP1_CI_AS not null
If not, what error message are you getting?
September 27, 2006 at 8:13 am
September 27, 2006 at 8:15 am
When a column data is fixed there may be a check constraint on the column which means you have to ALTER Table drop all constraints then ALTER table again and change the column length. Run a search for check constraint in the BOL(books online). Hope this helps.
Kind regards,
Gift Peddie
September 27, 2006 at 8:16 am
do you have a trigger that writes the contents of this field to another location???
or perhaps a cascading update from a foreign key - they might be trying to write the 21 charachters to a varchar(20) location somewhere else ??
MVDBA
September 27, 2006 at 8:54 am
September 27, 2006 at 9:14 am
glad to be of service - done it myself before and couldn't figure out why users with usernames longer than 25 chars were failing to run certain procs!!!!
MVDBA
Viewing 8 posts - 1 through 7 (of 7 total)
You must be logged in to reply to this topic. Login to reply