From: INTP56 on
I don't think the problem as explained warrants executing DDL on a permenent
table. It seems like you are just looking to know if you check a row or not.

How about making a temp table, where the PK is the FK back to the original
table, along with the bit column and join them together. When you are done,
drop the temp table. The original table never gets changed.

Bob


"Jeff" wrote:

> Hey
>
> Sql Server 2005
>
> In a table I added an extra column to a table:
> alter table tableA add checked bit default 0
>
> Then I give this column a value:
> update tableA set checked = 0;
>
> Now I create a stored procedure which contain 3 select using the column
> 'checked' in the where clause.
>
> after running the stored procedure once, then I want to remove that extra
> column I added to the table. But removing the column gives a 5474 error (an
> constraint is dependant on the column 'checked')
>
> I've read the http://support.microsoft.com/kb/816755 article about this
> issue. It says that I need to drop the constraint first. Okay. but then I
> must manually check what the constraint name is an drop it..
>
> It takes time to check what the name on the constraint is and then type the
> name.. etc..
>
> So instead I would like to make script which delete this constrain no matter
> name it would have. Then I can run this script without being sure what the
> name of this constraint have.
>
> I want to make this as fast as possible because some other program may start
> to fail if this modification takes too long time
>
> any suggestions?
>
>
>
>
>
First  |  Prev  | 
Pages: 1 2
Prev: db mail
Next: SQL server message