[dba-SQLServer]Removing a Default on a column

Stoker, Kenneth E Kenneth.Stoker at pnl.gov
Wed Feb 26 14:58:25 CST 2003


Thanks, I guess it does work.  I was working on this yesterday and I may have had single quotes around my default name.

Ken Stoker

Technology Commercialization

Information Systems Administrator

PH: (509) 375-3758

FAX: (509) 375-6731

E-mail:  Kenneth.Stoker at pnl.gov <mailto:Kenneth.Stoker at pnl.gov> 



-----Original Message-----
From: Djabarov, Robert [mailto:Robert.Djabarov at usaa.com]
Sent: Wednesday, February 26, 2003 12:51 PM
To: dba-sqlserver at databaseadvisors.com
Subject: RE: [dba-SQLServer]Removing a Default on a column


alter table <tbl_name> drop constraint <default_name>

sp_unbindefault is used on defaults created with CREATE DEFAULT and then sp_bindefault.

______________________________________________________
Robert Djabarov
Certified MS SQL Server DBA
Certified MS SQL Server Programmer
Certified MS VB Programmer
? (210) 913-3148 - phone
( (210) 753-3148 - pager

 -----Original Message-----
From: 	Stoker, Kenneth E [mailto:Kenneth.Stoker at pnl.gov] 
Sent:	Wednesday, February 26, 2003 2:18 PM
To:	dba-SQLServer (E-mail)
Subject:	[dba-SQLServer]Removing a Default on a column

Everyone,

I am trying to remove a default on a column through T-SQL.  I tried to used sp_unbindefault and get an error 'cannot unbind from <column name>.  use alter table drop constraint.'  So, I take this to heart and try an 'alter table drop constraint'.  I then get an error back saying there is not constraint with that name.  I can see the default in the sysobjects table and I see its id in the cdefault column for the field within the syscolumns table.  Is there some other way I should be doing this?

Thank you.

Ken Stoker
Technology Commercialization
Information Systems Administrator
PH: (509) 375-3758
FAX: (509) 375-6731
E-mail:  Kenneth.Stoker at pnl.gov 


_______________________________________________
dba-SQLServer mailing list
dba-SQLServer at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/dba-sqlserver
http://www.databaseadvisors.com



_______________________________________________
dba-SQLServer mailing list
dba-SQLServer at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/dba-sqlserver
http://www.databaseadvisors.com




More information about the dba-SQLServer mailing list