How to Set Compatibility Level for SQL Server 2008 or 2005 Database Cum se setează nivelul de compatibilitate pentru SQL Server 2008 sau 2005 Baza de date
When selecting data or performing query on Microosft SQL Server 2008 or SQL Server 2005 database, the following error message or failure may be returned: La selectarea de date sau de performanţă pe Microosft interogare SQL Server 2008 sau SQL Server 2005 de baze de date, următorul mesaj de eroare sau eşecul poate fi returnate:
[Microsoft][ODBC SQL Server Driver][SQL Server][Msg 4147, Level 15, State 1, Line 4] The query uses non-ANSI outer join operators (”*=” or “=*”). [Microsoft] [ODBC SQL Server Driver] [SQL Server] [Msg 4147, Level 15, State 1, Line 4] Interogarea utilizează non-ANSI exterior alătura operatorii ("*=" sau "=*"). To run this query without modification, please set the compatibility level for current database to 80, using the SET COMPATIBILITY_LEVEL option of ALTER DATABASE. Pentru a rula această interogare fără modificări, vă rugăm să setaţi nivelul de compatibilitate pentru curent la 80 de baze de date, folosind opţiunea de a COMPATIBILITY_LEVEL SET ALTER baza de date. It is strongly recommended to rewrite the query using ANSI outer join operators (LEFT OUTER JOIN, RIGHT OUTER JOIN). Este recomandat să rescrie de interogare folosind ANSI exterior alătura operatori (stânga ALaTURAtI exterior, nu ALaTURAtI exterior). In the future versions In versiunile viitoare
of SQL Server, non-ANSI join operators will not be supported even in backward-compatibility modes. de SQL Server, non-ANSI alătura operatori nu va fi susţinut, chiar şi în înapoi-moduri de compatibilitate.
or, sau,
Msg 4147, Level 15, State 1, Line 3 Msg 4147, Level 15, State 1, Line 3
The query uses non-ANSI outer join operators (”*=” or “=*”). Interogarea utilizează non-ANSI exterior alătura operatorii ("*=" sau "=*"). To run this query without modification, please set the compatibility level for current database to 80 or lower, using stored procedure sp_dbcmptlevel. Pentru a rula această interogare fără modificări, vă rugăm să setaţi nivelul de compatibilitate pentru curent de baze de date la 80 sau mai mic, folosind procedura sp_dbcmptlevel stocate. It is strongly recommended to rewrite the query using ANSI outer join operators (LEFT OUTER JOIN, RIGHT OUTER JOIN). Este recomandat să rescrie de interogare folosind ANSI exterior alătura operatori (stânga ALaTURAtI exterior, nu ALaTURAtI exterior). In the future versions of SQL Server, non-ANSI join operators will not be supported even in backward-compatibility modes. In versiunile viitoare ale SQL Server, non-ANSI alătura operatori nu va fi susţinut, chiar şi în înapoi-moduri de compatibilitate.
The error happens because Microsoft has dropped support for and eliminated old-style *= and =* outer join operators. Eroarea se întâmplă, deoarece Microsoft a renuntat la suportul pentru eliminate şi vechi în stil *= şi =* exterior alătura operatori.
In order to fix the SQL Server error above, DB administrator has to set the database compatibility level to 80, which equivalent with SQL Server 2000 as a temporary workaround. Pentru a stabili SQL Server de eroare de mai sus, a DB administrator de baze de date pentru a stabili compatibilitatea la nivel de 80, care echivalente cu SQL Server 2000 ca o soluţie temporară. Of course, the best solution is to modify the SQL statements or queries code to remove the old-style join operators with current standard SQL join syntax. Desigur, cea mai bună soluţie este de a modifica SQL declaraţii sau cereri de cod pentru a elimina vechi stil alătura operatorilor cu standardul actual de SQL syntax alăture.
For example, SQL query below is not valid: De exemplu, interogare SQL de mai jos nu este valabil:
SELECT o.name FROM sys.objects o, sys.views v WHERE o.object_id *= v.object_id;
And should be replaced with the following code: Şi ar trebui să fie înlocuit cu următorul cod:
SELECT o.name FROM sys.objects o LEFT JOIN sys.views v ON o.object_id = v.object_id;
Or the following abbreviated inner join statement: Sau următoarele abreviat interior se alăture declaraţie:
SELECT o.name FROM sys.objects o, sys.views v WHERE o.object_id = v.object_id;
For administrator who can't change the code, the easiest workaround is to revert the compatibility level of the database in order to provide the backward compatibility to old-style joins. Pentru administrator care nu se pot schimba codul, cea mai uşoară soluţie este de a reveni la nivelul de compatibilitate de la baza de date, pentru a dispune de compatibilitate pentru a se alătură în stil vechi. sp_dbcmptlevel stored procedures (deprecated) or Transact-SQL can be used to set certain (partially, not all) database behaviors to be compatible with the earlier version of SQL Server. sp_dbcmptlevel procedurilor stocate (deprecated) sau la învoială-SQL poate fi utilizat pentru a stabili anumite (parţial, nu toate) comportamentele de baze de date pentru a fi compatibile cu versiunea anterioară a SQL Server. This Acesta MSDN article MSDN articol provides overview on what behaviors are changed on each compatibility level. prevede de ansamblu asupra a ceea ce comportamente sunt modificate pe fiecare nivel de compatibilitate.
Version of SQL Server that can be reverted to can be one of the following: Versiune de SQL Server, care poate fi revenit pentru a putea fi unul din urmatoarele:
60 = SQL Server 6.0 60 = SQL Server 6.0
65 = SQL Server 6.5 65 = SQL Server 6.5
70 = SQL Server 7.0 70 = SQL Server 7.0
80 = SQL Server 2000 80 = SQL Server 2000
90 = SQL Server 2005 90 = SQL Server 2005
100 = SQL Server 2008 100 = SQL Server 2008
Note: Compatibility level 60, 65, and 70 no longer available in SQL Server 2008. Notă: nivelul de compatibilitate 60, 65, şi 70 nu mai sunt disponibile în SQL Server 2008. And future version of SQL Server will support only two (2) prior version of backward compatibility. Şi viitoare versiune de SQL Server va sprijini numai două (2) înainte de versiunea de compatibilitate. A database containing an indexed view cannot be changed to a compatibility level lower than 80. O bază de date care conţine o indexate vedere nu poate fi schimbat la un nivel mai mic de compatibilitate 80. Do also take note that when a database is set to backward-compatibility mode, some of the new functionalities may be lost, such as SQL CLR support and SSMS diagrams for the database. Face de asemenea, să ia act de faptul că, atunci când o bază de date este setată la înapoi-modul de compatibilitate, unele dintre noi funcţionalităţi pot fi pierdut, cum ar fi SQL CLR SSMS scheme de sprijin şi pentru baza de date. Beside, the compatibility mode affects behaviors only for the specified database, not for the entire server. În afară, în modul de compatibilitate afectează comportamentele specificate doar pentru baza de date, nu pentru întreaga server.
Steps to Change and Set Compatibility Level of A Database in SQL Server Paşi pentru Schimbare şi la nivel de set de compatibilitate a unei baze de date în SQL Server
The following SQL commands can be issued in SQL Server Management Studio Query window. Următoarele comenzi SQL pot fi emise în SQL Server Management Studio Interogare fereastra. Remember to execute Go after each command. Amintiţi-vă pentru a executa Du-te după fiecare comandă.
- Optional: Set the database to single user access mode: Optional: set de baza de date pentru a singur utilizator Mod de acces:
ALTER DATABASE database_name SET SINGLE_USER; - Set the database compatibility level to one of the earlier version stated above: Setare baza de date la un nivel de compatibilitate de versiunea anterioară a declarat de mai sus:
Transact-SQL Method Învoială-SQL Metoda
ALTER DATABASE database_name SET COMPATIBILITY_LEVEL = { 80 | 90 | 100 }For example, De exemplu,
ALTER DATABASE my_db SET COMPATIBILITY_LEVEL = 80 ALTER DATABASE my_db SET COMPATIBILITY_LEVEL = 80
sp_dbcmptlevel Stored Procedure Method sp_dbcmptlevel stocate procedură Metoda
EXEC sp_dbcmptlevel database_name, compatibility_level value;For example, De exemplu,
EXEC sp_dbcmptlevel my_db, 90; Exec sp_dbcmptlevel my_db, 90;
- Optional: Put back the database in multiuser access mode: Optional: Puneţi înapoi în baza de date multiuser Mod de acces:
ALTER DATABASE database_name SET MULTI_USER;
IMPORTANT : The page is machine translated and provided "as is" without warranty. IMPORTANT: pagina este masina de tradus şi "ca atare", fără garanţie. Machine translation may be difficult to understand. Machine traducere poate fi dificil de înţeles. Please refer to Vă rugăm să original English article original English articol whenever possible. ori de câte ori este posibil.
Related Articles Articole
- Uninstall and Remove Multiple Database Instances of Microsoft SQL Server 2005 Uninstall şi Remove Multiple Bază de date Cazurile de Microsoft SQL Server 2005
- Microsoft DreamSpack Offers Free Download and License of Visual Studio 2008, Server 2003, SQL Server 2005 and More Microsoft DreamSpack Oferte Free Download şi de licenţă de Visual Studio 2008, Server 2003, SQL Server 2005 şi Mai mult
- Optimize SQL Server 2000, 2005 or 2008 in Large RAM System by Locking Pages in Memory and AWE Optimizaţi-SQL Server 2000, 2005 sau 2008, în mare RAM de sistem de Blocarea Pagini în memorie şi AWE
- Download Update for Windows 7 and Server 2008 R2 Beta (KB967062) to Fix Common Application Compatibility Issue Descarca Actualizare pentru Windows 7 şi Server 2008 R2 Beta (KB967062) de a stabili comună Application Compatibility Issue
- Error Has Occurred While Establishing A Connection To SQL Server 2005 Which Does Not Allow Local and Remote Connections Eroare Stabilirea În timp ce o conexiune la SQL Server 2005 care nu permite Local şi Remote Connections
- Microsoft Virtual Server 2005 R2 Download Available for Free Microsoft Virtual Server 2005 R2 Descarca disponibil gratuit
- Check System Compatibility Via Microsoft New Application Compatibility Toolkit Version 5.5 Check System Compatibility Via New Microsoft Application Compatibility Toolkit Version 5.5
- Microsoft Virtual Server 2005 R2 SP1 (Enterprise Edition) Direct Download Links Microsoft Virtual Server 2005 R2 SP1 (Enterprise Edition) Direct Download Link-uri
- Internet Explorer (IE) Hang When Opening Virtual Server 2005 Web Administration Site Internet Explorer (IE) Rezistă la deschiderea Virtual Server 2005 Web Administrare Site
- Change Oracle Database User Password Schimbarea Oracle Database Utilizator Parola









































