Re: how to get a list of constraint names or ids from sql server 2000?
From: PEACEMAKER (do.not.email_at_yo.mamas.hairy.ass.com)
Date: 06/28/04
- Next message: Matt: "Trigger functionality without trigger"
- Previous message: PEACEMAKER: "how to get a list of constraint names or ids from sql server 2000?"
- In reply to: PEACEMAKER: "how to get a list of constraint names or ids from sql server 2000?"
- Messages sorted by: [ date ] [ thread ]
Date: Mon, 28 Jun 2004 03:14:33 -0400
nm I solved it
use "exec sp_helpconstraints <tablename>" to get the recordset containing
the constraint data
to change it, you need to drop the constraint and add a new one of the same
name if you want eg
ALTER TABLE <tablename> DROP CONSTRAINT <constraintname>
ALTER TABLE <tablename> WITH CHECK ADD CONSTRAINT <constraintname> DEFAULT
<defaultvalue> FOR <columnname>
"PEACEMAKER" <do.not.email@yo.mamas.hairy.ass.com> wrote in message
news:e30eG3MXEHA.712@TK2MSFTNGP11.phx.gbl...
> is there a way to get a list of constraint names or ids for a column.
First
> I want to check if the column has a default value, I can't seem to get
this
> with ADOX but I know sql server uses constraints for default values.
However
> I don't know all the constraint names and I'm not even sure how to iterate
> them with sql queries. Any help will do
>
> thanks
>
>
- Next message: Matt: "Trigger functionality without trigger"
- Previous message: PEACEMAKER: "how to get a list of constraint names or ids from sql server 2000?"
- In reply to: PEACEMAKER: "how to get a list of constraint names or ids from sql server 2000?"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|
|