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


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
>
>



Relevant Pages

  • Re: Table Design Advice
    ... I will be creating db in SQL server though. ... MaterialCost (Currency) ... CONSTRAINT pk_products PRIMARY KEY, ...
    (microsoft.public.sqlserver.setup)
  • Re: Sequential Number in an Update
    ... And just how the hell are you going to put that in a CONSTRAINT using ... parser for grepto SQL Server dialect, but I cannot find it on my ... It probably should be re-done with CASE expressions. ... syntactically correct URL) and verification (This URL actually belongs ...
    (comp.databases.ms-sqlserver)
  • Re: How to handle constraint errors programmatically?
    ... errors for this situation (i.e. a constraint violation). ... >> I've got relational constraints setup in my SQL server database. ... can't delete a customer who has orders. ...
    (microsoft.public.access.adp.sqlserver)
  • Re: Table Design Advice
    ... Are you sure you are using SQL Server? ... CONSTRAINT pk_products PRIMARY KEY, ...
    (microsoft.public.sqlserver.setup)
  • Re: Table Design Advice
    ... Are you sure you are using SQL Server? ... CONSTRAINT pk_products PRIMARY KEY, ...
    (microsoft.public.sqlserver.setup)