Re: SQL 6.5 to SQL 2000 Convert function

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: Erland Sommarskog (sommar_at_algonet.se)
Date: 05/23/04


Date: Sun, 23 May 2004 22:37:45 +0000 (UTC)

Munnu (anonymous@discussions.microsoft.com) writes:
><B>But Can pass anyother parameter or change setting that allow me to
>execute
> SELECT CONVERT(INT(2),COUNT(*))
> FROM tablename
> WHERE condition
> stmt in SQL 2000 without changing code? </B>

No.

SQL Server offers the possibility to set a database in compatibility
mode, so that old syntax still works. However, your particular example
is not covered by the compatibility 65. (I just tried.) I have never
seen int(2) before, and I don't think this was ever documented or
supported in SQL6.5, it just happened to work.

To change the compatibility level of a database, you use sp_dbcmptlevel,
look in Books Online for details. However, I recommend that you fix
all syntax errors, so that you can use compatibility level 80 and use
SQL2000 at full strength.

-- 
Erland Sommarskog, SQL Server MVP, sommar@algonet.se
Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techinfo/productdoc/2000/books.asp


Relevant Pages

  • Re: VS 2005 - Server Explorer - Diagrams - Invalid DBO User
    ... > What I meant was that you could set the database compatbility level to 90, ... > use the diagram tool and then reset the compatibility level back to 80. ... >> you saying that "you can always set it back to the orginal compatibility ... > If your requirement is to use the database on an instance of SQL Server ...
    (microsoft.public.sqlserver.security)
  • Re: Upgrade Advisor Trace Files
    ... There are a number of SQL Server issues with this software. ... and delete to all of the database tables. ... Their failure to address basic 2005 compatibility issues seems ridiculous. ... turn-around time and effort required to work with the vendor is less ...
    (microsoft.public.sqlserver.tools)
  • Re: PROBLEMS TO MODIFY USER BBDD MIGRATED !!!!
    ... dont let me change anything in the database sql server 2005. ... Did you restore with the ... If you are trying to use SQL Server 2005 features (those that are not ... compatibility mode on the database to the latest level, ...
    (microsoft.public.sqlserver.server)
  • Re: Database owner after SQL 2005 upgrade
    ... I don't believe this is new behavior with SQL Server 2005. ... upgrade a SQL Server 7 database to SQL Server 2000, ... database in the compatibility mode that matches the product version it came ...
    (microsoft.public.sqlserver.setup)
  • Re: VS 2005 - Server Explorer - Diagrams - Invalid DBO User
    ... What I meant was that you could set the database compatbility level to 90, ... use the diagram tool and then reset the compatibility level back to 80. ... If your requirement is to use the database on an instance of SQL Server ... >>> dbo schema and db_owner role and I'm receiving the same error...... ...
    (microsoft.public.sqlserver.security)