SQL सर्वर बनाएँ तालिका कथन में एक प्राथमिक कुंजी या अनन्य अनुक्रमणिका बनाना संभव है। क्या क्रिएट टेबल स्टेटमेंट के भीतर एक नॉन-यूनिक इंडेक्स बनाना संभव है ?
CREATE TABLE MyTable(
a int NOT NULL
,b smallint NOT NULL
,c smallint NOT NULL
,d smallint NOT NULL
,e smallint NOT NULL
-- This creates a primary key
,CONSTRAINT PK_MyTable PRIMARY KEY CLUSTERED (a)
-- This creates a unique nonclustered index on columns b and c
,CONSTRAINT IX_MyTable1 UNIQUE (b, c)
-- Is it possible to create a non-unique index on columns d and e here?
-- Note: these variations would not work if attempted:
-- ,CONSTRAINT IX_MyTable2 INDEX (d, e)
-- ,CONSTRAINT IX_MyTable3 NONCLUSTERED INDEX (d, e)
);
GO
-- The proposed non-unique index should behave identically to
-- an index created after the CREATE TABLE statement. Example:
CREATE NONCLUSTERED INDEX IX_MyTable4 ON MY_TABLE (d, e);
GO
फिर, लक्ष्य क्रिएट टेबल स्टेटमेंट के भीतर नॉन-यूनिक इंडेक्स बनाना है, उसके बाद नहीं।
जो इसके लायक है, उसके लिए मुझे सहायक होने के लिए [SQL Server Books ऑनलाइन प्रविष्टि के लिए प्रविष्टि] नहीं मिली ।
इसके अलावा, [यह प्रश्न] लगभग समान है, लेकिन स्वीकृत उत्तर लागू नहीं होता है।