IWETHEY v. 0.3.0 | TODO
1,095 registered users | 0 active users | 0 LpH | Statistics
Login | Create New User
IWETHEY Banner

Welcome to IWETHEY!

New Re: SQL Server 2000 just bit me
The only thing I can suggest is using a seperate alter table to add the primary key. It would look something like this.

CREATE TABLE NewTable
(
UID bigint IDENTITY (1,1),
RecordType char(2) NOT NULL,
RecSequenceNumber int NOT NULL,
TicketNumber varchar(15) NOT NULL,
TicketNumberCheckDigit char(1) NOT NULL,
RecordDate datetime NOT NULL,
FileDate datetime NOT NULL,
TransmissionControlNumber varchar(15) NULL,
TCNCheckDigit char(1) NULL,
OriginalRecord varchar(450) NULL
)

ALTER TABLE NewTable WITH NOCHECK ADD
CONSTRAINT [PK_NewTable] PRIMARY KEY CLUSTERED
(
[UID]
) WITH FILLFACTOR = 90 ON [PRIMARY]
GO

Jay
New Thanks for the answer
Since I have the same tables in multiple databases, what I did was put the ALTER TABLE statements to create the primary key constraint into a stored procedure. Your way is better because it keeps the primary key creation with the table creation.

I did an online chat with a "help person" at Microsoft last night, explaining the situation, and asking if they could tell me why the primary key constraint creation was hit or miss with my stored procedure. They didn't know why, especially after I showed them how I copied the text verbatim from the Books Online to use as a template.
lincoln

"Chicago to my mind was the only place to be. ... I above all liked the city because it was filled with people all a-bustle, and the clatter of hooves and carriages, and with delivery wagons and drays and peddlers and the boom and clank of freight trains. And when those black clouds came sailing in from the west, pouring thunderstorms upon us so that you couldn't hear the cries or curses of humankind, I liked that best of all. Chicago could stand up to the worst God had to offer. I understood why it was built--a place for trade, of course, with railroads and ships and so on, but mostly to give all of us a magnitude of defiance that is not provided by one house on the plains. And the plains is where those storms come from." -- E.L. Doctorow


Never apply a Star Trek solution to a Babylon 5 problem.


[link|mailto:bconnors@ev1.net|contact me]
     SQL Server 2000 just bit me - (lincoln) - (3)
         Re: SQL Server 2000 just bit me - (JayMehaffey) - (1)
             Thanks for the answer - (lincoln)
         Can't replicate it here - (ChrisR)

MEAT HELMET!
109 ms