0

I am using SQL Server 2005. If I try to generate scripts for the dB using the Generate Scripts wizard in the management studio (Right click dB-> Tasks-> Generate Scripts)

I get no option like IF EXISTS DROP condition in the list. Whereas some of the SQL Servers installed on different machines have this option enabled.

Is the service pack missing or any option needs to be modified to get this feature?

2 Answers 2

1

If you right-click there is a page in the wizard where you can set your scripting options. One option is "Include IF NOT EXISTS". Or goto the Tools -> Options -> SQL Server Object Explorer-> Scripting to set this.

Sign up to request clarification or add additional context in comments.

1 Comment

"Include IF NOT EXISTS"=true will include the table/procedure if it doesnt exist. But what I need is, If it exists drop it. And then create whatever in the script.
0

When I execute this command, all I get is a CREATE DATABASE statement and then the associated options are set.

You want to generate a DROP DATABASE statement?

It doesn't look like this functionality is present, but you can generate the drop statement and then paste it in front.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.