0

I need to add comments to fields in MSSQL and I know I can do it through designer. The thing is I have many tables where there are the same fields: InsertDate ModifyDate AddUserId ModifyUserId and so on.

I'd like to write a script that will find all tables and will add comments to this fields. Eventually I can pass tables names to the scripts.

Any ideas how to achive this?

tylkonachwile
  • 1,669
  • 2
  • 13
  • 26
  • 1
    Although I've linked to the duplicate, why wouldn't you *source control* your schema instead and use that for information about *when* and *who* changed things. Especially, scalar `ModifyXxx` properties tend to be pointless because a history of User 1 Creates table, User 2 makes a horrific modification, User 3 makes a benign change ends up pointing at Users 1 and 3 and doesn't give you any clue that you need to hunt down User 2. – Damien_The_Unbeliever Nov 21 '18 at 07:57
  • And no one really needs a comment for columns like InsertDate. Don't create pointless work or useless reading. – SMor Nov 21 '18 at 14:25

0 Answers0