Information générale
Forum:
Microsoft SQL Server
>Thank you for your response. I have encluded a stored proc segment to show how the table is being created.
>
>CREATE TABLE Customers(
> CustomerID INT PRIMARY KEY IDENTITY (1,1) NOT NULL,
> SalesOrder INT UNIQUE NULL,
> FirstName VARCHAR(26) NOT NULL,
> MI CHAR(1) NULL,
> LastName VARCHAR(30) NULL,
> SSN BIGINT UNIQUE NULL,
> PSSN BIGINT UNIQUE NULL,
> DLN VARCHAR(20) UNIQUE NULL,
> ...
>
>Is there anything else I should be doing??
>
>Thanks
>
>Rollin
Try to add a SET ANSI_NULLS ON GO above this and recreate it. See if that makes a difference.
See, when ANSI_NULLS is ON null = null returns null, with ansi nulls off then null = null returns true, which may be why your server sees them as non-unique values.
BOb
Précédent
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement