July 3, 2006 at 1:38 am
Hi,
Is it possible to set category_id when creating a new category (in 2000) so it will be consistent accross all servers ? I can't find any allusion to it in the doc set.
Many Thanks,
A
July 3, 2006 at 4:34 am
WHat do you mean by category_id ? Is it some application specific number of your database ?
HTH, Jens Suessmeyer.
---
---
July 3, 2006 at 7:52 am
Jens,
Category_id as in the dbo.categories table
Thanks,
Angus
July 3, 2006 at 2:06 pm
Angus,
Here is an example of what you are looking for.
CREATE TABLE dbo.Category (CategoryName VARCHAR(250), CategoryId AS CHECKSUM(CategoryName))
ALTER TABLE dbo.Category ADD CONSTRAINT
UK_CategoryName UNIQUE NONCLUSTERED (CategoryName)
INSERT INTO dbo.Category (CategoryName) VALUES('Category 1')
INSERT INTO dbo.Category (CategoryName) VALUES('Category 2')
INSERT INTO dbo.Category (CategoryName) VALUES('Category 3')
SELECT CategoryName, CategoryId FROM dbo.Category
DROP TABLE dbo.Category
HTH
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply