• Nathan thanks for the feedback; having a different pair of eyes helps so much shaking down a proc like this.

    #2 and #3 on the list of the things you identified I could correct immediately: all the int types were working(tinyint/smallint/bigint), and i added decimal and numeric; i think that is the complete list of allowable identity column types, right?

    #3 was selecting a different column: user_type_id immediately fixed the type_name issue.

    you can download the latest version here

    for item #1, i know where the command *should* go in the script, but i don't know how to identify the field:

    use this code as an example:

    create table blah(

    blahid decimal(18,0) identity(1,1) NOT FOR REPLICATION primary key ,

    blahname sysname)

    select * from sys.columns where object_name(object_id)='blah'

    exec sp_getddl blah

    drop table blah

    if you look at the columns in sys.columns, I see several candidates for identifying "NOT FOR REPLICATION":

    is_replicated

    is_non_sql_subscribed

    is_merge_published

    is_dts_replicated

    I don't know IF those columns are used to identify that property or not...never do replication at my shop.

    if you have a replicated database, could you tell me which might be the one?

    since I never replicate, i don't see the advantage of adding that optional command; i similarly skipped saying what file group and some other things related to the table as well.

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!