Results 1 to 5 of 5
  1. #1
    Join Date
    Oct 2003
    Location
    Holland
    Posts
    8

    Unanswered: Update SysColumns !??

    Hey fellows,

    I want to update all tables in my database to ensure that the identity field is set to NOT FOR REPLICATION.

    This is my script:

    UPDATE SysColumns
    SET ColStat = 9
    WHERE ID IN ( SELECT ID
    FROM SysColumns INNER JOIN SysObjects ON
    SysObjects.ID = SysColumns.ID )
    WHERE SysObjects.xtype = 'U' -- UserTable
    AND SysColumn.ColStat = 1
    )

    Does anyone have some experience with this kind of queries?

    Greetz Da Witte

  2. #2
    Join Date
    Nov 2002
    Location
    Jersey
    Posts
    10,322
    I don't think I'd mess with the system tables...

    Look up ALTER TABLE...
    Brett
    8-)

    It's a Great Day for America everybody!

    dbforums Yak CorralRadio 'Rita
    dbForums Member List
    I'm Good Once as I ever was

    The physical order of data in a database has no meaning.

  3. #3
    Join Date
    Oct 2003
    Location
    Holland
    Posts
    8
    Originally posted by Brett Kaiser
    I don't think I'd mess with the system tables...

    Look up ALTER TABLE...
    suggestions ??

    I've tried something but not succesfully

  4. #4
    Join Date
    Sep 2003
    Posts
    522
    sp_configure 'allow', 1
    reconfigure with override
    go
    UPDATE SysColumns
    SET ColStat = 9
    WHERE SysColumns.ID IN ( SELECT SysColumns.ID
    FROM SysColumns INNER JOIN SysObjects ON
    SysObjects.ID = SysColumns.ID
    WHERE SysObjects.xtype = 'U' -- UserTable
    AND SysColumns.ColStat = 1
    )
    go
    sp_configure 'allow', 0
    reconfigure with override
    go

  5. #5
    Join Date
    Oct 2003
    Location
    Holland
    Posts
    8

    Talking Thankx

    Thankx !! it works perfectly now.

Posting Permissions

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