Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
テーブルの列に何らかの制約を追加する必要があります。ユーザーが手動またはその他の方法で、テーブルの複数の行に同じテキストを入力しないようにする必要があります。どうすればこれを達成できますか?
ある種の一意性制約を使用することをお勧めします。もちろん、主キーも同様に機能します。例えば:
ALTER TABLE MyTable ADD CONSTRAINT UK_MyUniqueConstraint UNIQUE (MyColumn)
SEで説明されているこれを作成する他の方法もあります。