SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
Search:  
 
 

Add Primary key

By Terry Benedict,

Total article views: 480 | Views in the last 30 days: 24

Hi Friends,

sometimes, we need at all the tables should contain a primary key, like in replication.

I create script for this. You can generate the statements or execute them as per your requirements.

Execute the sp with proper flag( 0/1 ) .

1. First Execute the sciprt .and then

2. EXECUTE spAddPrimaryKey 0,1,0,0,0 [ AS PER UR REQUIREMENT]

I think i will help you.

I m waiting ur resonses and valuable suggestions.

Thx

Vinay Kumar

By Terry Benedict,

Total article views: 480 | Views in the last 30 days: 24
Your response
 
 
Related tags

Primary key    
 
 
Contribute
Like this? Try these...

The Value of an MBA in IT

By Ted Pin | Category: Editorial
| 576 reads

Generate Insert Statements

By Terry Benedict | Category: Primary key
(not yet rated) | 215 reads

Free registration required...

To read the rest of this article, and access thousands of other articles, we ask you to register on the site and subscribe to our newsletters.

Login (existing users)

Login

Email:   Password:   Remember me: Forgotten your password?

Register (new users)

Register

Email:   Password:
Confirm:

Subscribing to our newsletters gets you:

  • ALL of our content (thousands of articles, scripts, and forum postings)
  • A daily newsletter (example)
  • A weekly news round up (example)
  • The opportunity to ask and answer questions in our forums
  • A daily Question of the Day to test and help you increase your knowledge of SQL Server.

Steve Jones
Editor, SQLServerCentral.com