You are here: Re: Stored Procedure to change default « MsSQL Server « IT news, forums, messages
Re: Stored Procedure to change default

Posted by Mike Epprecht \(SQL MVP\) on 10/05/55 11:34

Maybe more than one row is returned, and only one value can fit into a
variable.

This will work:

declare @oname sysname
select TOP 1 @oname=name from sysobjects where name like
"df__mytable__mycol%"

alter table mytable drop constraint @oname

Regards
--------------------------------
Mike Epprecht, Microsoft SQL Server MVP
Zurich, Switzerland

IM: mike@epprecht.net

MVP Program: http://www.microsoft.com/mvp

Blog: http://www.msmvps.com/epprecht/

<JLavalley@Enlighten.Net> wrote in message
news:1134587099.580770.161300@g44g2000cwa.googlegroups.com...
> Can someone explain to me why the following doesn't work?
>
> declare @oname sysname
> select @oname=name from sysobjects where name like
> "df__mytable__mycol%"
>
> alter table mytable drop constraint @oname
>

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация