SQL-Transact Compatibility Between 2K And 2008

Feb 28, 2008

Hi there!

Our application currently uses SQL Server 2000 as a DB manager and we have over 200 clients which have different versions, either Standard or MSDE. We now wish to start using SQL Server 2005 or 2008 without necessarily forcing existing clients to upgrade. Of course, this would only be possible if SQL Server 2005 is compatible with the code in our application which is "Transact-SQL 2000" (if I can call it that way). Are there any difference between Transact-SQL statements in 2000, 2005 and 2008? If so, where could I find a comparative reference?

Thanks!


Mike

View 1 Replies


ADVERTISEMENT

Transact SQL :: Script To Set DB Compatibility To Match Version On That Instance?

May 22, 2015

We have an app that supports any version of sql beyond 2008.  What we are finding is that users are upgrading to new versions of sql and just restoring their db on the new version of sql and not changing the compatibility level.  I would like a script that would change the db's compatibility level to match whatever version of sql that they are using.

ALTER DATABASE db_name
SET COMPATIBILITY_LEVEL = (SELECT TOP 1 compatibility_level 
  FROM sys.databases
  WHERE name = 'master')

View 3 Replies View Related

Transact SQL :: Running Total In Server 2008

Nov 20, 2015

Is it possible to assign to a variable, then add to it later on?  When I run the below, all I get is 3 rows affected I never see the value printed.  What i am wanting to do is each loop sum the numbers so 2+1+3 =6 so in the end @sumofallnumbers
= 6
Create Table #Test ( randarnumbers int )
Insert Into #Test Values ('2'), ('1'), ('3')
Declare @sumofallnumbers int, @nbr int
Declare c1 Cursor For
Select randarnumbers
FROM #Test

[code]..

View 6 Replies View Related

Transact SQL :: How To Transfer Tables From One To Another File Group In 2008

Jan 17, 2012

I have few issues regarding the transfer of the tables from one file group to another file group  in SQL 2008 and also How can we  backup and restore the particular database based on file group level.

Let’s say I have a tables stored within the different FG. such as

Tables                                                    
                                                                         
File group Dimension tables             Primary Fact tables                                               
FG1 ...                                                
FG2…
zzz_tables                                                DEFAULT_FG    
dim.table1                                                                                                                          DEFAULT_FG
dim.table2                                                                                                                          DEFAULT_FG
…                                                                                                                                             ….

Here all I want to transfer the dim.table1 ,dim.table2  from  DEFAULT_FG to the Primary File group .So is there simple methods for transfer the dim.table1,2  from one FG to another .I have tried somewhat but I couldn’t get the exact way.Secondly after moving those dim.table1 ,dim.table2 from DEFAULT_FG to Primary ,All I want to backup and restore the database only containing  the Primary and FG1,FG2… not a DEFAULT_FG.Is it possible or not.?

View 15 Replies View Related

Transact SQL :: Making Hours Into Months And Days In 2008 R2?

Aug 5, 2015

I have hours which can be like 32.5 and would like to have them in 1 month 2 Days format.

View 2 Replies View Related

Transact SQL :: Importing Bulk Excel Files Into A Table In 2008?

Nov 2, 2015

I have around 100 XL Files in a folder ,i want to import all the files dynamically and load all the data in a single table in sql server 2008. Without using SSIS i want to query using openrowset.

View 11 Replies View Related

Transact SQL :: Index Maintenance / Defrag Fails On CDC Enabled Database - 2008 R2

Oct 18, 2012

We have a new database with cdc enabled on all of its tables.  This causes the index maintenance task to fail with following message:

"Executing the query "EXEC DBName.dbo.IndexDefrag_sp" failed with the following error:  "The unique index 'PK_TableName' on source table '[dbo].[TableName]' is used by Change Data Capture.  To alter or drop the index, you must first disable Change Data Capture on the table.  The transaction ended in the trigger. The batch has been aborted.".  Possible failure reasons: Problems with the query, "ResultSet" property not set correctly, parameters not set correctly, or connection not established correctly" We would like to run the index maintenance without losing the cdc data.  We plan on installing SP2 on SQL Server 2008 R2 soon, would that solve the issue?  Disabling the cdc prior to index maintenance and then re-enabling back upon completion; would delete the data as I found in most discussions, but we would like to retain it. 

View 4 Replies View Related

SQL 7.0/2k Compatibility

Mar 18, 2002

Is it possible to backup databases from a 7.0 box and restore them to as MSSQL 2k box? My question really is this: Does it matter what type of MSSQL server your database resides on or can a dump be created of a database, restored to a different version MSSQL server, and used interchangeably?

View 1 Replies View Related

.mdf Compatibility

Oct 29, 2007

Can CE open .mdf files??

View 1 Replies View Related

Edition Compatibility

Oct 25, 2005

Hi all,I am under the impression that one can not Log Ship from enterprise edition to standard edition. Anyone have any documentation they can point me to?TIA,SQLPoet

View 3 Replies View Related

SQL Backward Compatibility?

Apr 26, 2007

I get the impression that osql (or somewhere in the sql processing) precompiles the entire script before it executes anything. In particular, this is a problem because it means you can't use IF statements to bracket new features in a script designed to be run on both old and new versions of SQL Server. I'm trying to handle an issue whereby I need to use "CREATE LOGIN" on SQL Server 2005 because I need to set CHECK_POLICY = OFF, and you can't do that with sp_addlogin. However, on SQL Server 2000, while I can't use CREATE LOGIN, I don't need to because the default password policy is such that the password being used does not fail without it (as it does in SQL Server 2005, and is why we need to set CHECK_POLICY), so I can simply use sp_addlogin to create the user w/o a CHEC_POLICY setting.

It appears however, due to the way that SQL is processed, it is impossible to create an SQL script of this nature that will work under both SQL Server 2000 and SQL Server 2005. I added code to check the Product Version, and can successfully bracket the code necessary with IF statements, but even though the IF statement would cause the CREATE LOGIN code to not be executed on SQL Server 2000, it errors anyway apparently because it is preparsing the script and of course, SQL Server 2000 doesn't have CREATE LOGIN. Consequently, checking Product Version is useless in this case. It looks like we'll have to do the version check outside of SQL and invoke script A for SQL Server 2000 and script B for SQL Server 2005.

Unless that is, I misunderstand the error I get from SQL Server 2000, or if there's some other way to compatibly do such a conditional. Here's an example script that runs fine under SQL Server 2005:

---------------
declare @ProductVersion as integer
set @ProductVersion = cast(left(cast(serverproperty('productversion')
as varchar(30)),1) as integer)

print 'Product Version = ' + cast(@ProductVersion as char)

IF @ProductVersion < 9 exec sp_addlogin 'testuser', 'fubar', 'master'
IF @ProductVersion > 8
BEGIN
CREATE LOGIN testuser WITH PASSWORD = 'fubar',
CHECK_POLICY = OFF, DEFAULT_DATABASE = [master]
END
----------------

On SQL Server 2000, @ProductVersion gets set to 8, but I get the following error:

Msg 170, Level 15, State 1, Server TESTSVR, Line 10
Line 10: Incorrect syntax near 'LOGIN'.


Any thoughts?


--

Sync



--

Sync

View 1 Replies View Related

Compatibility Level

Oct 24, 2007

Hi Gurus,

I would like to know if I put the Compatibility Level in a SQL Server 2005 installation to 70 I can make afirmation that I have a full SQL Server 7.0. If the answer is "Yes" where I can find a documentation or a FAQ that explained this topic.

View 2 Replies View Related

Compatibility Level

Dec 7, 2007

Has anyone changed compatibility level from 80 to 90? Did you have any problems?

View 8 Replies View Related

Compatibility Level From 80 To 90

Feb 3, 2008

I restored the database from SQL server 2000 to 2005.The database was restored with 80 compatibility.Can i change it to 90 and what are the effects? Coz my applications are pulling data from SQL server 2000. Does 80 work for database mirroring?

View 5 Replies View Related

Compatibility Level

Feb 13, 2008

Hi there

We found interesting issue which is basically the app is being tested ok on SQL2005 by software vendor. Then we tested in our environment and we found it's not truly true. There are some compatibility issue on SQL syntax. Anyway ... the plan set the compatibility level back to 80 instead 90. Cause this thing for sure is working.

Now my question is do you know any other impacts that you know of if we are doing this setting (running SQLServer 2005 but the database set as 80)? I know that some inbuilt reporting only run 90 level but I can get around this. Performance or something? Is there any thing that I should to know?

Thanks

View 1 Replies View Related

Compatibility Parameter

Mar 14, 2008

Is there a function / SP which gives ONLY the current compatibility setting of a DB.

I know sp_helpdb can do that; but sp_helpdb returns lot more information. I need this to create a script.





------------------------
I think, therefore I am - Rene Descartes

View 2 Replies View Related

Limitations, Compatibility

Nov 29, 2006

Hi,
What are the limitations of using the automated conversion tool and how to deal with compatability issues?
Thanks

View 2 Replies View Related

CE Compatibility With ADO.NET And Orcas

Jan 25, 2007

Does SQL Server Compact Edition fully support ADO.NET?

Will SQL Server Compact Edition fully support the ADO.NET Entity Framework?

Will SQL Server Compact Edition fully support LINQ?

View 1 Replies View Related

Performance Hit Using Compatibility?

Nov 20, 2006

To your knowledge, is there any performance hit with SQL 2005 when you set a database to a lower compatibility mode. IE from 9.0 to 7.0

View 1 Replies View Related

Compatibility Issues?

Oct 8, 2007

Hi there,

Correct me please if I'm wrong but one should not get any issues while restoring a database backup from a sql 2005 development edition to an enteprise edition or even from a sql express edition to whatever else?

I was under the impression that a sql 2005 database, no matter what edition, would work on all the other 2005 server editions/versions and hence, the backups from these databases should also work on the others.

Regards
Mike

View 4 Replies View Related

Help With Join Compatibility

Aug 14, 2006

I was hoping someone could help me or put me on the right path to re-writing the join portion of this sql query in ANSI form for compatibility level 90. Im just not sure how to handle the three join statements and if they should go at the top in the FROM statement (dont know if that would mess up the rows produced). The query exists inside a stored proc.

SELECT
S.TYPE,
S.LOCATION_TYPE,
S.LOCATION_ID,
S.PLANNED_ARRIVAL,
S.PROJECTED_ARRIVAL,
S.ACTUAL_ARRIVAL,
S.PLANNED_DEPARTURE,
S.PROJECTED_DEPARTURE,
S.ACTUAL_DEPARTURE
FROM TAB1 S, TAB2 RL, TAB LS
WHERE
S.LOAD_ID = @V_CURRENTLOADID AND
(RL.REGION_ID = @REGION_ID AND
RL.ROUTE_DATE = @ROUTE_DATE AND
RL.ROUTE_ID = @ROUTE_ID) AND
(S.REGION_ID = RL.REGION_ID AND
S.ROUTE_DATE = RL.ROUTE_DATE AND
S.ROUTE_ID = RL.ROUTE_ID) AND
(S.LOCATION_ID =* LS.LOAD_LOCATION_ID AND

S.LOAD_ID =* LS.LOAD_ID AND
S.LOAD_STOP_ID =* LS.LOAD_STOP_ID)
ORDER BY RL.SEQ_NUM, S.ACTUAL_SEQUENCE_NUM;

Any help would be greatly appreciated

View 8 Replies View Related

Compatibility Question

May 25, 2006

just a question....

my web project is using SQL Express2005 and ASP.NET and C#.
my
web hosting company only have MSsql2000. would there be any conflict
with regards to my database? im sorry if i sound dumb. im a newbie to
this.

thanks a lot!

View 9 Replies View Related

Compatibility With SQL 2000

Dec 20, 2006

I have moved a database from SQL 2000 to SQL 2005 Express. I have modified the structure in 2005 Management Studio Express.

Now I cannot attach to the modified dataabse in SQL 2000 Enterprise Manager. I get "Error 602: Could not find row in sysindexes for database ID.... Run DBCC CHECKTABLE on sysindexes".

This occurs despite the fact that I have kept the database at Compatibiluty Level SQL Server 2000, as reported in 2005 Management Studio Express.

Are 2005 and 2000 databases not compatible?

Many thanks.







View 4 Replies View Related

Compatibility Of SQL 2000

Sep 25, 2006

I find that the "Create Table" script generated by SQL Server 2005 is in format:

CREATE TABLE [dbo].[City](
[CityID] [int] IDENTITY(1,1) NOT NULL,
[Name] [nvarchar](50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
CONSTRAINT [PK_City] PRIMARY KEY CLUSTERED
(
[CityID] ASC
)WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]

Can this appliable in SQL Server 2000 or MSDE? If not, how should I change it to make it work in both SQL 2000 and 2005?

Thanks

View 1 Replies View Related

SQL 2005 And ADO.NET 1.1 Compatibility

Aug 9, 2006

we have applications currently talking to a sql 2000 DB via ado.net 1.1. will we have any problems if we upgrade to sql 2005, will the app have to be modified.

View 3 Replies View Related

Compatibility Level

Jul 26, 2006

Having moved over to SQL 2k5, from SQL 7.0 we have now realised that the database's need to be set to comp level 9.0 before they are found in the maintence plan wizard, we currently still access the database using an Access 2000 front end, by changing the comp level will this cause us issues writing data, I'm sure it won't but want to make sure, I'm sure that the comp level just sets what options are available to use.

Thanks

View 1 Replies View Related

Compatibility Of SQL 2000

Sep 25, 2006

I find that the "Create Table" script generated by SQL Server 2005 is in format:

CREATE TABLE [dbo].[City](
[CityID] [int] IDENTITY(1,1) NOT NULL,
[Name] [nvarchar](50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
CONSTRAINT [PK_City] PRIMARY KEY CLUSTERED
(
[CityID] ASC
)WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]

Can this appliable in SQL Server 2000 or MSDE? If not, how should I change it to make it work in both SQL 2000 and 2005?

Thanks

View 8 Replies View Related

SQL 2005 Compatibility

Jul 27, 2006

Hi,

i'm using a query to insert a value in a field named 'From' in a table.

i used like

Insert in to myTable ([from]) values('01/01/2005')



The query was working in sql 2000. but in sql 2005, i'm getting a error like

'Syntax error near 'From'.

what could be the reason for this???



View 3 Replies View Related

Compatibility Between Sql Express And MSDE

Jan 11, 2007

I need to know if I will run into problems with sql express on a sql 2000 server. I get the impression that my isp is using 200 server just by lookng at the connection string. Is there a addin I could use if needed I seen a post mentioning the publishing wizard cpt but not much after is it released yet. and then there is the web data admnistrator for msde will that work with sql express.One other question can I reinstall sql and change the authentication process from windows to user name and password.
 
DKB

View 2 Replies View Related

Urgent! Compatibility Level

Nov 27, 2001

We upgraded from SQL 6.5 to 2000 (.384) and just look at this T-SQL and maybe somebody can tell me what's wrong.

sp_dbcmptlevel appetserv1,80

update articleentrepot set usagermodification = 'MANON' where idarticle = 1

Here is the result:
Cannot use the column prefix 'E'. This must match the object in the UPDATE clause 'ArticleEntrepot'.

When I put the compatibility level to 65, it's works. But my problem is that I need to have the compatibility level to 80 because of the DataMirror replication software and if I do that, my house application doesn't work. I really don't know what to do, I'm in a deadlock. Can you help me!
Manon Tremblay

View 2 Replies View Related

Backward Compatibility Details

Jul 14, 1999

Does anyone know if the enhanced data types (character length up to 8,000 bytes for some types) and the increase in the number of tables used in joins are available when using the 65 backward compatibility mode?

Many thanks in advance...

View 1 Replies View Related

6.5 Compatibility Mode: How Good Is It?

Jul 16, 1999

We have some users who are nervous about our upgrading to SQL Server 7.0 even though we will use 6.5 compatibility mode initially while we work through 7.0 upgrade issues in the applications.

Has anyone had bad experiences with the 6.5 compatibility mode feature? Just how good is it?

Cheers

Matt

View 3 Replies View Related

Database Compatibility Level

Feb 20, 2001

Hi!
After upgrading SQL Server from 6.5 to 7.0 my production database compatibility level is "65".
I checked that by executing sp_dbcmptlevel <database_name>.
I can change it to "70" but my question is how it's going to affect the application and do I have to change it?

Thank you

Lena

View 2 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved