July 3, 2012 at 1:07 pm
Hello Masters,
Why only primary key is necessary for Transactional replication ? The object without PK is not accepted in Transactional replication. Can anyone explain it?
Thanks in advance,
Jitendra
July 3, 2012 at 1:13 pm
It makes sense if you think about it. You are talking about pushing modified rows contents to another database. Without a primary key how do you know which row is which in the target? It can be a composite key but there MUST be a way to identify any given row, primary keys are the mechanism for that.
_______________________________________________________________
Need help? Help us help you.
Read the article at http://www.sqlservercentral.com/articles/Best+Practices/61537/ for best practices on asking questions.
Need to split a string? Try Jeff Modens splitter http://www.sqlservercentral.com/articles/Tally+Table/72993/.
Cross Tabs and Pivots, Part 1 – Converting Rows to Columns - http://www.sqlservercentral.com/articles/T-SQL/63681/
Cross Tabs and Pivots, Part 2 - Dynamic Cross Tabs - http://www.sqlservercentral.com/articles/Crosstab/65048/
Understanding and Using APPLY (Part 1) - http://www.sqlservercentral.com/articles/APPLY/69953/
Understanding and Using APPLY (Part 2) - http://www.sqlservercentral.com/articles/APPLY/69954/
July 3, 2012 at 1:24 pm
Sean Lange (7/3/2012)
It makes sense if you think about it. You are talking about pushing modified rows contents to another database. Without a primary key how do you know which row is which in the target? It can be a composite key but there MUST be a way to identify any given row, primary keys are the mechanism for that.
Thanks for the explanation ! Can't we use identifier column for the same ?
July 3, 2012 at 1:41 pm
jitendra.padhiyar (7/3/2012)
Sean Lange (7/3/2012)
It makes sense if you think about it. You are talking about pushing modified rows contents to another database. Without a primary key how do you know which row is which in the target? It can be a composite key but there MUST be a way to identify any given row, primary keys are the mechanism for that.Thanks for the explanation ! Can't we use identifier column for the same ?
Do you mean an identity? You can make an identity the primary key but just being an identity does not work because an identity can have duplicates.
_______________________________________________________________
Need help? Help us help you.
Read the article at http://www.sqlservercentral.com/articles/Best+Practices/61537/ for best practices on asking questions.
Need to split a string? Try Jeff Modens splitter http://www.sqlservercentral.com/articles/Tally+Table/72993/.
Cross Tabs and Pivots, Part 1 – Converting Rows to Columns - http://www.sqlservercentral.com/articles/T-SQL/63681/
Cross Tabs and Pivots, Part 2 - Dynamic Cross Tabs - http://www.sqlservercentral.com/articles/Crosstab/65048/
Understanding and Using APPLY (Part 1) - http://www.sqlservercentral.com/articles/APPLY/69953/
Understanding and Using APPLY (Part 2) - http://www.sqlservercentral.com/articles/APPLY/69954/
July 3, 2012 at 1:57 pm
Sean Lange
Do you mean an identity? You can make an identity the primary key but just being an identity does not work because an identity can have duplicates.
That means Transactional replication only accepts unique values.. correct? If yes, than we must can use unique constraints too, but it alllows only primary key constraints. Please correct me if I am wrong.
Thanks in advance,
Jitendra
July 3, 2012 at 2:02 pm
jitendra.padhiyar (7/3/2012)
Sean Lange
Do you mean an identity? You can make an identity the primary key but just being an identity does not work because an identity can have duplicates.
That means Transactional replication only accepts unique values.. correct? If yes, than we must can use unique constraints too, but it alllows only primary key constraints. Please correct me if I am wrong.
Thanks in advance,
Jitendra
No unique is not the ticket. Each table MUST have a primary key. Unique is slightly different in concept than a primary key. Yes you can use an identity as the primary key but that primary key MUST be present.
Take a look at this link from BOL. http://msdn.microsoft.com/en-us/library/ms151254%28v=sql.105%29.aspx
_______________________________________________________________
Need help? Help us help you.
Read the article at http://www.sqlservercentral.com/articles/Best+Practices/61537/ for best practices on asking questions.
Need to split a string? Try Jeff Modens splitter http://www.sqlservercentral.com/articles/Tally+Table/72993/.
Cross Tabs and Pivots, Part 1 – Converting Rows to Columns - http://www.sqlservercentral.com/articles/T-SQL/63681/
Cross Tabs and Pivots, Part 2 - Dynamic Cross Tabs - http://www.sqlservercentral.com/articles/Crosstab/65048/
Understanding and Using APPLY (Part 1) - http://www.sqlservercentral.com/articles/APPLY/69953/
Understanding and Using APPLY (Part 2) - http://www.sqlservercentral.com/articles/APPLY/69954/
Viewing 6 posts - 1 through 5 (of 5 total)
You must be logged in to reply to this topic. Login to reply