fjtello / SQL-C-sharp

Common programming and coding tips and howtos
0 stars 0 forks source link

SQL syntax [#clustered index #object_id] #19

Open fjtello opened 7 years ago

fjtello commented 7 years ago

CREATE TABLE dbo.TestStructure ( id INT NOT NULL, filler1 CHAR(36) NOT NULL, filler2 CHAR(216) NOT NULL );

TRUNCATE TABLE dbo.TestStructure; CREATE CLUSTERED INDEX idx_cl_id ON dbo.TestStructure(id);

SELECT OBJECT_NAME(object_id) AS table_name, name AS index_name, type, type_desc FROM sys.indexes WHERE object_id = OBJECT_ID(N'dbo.TestStructure', N'U');

-- DROP TABLE dbo.TestStructure;

select top 10 * from sys.objects where name like '%TestStructure' select OBJECT_ID(N'dbo.TestStructure', N'U');