Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Change field size
Message
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Autre
Versions des environnements
SQL Server:
SQL Server 2005
Divers
Thread ID:
01366211
Message ID:
01366223
Vues:
6
Sounds to me you need to remove the dependency of SSN from the PK first, adjust the field and add it back.

>The object 'PK_HandHeld' is dependent on column 'SerialNo'.
>ALTER TABLE ALTER COLUMN SerialNo failed because one or more objects access this column.
>
>>What error did you get?
>>
>>>I have a table with NVARCHAR(30) PK (I don't like nvarchar PK but that is a different story)
>>>Situation changed and 30 characters for PK is nolonger enough I have to change it to NVARCHAR(100)
>>>
>>>Here is the code to create the table:
>>>
>>>CREATE TABLE [dbo].[HandHeld](
>>>	[SerialNo]			[nvarchar](30) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
>>>	[LastUsedBy]		[nvarchar](30) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
>>>	[LastDownloaded]	                     [datetime] NOT NULL,
>>>	[Notes]			[nvarchar](500) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
>>>	[Added]			[datetime] NOT NULL,
>>>	[Modified]			[datetime] NOT NULL,
>>> CONSTRAINT [PK_HandHeld] PRIMARY KEY CLUSTERED 
>>>(
>>>	[SerialNo] ASC
>>>)WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY]
>>>) ON [PRIMARY]
>>>
>>>
>>>Here is the code to change the table:
>>>
>>>ALTER TABLE [HandHeld] ALTER COLUMN [SerialNo] NVARCHAR(100) NOT NULL
>>>
>>>
>>>Now I thought all was good because it worked on my test machines and it worked on several customer machines until I installed the app for a Japaneese customer on his Japaneese laptop and the update statement failed.
>>>
>>>Why would this fail? Is there a SQL Server setting that prevents this?
>>>How can I do it differently?
>>>
>>>Thanks,
>>>Einar
If it's not broken, fix it until it is.


My Blog
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform