Please start any new threads on our new 
    site at https://forums.sqlteam.com.  We've got lots of great SQL Server
    experts to answer whatever question you can come up with.
    
        | 
                
                    | 
                            
                                | Author | Topic |  
                                    | stackermanStarting Member
 
 
                                        1 Post | 
                                            
                                            |  Posted - 2014-08-20 : 14:38:34 
 |  
                                            | Ok - so admittedly I am no DBA - just a SysAdmin/Security guy.  I do know enough to realize that we had issues recently with SQL Replication that were due to AutoNumber fields being used as the PKEY and inconsistencies in the relationships afterwards due to it.I know that we COULD choose the not for repl option on these OR create some type of GUID field, etc (that will be up to the dev guys).  For now I am curious though if there is a way to assess how large a task this will be?  What I really think I am looking for is a query that will audit/list any tables that have an AUTONUMBER field used as the PKEY...Is there a simple query for this? |  |  
                                    | tkizerAlmighty SQL Goddess
 
 
                                    38200 Posts | 
                                        
                                          |  Posted - 2014-08-20 : 14:48:47 
 |  
                                          | Here you go:select object_name(object_id) as TableName, name as ColumnNamefrom sys.columnswhere is_identity = 1order by 1Tara KizerSQL Server MVP since 2007http://weblogs.sqlteam.com/tarad/ |  
                                          |  |  |  
                                    | tkizerAlmighty SQL Goddess
 
 
                                    38200 Posts | 
                                        
                                          |  Posted - 2014-08-20 : 14:49:57 
 |  
                                          | As a DBA, I would recommend using the NOT FOR REPLICATION option instead of a GUID column. There are challenges with GUIDs. Too big of a topic here, but it's something that needs to be researched and designed properly.Tara KizerSQL Server MVP since 2007http://weblogs.sqlteam.com/tarad/ |  
                                          |  |  |  
                                |  |  |  |