Sql Server Managament Studio 2008 not scripting for SQL Server 2000 properly

Posted on 2008-11-18
Last Modified: 2012-08-13
I have SQL Server Management Studio connecting to a SQL Server 2005. I am using studio to script a database targeted for SQL Server 2000. 'Script for server version' is set to sql server 2000.
However the generated script error out because the syntax is not for 2000. Is this a bug in Studio?

For example:
IF  EXISTS (SELECT * FROM sysobjects WHERE object_id = OBJECT_ID(N'[dbo].[ApproveOrder]') AND type in (N'P', N'PC'))
DROP PROCEDURE [dbo].[ApproveOrder]

then I have to manually change it to:

IF  EXISTS (SELECT * FROM sysobjects WHERE id = OBJECT_ID(N'[dbo].[ApproveOrder]') AND type in (N'P', N'PC'))
DROP PROCEDURE [dbo].[ApproveOrder]
Question by:jentel2
    1 Comment
    LVL 9

    Accepted Solution

    That happen with SQL Server 2008, and  it seems to be a bug in MS SQL Management Studio for MS SQL 2008....Please report it. :)
    For SQL Server 2005 it just work fine.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    What Security Threats Are You Missing?

    Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

    Suggested Solutions

    Title # Comments Views Activity
    SQL PIVOT Table 21 30
    SSRS Columns as Rows in a Table 14 22
    How do I get the percentage 24 30
    SQl server DB permission questions 3 36
    After restoring a Microsoft SQL Server database (.bak) from backup or attaching .mdf file, you may run into "Error '15023' User or role already exists in the current database" when you use the "User Mapping" SQL Management Studio functionality to al…
    Occasionally there is a need to clean table columns, especially if you have inherited legacy data. There are obviously many ways to accomplish that, including elaborate UPDATE queries with anywhere from one to numerous REPLACE functions (even within…
    Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
    Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

    760 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    11 Experts available now in Live!

    Get 1:1 Help Now