Friday, March 30, 2012

How to create scripts (drop then create) in sql 2005

I'm using sql 2005. One thing I could do in sql 2k which I don't see in sql
05 is when I script objects in EM it would check to see if the object exists
first, and if so, it would drop it before creating it. I don't see such an
option in sql 05 SSMS. Its a much better scripting wizard but seems to be
missing the most basic functions.
any advice?
Thanks.
moondaddy@.noemail.noemailAs far as I know there is no such choice in the wizard, you would need to
run it twice, one for 'Generate DROP statements only' and one for 'Generate
CREATE statements only'.
Note that the SP1 description still shows 'Generate the script as DROP
statements, CREATE statements, or DROP statements followed by CREATE
statements."
Ben Nevarez, MCDBA, OCP
Database Administrator
"moondaddy" wrote:

> I'm using sql 2005. One thing I could do in sql 2k which I don't see in s
ql
> 05 is when I script objects in EM it would check to see if the object exis
ts
> first, and if so, it would drop it before creating it. I don't see such a
n
> option in sql 05 SSMS. Its a much better scripting wizard but seems to be
> missing the most basic functions.
> any advice?
> Thanks.
> --
> moondaddy@.noemail.noemail
>
>|||Check out http://www.sqlteam.com/item.asp?ItemID=23185 and
http://weblogs.sqlteam.com/billg/ar...1/22/8414.aspx.
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"moondaddy" <moondaddy@.noemail.noemail> wrote in message
news:uLMUBQWdGHA.3712@.TK2MSFTNGP03.phx.gbl...
> I'm using sql 2005. One thing I could do in sql 2k which I don't see in s
ql 05 is when I script
> objects in EM it would check to see if the object exists first, and if so,
it would drop it before
> creating it. I don't see such an option in sql 05 SSMS. Its a much bette
r scripting wizard but
> seems to be missing the most basic functions.
> any advice?
> Thanks.
> --
> moondaddy@.noemail.noemail
>

No comments:

Post a Comment