How to create Clustered Primary Key to table?

Answers were Sorted based on User's Feedback



How to create Clustered Primary Key to table?..

Answer / sarika jayadave

USE <DATABASE NAME>
GO
ALTER TABLE [SERVER NAME].[TABLE NAME]
ADD CONSTRAINT [PRIMARY KEY NAME]
PRIMARY KEY CLUSTERED
(
[ORDER BY FILED NAME] ASC
)

Is This Answer Correct ?    3 Yes 0 No

How to create Clustered Primary Key to table?..

Answer / saravakumar

USE [AdventureWorks]
GO
ALTER TABLE [Sales].[Individual]
ADD CONSTRAINT [PK_Individual_CustomerID]
PRIMARY KEY CLUSTERED
(
[CustomerID] ASC
)

Is This Answer Correct ?    1 Yes 1 No

Post New Answer

More SQL Server Interview Questions

Can we call stored procedure in trigger?

0 Answers  


There is a trigger defined for INSERT operations on a table, in an OLTP system. The trigger is written to instantiate a COM object and pass the newly insterted rows to it for some custom processing. What do you think of this implementation? Can this be implemented better?

1 Answers   HCL,


two tables with table name ship(name,year) and battle (name,year),how to find the latest added year in the table ship

1 Answers  


Where sql server usernames and passwords are stored in a sql server?

0 Answers  


What is the use of sign function?

0 Answers  






What protocol does sql server use?

0 Answers  


How to defragment table indexes?

0 Answers  


Why is replication required on the sql server?

0 Answers  


What is the data type of time?

0 Answers  


Tell me what do you mean by an execution plan? Why is it used? How would you view it?

0 Answers  


What is PROJECTION Operation?

0 Answers   Infosys,


When would you use sql joins?

0 Answers  


Categories