Results 1 to 11 of 11

Thread: syntax for sp_MSaddguidcolumn

  1. #1
    Join Date
    Sep 2004
    Posts
    23

    syntax for sp_MSaddguidcolumn

    could some one please help me with the syntax for the stored procedure

    sp_MSaddguidcolumn

    i have tried searching it on msdn and i cannot get it.

    thats weird

    ---gaurav

  2. #2
    Join Date
    Sep 2002
    Posts
    169
    sp_MSaddguidcolumn is not documented for use by us mere mortals (i.e. it is for use by MS only). Hence you will not find it at MSDN.

    This sproc is in the master database. Try the following :
    use master
    go
    sp_helptext sp_MSaddguidcolumn
    go


    This will give you the source for this sproc. It has two parameters
    1. @source_owner (e.g. dbo)
    2. @source_table (e.g. YourTableName)

    An example of its usage could be
    exec master..MSaddguidcolumn source='dbo', @source_table='MyTable'

  3. #3
    Join Date
    Sep 2004
    Posts
    23
    hey stephan, thanks a lot buddy.

    i had another question. does this stored procedure take care of the unique identifier etc and not null constarint on its own.??

    i.e it adds the row guid col to the table specified right???


    ---ggupta

  4. #4
    Join Date
    Sep 2002
    Posts
    169
    Yes. Have a look at the code.

    About 3/4 the way through it is the following line
    exec ('alter table ' + @qualified_name + ' add ' + @rowguidcol + ' uniqueidentifier ROWGUIDCOL default newid() not null')

  5. #5
    Join Date
    Sep 2004
    Posts
    23
    hi,

    i am not able to combine the 2 queries,
    can u help me out with a query as an example combinig the MS_add along with the second part.

    thanks a lot,

    ur response has helped me a lot,


    ---ggupta

  6. #6
    Join Date
    Sep 2002
    Posts
    169
    What are you trying to achieve ?

    What 2 queries are you trying to combine ?

  7. #7
    Join Date
    Sep 2004
    Posts
    23
    the 2 that you have specified above



    combination of both

    thanks,

  8. #8
    Join Date
    Feb 2003
    Posts
    1,048
    There isn't a second query above. He merely quoted a piece of the stored procedure you asked about.

  9. #9
    Join Date
    Sep 2004
    Posts
    23
    didnt notice that,

    any ways got an idea after running

    use master
    go
    sp_helptext sp_MSaddguidcolumn
    go


    Thanks,

    seems to be working well so far...

    ---ggupta

  10. #10
    Join Date
    Sep 2004
    Posts
    23
    that took me a whole 25 hrs and a few minutes to exectute the query...


    well it executed successfully.

    another question,

    i am trying to add the rowguid columns manually to all the tables in the database. i am doing this becasuse the snapshot agent would time out and fail.

    after adding the rowguid column to all the tables, what should the next step be to continue with the merge replication.

    Also, when i run the snapshot agent again, even though my stored procedure sp_MSaddguidco...... has added the rowguid column to the "Consumer" table,

    the snapshot agent tries to prepare the same table, instead of bypassing it.

    let me know what should the next step be.

    thanks

  11. #11
    Join Date
    Sep 2002
    Posts
    169
    "Preparing" does not mean adding the GUID column. It also includes the steps needed to script out the tables etc as per options you selected when you defined the publication.

    I think your next step is to do a little reading about merge replication.

    Have a look at topics "Planning for Merge Replication" and "How Merge Replication Works" in books on line. These may shed some light on what merge replication is doing and why. They contain references to other topics that will help as well.

    Simply adding merge replication to an existing application without adequate testing is an exceedingly bad idea. You will almost certainly experience problems particularly with (but not necessarilly limited to) how to handle conflicts.

    And there is no reason for the snapshot agent to timeout - with a little planning and knowledge on how to configure the properties of each of the various replication agents operates, you can avoid this. You can change the query timeout parameter for the agent to be something more reasonable for you particular situation (i.e. expecting 25+ hours to do things). Have a look at the "Snapshot Agent Profile".

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •