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

do you know what is a deadlock and what is a live lock? How will you go about resolving deadlocks? : Sql server database administration

0 Answers  


i have a table student like sname ----- ram ram ram raj raj raj i need the output like sname ----- ram raj ram raj ram raj

9 Answers   IBM,


IF more than one Site is accessing the same Database server and I want to move the DB with Minimum down time? How will you do

0 Answers  


How to use subqueries with the exists operators in ms sql server?

0 Answers  


could u plz explain about joins and views?

2 Answers  






Can we use Truncate command on a table which is referenced by FOREIGN KEY?

2 Answers   Shriram,


How can I create a report based on a query? : sql server management studio

0 Answers  


What is tempdb in sql server?

0 Answers  


in my server i have 3 instances,one of them got failed, and this cause we r not able to connect to server, how to know which instance was dameged?

1 Answers   IBM,


What do you understand by a view?

0 Answers  


Define constraints and give an example of their use?

0 Answers  


Difference between Triggers and Stored Procedure

23 Answers   Claimat, HCL, Protech, Silgate,


Categories