Code Library
Home Submit Free Hosting Link To Us Contacts

SQL Create table clustered dupes

SQL Create table clustered dupes SQL SQL Create table clustered dupes Download (.zip)



USE pubs
GO
if exists (select * from sysobjects where name='Clustered_Dupes' and type='U')
        DROP TABLE Clustered_Dupes
GO

CREATE TABLE Clustered_Dupes 
    (Col1 char(5)     NOT NULL,
     Col2 int         NOT NULL,
     Col3 char(3)     NULL,
     Col4 char(6)     NOT NULL,
     Col5 float       NOT NULL)
GO
CREATE CLUSTERED INDEX Cl_dupes_col1 ON Clustered_Dupes(col1)
GO

SELECT first, indid, keycnt, name FROM sysindexes 
WHERE id = object_id ('Clustered_Dupes')
GO

INSERT Clustered_Dupes  VALUES ('ABCDE', 123, null, 'CCCC', 4567.8)
GO
SELECT first, root, id,indid FROM sysindexes
WHERE id = object_id('Clustered_Dupes')
GO
INSERT Clustered_Dupes  VALUES ('ABCDE', 456, null, 'DDDD', 4567.8)
INSERT Clustered_Dupes  VALUES ('ABCDE', 64, null, 'EEEE', 4567.8)

GO






Tatet