DBAs - Do you know the compatibility issues between SQL Server 2000 and 2005?

Last updated by Tiago Araújo [SSW] almost 2 years ago.See history

The SQL 2005 generated scripts are not compatible with SQL 2000, so use SQL 2000 to generate your scripts if you want to make your scripts work well on both versions.

IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[ProcessTarget]') AND type in (N'P', N'PC'))
drop procedure [dbo].[ProcessTarget]

Figure: script only works on SQL 2005, because 'sys.objects' is only available in this version

IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[dbo].[ProcessTarget]') AND OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure [dbo].[ProcessTarget]

Figure: script works on both SQL 2000 and SQL 2005

We open source. Powered by GitHub