How to Set Compatibility Level for SQL Server 2008 or 2005 Database Kā Uzstādīt saderības līmeni SQL Server 2008 vai 2005 Database
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: Izvēloties datus vai veic query par Microosft SQL Server 2008 vai SQL Server 2005 datu bāzes, šādas kļūdas paziņojumu vai neveiksmes var ATGRIEZĀS
[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] [Ziņu 4147, Level 15, State 1, Line 4] vaicājumu izmanto ne-ANSI ārējā pievienoties uzņēmēju ("*=" vai "=*"). 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. Lai veiktu šo jautājumu, bez izmaiņām, lūdzu, iestatiet saderības līmeni pašreizējā datu bāzē līdz 80, izmantojot SET COMPATIBILITY_LEVEL iespēju ALTER datubāzē. It is strongly recommended to rewrite the query using ANSI outer join operators (LEFT OUTER JOIN, RIGHT OUTER JOIN). Ir stingri ieteicams pārrakstīt jautājumu, izmantojot ANSI ārējā pievienoties operatoriem (KREISAIS ĀRĒJAIS JOIN, tiesības ĀRĒJAIS JOIN). In the future versions Paredzams, ka turpmāk redakcijas
of SQL Server, non-ANSI join operators will not be supported even in backward-compatibility modes. no SQL Server, non-ANSI pievienoties operatoriem nebūs atbalstīja pat atpalikušajās saderību veidiem.
or, vai,
Msg 4147, Level 15, State 1, Line 3 Ziņu 4147, Level 15, State 1, Line 3
The query uses non-ANSI outer join operators (”*=” or “=*”). Vaicājuma izmanto ne-ANSI ārējā pievienoties uzņēmēju ("*=" vai "=*"). To run this query without modification, please set the compatibility level for current database to 80 or lower, using stored procedure sp_dbcmptlevel. Lai veiktu šo jautājumu, bez izmaiņām, lūdzu, iestatiet saderības līmeni pašreizējās datu bāzes uz 80 vai mazāka, izmantojot uzglabā procedūra sp_dbcmptlevel. It is strongly recommended to rewrite the query using ANSI outer join operators (LEFT OUTER JOIN, RIGHT OUTER JOIN). Ir stingri ieteicams pārrakstīt jautājumu, izmantojot ANSI ārējā pievienoties operatoriem (KREISAIS ĀRĒJAIS JOIN, tiesības ĀRĒJAIS JOIN). In the future versions of SQL Server, non-ANSI join operators will not be supported even in backward-compatibility modes. Paredzams, ka turpmāk versijām SQL Server, non-ANSI pievienoties operatoriem nebūs atbalstīja pat atpalikušajās saderību veidiem.
The error happens because Microsoft has dropped support for and eliminated old-style *= and =* outer join operators. Kļūda notiek, tāpēc, ka Microsoft ir samazinājies atbalsts un jāizskauž vecmodīgās *= un =* ārējā pievienoties operatoriem.
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. Lai noteiktu SQL Server kļūda iepriekš, DB administrators ir noteikt datu bāzē savietojamības līmenis līdz 80, kas ekvivalents ar SQL Server 2000 kā pagaidu PROFILAKSE. 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. Protams, labākais risinājums ir pārveidot SQL paziņojumus vai vaicājumu kods, lai novērstu vecmodīgās pievienoties operatoriem ar pašreizējo standarta SQL pievienoties sintaksi.
For example, SQL query below is not valid: Tā, piemēram, SQL query zemāk nav spēkā:
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: Un būtu jāaizstāj ar šādu kodu:
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: Vai pēc saīsinātā iekšējās pievienoties paziņojums:
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. Par administratoru, kuri nevar mainīt kodu, vienkāršākais PROFILAKSE ir atgriezties saderību līmeņa datu bāzes, lai nodrošinātu atgriezenisku savietojamību ar vecmodīgās pievienojas. 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 uzglabā procedūras (nosodāms) vai darījumus-SQL var izmantot, lai noteiktus (daļēji, ne visas) datu bāzes uzvedību par saderīgu ar iepriekšējo versiju, SQL Server. This Šis MSDN article MSDN article provides overview on what behaviors are changed on each compatibility level. sniedz pārskatu par to, kas uzvedību tiek mainīti katru saderība līmenī.
Version of SQL Server that can be reverted to can be one of the following: Versija SQL Server, ko var atgriezta var būt viens no šiem:
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. Piezīme: Compatibility līmenis 60, 65, un 70 vairs nav pieejams SQL Server 2008. And future version of SQL Server will support only two (2) prior version of backward compatibility. Un turpmākās versijas SQL Server atbalstīs tikai divi (2) pirms versiju atgriezenisku savietojamību. A database containing an indexed view cannot be changed to a compatibility level lower than 80. Izveido datu bāzi, kurā ir indeksēti apskatīt nevar mainīt uz saderību zemākas par 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. Vai arī ņem vērā, ka tad, ja datu bāzē tiek noteikta, lai atpakaļ saderību režīmā, dažās no jaunajām funkcijām var zaudēt, kā, piemēram, SQL CLR atbalstu un SSMS diagrammas datu bāzē. Beside, the compatibility mode affects behaviors only for the specified database, not for the entire server. Blakus, saderības režīms ietekmē uzvedību tikai paredzētajiem datu bāzes, nevis par visu serveri.
Steps to Change and Set Compatibility Level of A Database in SQL Server Pasākumus, lai pārmaiņu un Set saderības pakāpe datu bāzei SQL Server
The following SQL commands can be issued in SQL Server Management Studio Query window. Turpmāk SQL komandas var izdot SQL Server Management Studio Query logā. Remember to execute Go after each command. Neaizmirstiet izpildīt Go pēc katras komandu.
- Optional: Set the database to single user access mode: Pēc izvēles: Set datubāzes vienu lietotāju piekļuves veids:
ALTER DATABASE database_name SET SINGLE_USER; - Set the database compatibility level to one of the earlier version stated above: Izveidot datu bāzi saderība līmenis uz vienu no agrākajām versija minēts iepriekš:
Transact-SQL Method Darījumus-SQL metode
ALTER DATABASE database_name SET COMPATIBILITY_LEVEL = { 80 | 90 | 100 }For example, Piemēram,
ALTER DATABASE my_db SET COMPATIBILITY_LEVEL = 80 ALTER DATABASE my_db SET COMPATIBILITY_LEVEL = 80
sp_dbcmptlevel Stored Procedure Method sp_dbcmptlevel Stored Procedure metode
EXEC sp_dbcmptlevel database_name, compatibility_level value;For example, Piemēram,
EXEC sp_dbcmptlevel my_db, 90; Exec sp_dbcmptlevel my_db, 90;
- Optional: Put back the database in multiuser access mode: Pēc izvēles: Uzlieciet atpakaļ datu bāze multiuser piekļūt veids:
ALTER DATABASE database_name SET MULTI_USER;
IMPORTANT : The page is machine translated and provided "as is" without warranty. SVARĪGI: Šī lapa ir mašīna tulkoto un ar nosacījumu ", kas ir" bez garantijas. Machine translation may be difficult to understand. Machine translation var būt grūti saprast. Please refer to Lūdzu, skatiet original English article oriģināls angļu rakstu whenever possible. kad vien iespējams.
Related Articles Saistītie raksti
- Uninstall and Remove Multiple Database Instances of Microsoft SQL Server 2005 Uninstall un Remove Multiple Database Gadījumi Microsoft SQL Server 2005
- Microsoft DreamSpack Offers Free Download and License of Visual Studio 2008, Server 2003, SQL Server 2005 and More Microsoft DreamSpack piedāvā bezmaksas Lejupielādējiet un License par Visual Studio 2008, Server 2003, SQL Server 2005 un vairāk
- Optimize SQL Server 2000, 2005 or 2008 in Large RAM System by Locking Pages in Memory and AWE Optimizējiet SQL Server 2000, 2005 vai 2008 Large RAM sistēmai Bloķēšanai Pages atmiņa un AWE
- Download Update for Windows 7 and Server 2008 R2 Beta (KB967062) to Fix Common Application Compatibility Issue Download Update for Windows 7 un Server 2008 R2 Beta (KB967062) noteikt kopējās Application Compatibility Issue
- Error Has Occurred While Establishing A Connection To SQL Server 2005 Which Does Not Allow Local and Remote Connections Kļūda, nosakot savienojums ar SQL Server 2005, kas neļauj Local and Remote Connections
- Microsoft Virtual Server 2005 R2 Download Available for Free Microsoft Virtual Server 2005 R2 Download pieejama bez maksas
- Check System Compatibility Via Microsoft New Application Compatibility Toolkit Version 5.5 Check System Compatibility Via Microsoft New 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 Links
- Internet Explorer (IE) Hang When Opening Virtual Server 2005 Web Administration Site Internet Explorer (IE) pakārt, atverot Virtual Server 2005 Web Administration Site
- Change Oracle Database User Password Maina Oracle Database Lietotājs Parole









































