Quantcast
Channel: SQL Server Database Engine forum
Viewing all articles
Browse latest Browse all 12963

Naming A Primary Key At The Initial Step

$
0
0

Hi friends,

Anyway to name a primary key at the time the same is being declared? For example, using a query like:

ALTER TABLE LOANDETAILS.MTH_201408
ADD PRIMARY KEY (LG_CUST_ID, LG_ACC_ID, LG_SRC_SYS)

for a table, can an approach be made to name the PK right at this step, instead of finding the one named by the SQL Server unclearly, something as 'PK__MTH_20140__110E2E2DC4061AA3' and using sp_rename to name it much more clearly?


Thanx in advance, Best Regards, Faraz A Qureshi


Viewing all articles
Browse latest Browse all 12963

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>