Is There A Problem Detaching A Database From SQL2000 And Attaching It To SQL2005?
Dec 5, 2007
Hi
I have to migrate a SQL2000 database to SQL2005, I tried to use CopyDatabase Wizard (CDW) but invariably stopped all processes (may be for permissions, but I really I don€™t know) so I decided to detach de database, copy files to new server and attach it to SQL2005, it apparently works well, except for the fact that Schemas where created with the name of the users of SQL2000.
Is that correct?
Could it affect the performance or any other thing?
Is correct to do what I did?
Could be another problem in the recently attached database?
(Compatibility, data loss, corrupted structures, collation or something like that)
The server I am using is in a domain, it has windows server 2003 R2 SP2
@@Vesion returns
Microsoft SQL Server 2005 - 9.00.3042.00 (Intel X86)
Feb 9 2007 22:47:07
Copyright (c) 1988-2005 Microsoft Corporation
Standard Edition on Windows NT 5.2 (Build 3790: Service Pack 2)
And in the source server with windows 2000 SP4
@@Vesion returns
Microsoft SQL Server 2000 - 8.00.194 (Intel X86)
Aug 6 2000 00:57:48
Copyright (c) 1988-2000 Microsoft Corporation
Enterprise Edition on Windows NT 5.0 (Build 2195: Service Pack 4)
Can anyone tell me why my SQL2000 database has grown aprox 15 % and my Log file 20,000 % when I attach it to SQL2005 .I've Thousands of Databases to Upgrade, but with the log file increasing to more than the size of the Database Its going to be a struggle !
It also takes a fair ammount of time to attach,
I suspect there is some reindexing going on , as when I try to reattach to SQL 2000 I get index errors ?
Is the re anything I can do in advance to reduce the database growth ?
I know I can truncate the log afterward but the peak diskspace consumed during my Migration may be an issue !
Q1.)In SQL Server 2000, is it always possible to use copies of thedata and transaction log files of a database from one server toreattach to a new database on another server, or even to the sameserver, without first detaching from the existing database?Books Online says that detaching a database closes the data and logfiles cleanly. I read some where that some times, it is possible toattach without detaching, if the data and log file are in stablestate.This is what I tried - Tried to copy Northwind.mdf and ldf files usingwindows explorer and it gave an error message that the files are inuse. I shutdown the server and now I could easily copy them. Afterthat I renamed these files and successfully attached them as a newdatabase.Q2.)Is it possible to do the same with large production databases?Q3.) Please explain what goes on during detaching /attaching process.Thanks in advanceRavi
I am working with an asp.net project in Visual Web Developer 2005 Express. This is a starter kit project. There is a database that came with the project that I want to open up in the SQL Server 2005 Express management studio so that I can modify it.
I have detached the db in the VWD environment.But, I do not see this db in the db folder with in the SQL Server studio's IDE. I am assuming that I have to attach the database to the SQL Server management studio in order to work with it. Is this the correct way to do this type of thing? Is there a better way of doing it(a stored proc like mentioned below)?
I also have a question about the icons that pertain to this situation. I have noticed two variations of the same icon. I want to be sure I am interpretting these correctly. I am assuming that the icon that is a cylinder representing a db with the little electrical plug coming out from behind it means that the db is attached. There is another version of this icon that has a red "x" over the plug. I am assuming that this means it is detached. Is this correct?
I have attached and detached dbs in Sql Server Express. Is the process the same for doing this with a project in Visual Web Developer? Is there a stored proc that I can use to detach from the SQL Server 2005 environment after I have made a database and attach this to my project in VWD in one step?
I've been using my DotNetNuke database for weeks on my local PC with SQL Server Express. It attaches as a "User Instance". Basically, I am using all the DotNetNuke defaults. Today I decided to attach the DotNetNuke database in SQL Server Management Studio Express and peek at the tables. I attached the database; then I detached it when I was done. This all went well. But when I tried to open my DotNetNuke web site again I now get a message that it cannot connect. Attaching and detaching the database in SQL Server Management Studio obviously changed something about the database, but I don't know what. My connection string to the database has not changed.
The specific error displayed in the browser is: ERROR: Could not connect to database specified in connectionString for SqlDataProvider
In event viewer is this message:
Exception information:
Exception type: SqlException
Exception message: Cannot open user default database. Login failed.
Login failed for user 'NT AUTHORITYNETWORK SERVICE'.
Hi, Im not new to SQL Server but I am new to v.2005. We have done a class project and to finish up I am creating schemas, logins and different user roles and permissions. I now need to detach the DB and send it to our team leader for submission. I'm scared to do this because I don't know if all the logins and passwords I've created will appear in it's new location. Will they be there in the new server's security folder just as I created them or will they dissapear into the ether? Signed: Sweating very much
It is better to be prepared and not have an opportunity than to not be prepared and have an opportunity
I am currently having a problem in the implementation of a Database for my C#.net winform application.
Look at the 2 diagrams below:
Diagram 1 : A typical databse design where it usees only 1 mdf file.
Diagram 2: A new proposed approach to implement the Database with multiple mdf files of the same schema!!
In the new proposal of the DB, each mdf files is kept separately and an additional module is required to attach and detach these databases as and when required. The purpose: the performance of all actions on the small data is not affected by the size of the large data
How does this 2 methods measure up in terms of resource usage, performance, etc??
I wanted to to detach a DB say MyDB from MSDE and wanted to attach it to SQL Express. It could able to Detach the DB from MSDE,but attachment to SQL 2005 is failing. When I verified MSDE Instance through Managment studio "MyDB" wasnot there ; means it got detached.I couldnt find the DB in SQL 2005. When I tried manually through command prompt I was able to attach "MyDB" to SQL2005. Please help me out!! Here is the code which I have written.
if SUCCEEDED(hr = CoCreateInstance (CLSID_SQLDMOServer, NULL, CLSCTX_INPROC_SERVER, IID_ISQLDMOServer, (LPVOID*)&pSQLServer)) {
pSQLServer->SetLoginSecure (TRUE); SQLDMO_LPCSTR DB = OLESTR("MyDB"); //Connect to MSDE First if SUCCEEDED(hr = pSQLServer->Connect (szDbServer, szUserName, szPassword)) {
pSQLServer->DetachDB(DB,lpszResult); //Detach the DB pSQLServer->DisConnect(); //Disconnect MSDE LPBSTR lpszResult2 = NULL; long lNumDB; //Connect to SQL 2005 if SUCCEEDED(hr = pSQLServer->Connect (szSQLExpDbServer, szUserName, szPassword)) { //LPCOLESTR lpo = A2COLE(sTemp); //sTemp.operator LPCTSTR pSQLServer->GetDatabaseCount (&lNumDB); SQLDMO_LPCSTR files = OLESTR("C:\Program Files\Microsoft SQL Server\MSSQLData\MyDB.mdf,C:\Program Files\Microsoft SQL Server\MSSQL\Data\MyDB_log.ldf"); pSQLServer->AttachDB(DB,files,lpszResult2); // Attach the DB to SQL 2005
I have SQL Express 2005 SP2 installed in my Vista Home Premium. I am using SQL Server Management Studio Express to manage .mdf.
When I click "Add..." to attach .mdf database, I have this prompt error message :
The server principal "My-PCMyName" is not able to access the database "model" under the current security context. (Microsoft SQL Server, Error: 916)
I have elevated the rights, "Run as administrator", of my SQL Server Management Studio Express, but still having problem.
I also encounter security error when detaching the existing .mdf : The EXECUTE permission was denied on the object 'sp_detach_db', database 'mssqlsystemresource', schema 'sys'. (Microsoft SQL Server, Error: 229)
We replicate a SQL2000 database (DataBaseA) to a SQL2000 database (DataBaseB) by using the Restore function and hasn't change its logical name but only the physical data path and file name. It is running fine for a year. We use the same way to migrate the DataBaseB to a new SQL2005 server with the Restore function and the daily operation is running perfect. However, when we do the Backup of DatabaseB in the SQL2005, it just prompt the error message
System.Data.SqlClient.SqlError: The backup of full-text catalog 'DataBaseA' is not permitted because it is not online. Check errorlog file for the reason that full-text catalog became offline and bring it online. Or BACKUP can be performed by using the FILEGROUP or FILE clauses to restrict the selection to include only online data. (Microsoft.SqlServer.Smo)
Please note we left the DataBaseA in the old SQL2000 server.
Please help on how we can delete the Full-text catalog from DatabaseB so we can do a backup
I am planning to move the sql server 2000 database to the sql server 2005 database. I have to restore that by using the back up copy. Do I need to follow any special instructions or just like moving from one server to another. Could some body help with this. Thanks!
I have a medical records system, SoapWare v4.90, that uses MSDE (SQL2000) databases. Due to the 2gb limitation, I am trying to migrate over to SQL 2005 (Standard or Express) which I have heard works fine. The SoapWare has a datamanager that allows me to log in to the MSDE instance, detach the SoapWare databases from msde (as well as do backups, etc) which I can confirm are detached.
Then I log back into a SQL2005 database instance using the datamanager and try to attach the database. This is what their pictured instructions demonstrate. However, I get the following error:
Database 'sw_charts' cannot be upgraded because it is read-only or has read-only files. Make the database or files writeable, and rerun recovery.
Of course, some of the entries will be read only, since doctors have to sign off the charts and are not allowed to subsequently change them. But I should still be able to switch over to sql 2005?!?!?!?
Or... is there a way to attach the databases to SQLExpress manually?
If I restore a SQL 2000 DB into 2005 it upgrades it for me. When restoring a DB to a new server/instance of SQL, in SQL 2000 I had to carry out the sp_changedbowner procedure after the restore was complete. Is the equivalent procedure when restoring a SQL 2000 DB to 2005 to go to the schema for the restored database, find the schema with the name of the SQL 2000 db owner and change the schema owner? OR alternatively run the following query where mark is the db owner in 2000 and lladmin in the new user in 2005 ;
I just upgraded my SQL 2000 server to SQL2005. I forked out all that money, and now it takes 4~5 seconds for a webpage to load. You can see for yourself. It's pathetic. When I ran SQL2000, i was getting instant results on any webpage. I can't find any tool to optimize the tables or databases. And when I used caused SQL Server to use 100% cpu and 500+MB of ram. I can't have this.Can anyone give me some tips as to why SQL 2005 is so slow?
i have sql2000 & sql2005 on the same machine. I am unable to register my localhost in sql2000, get an access denied error. How can I make my localhost use sql2000 database?
I have two SQL servers setup; A - SQL 2005, and B - SQL 2000.
I would like to create an account on Server A which has access to the results from one view via a linked server on Server B. I don't want the user on Server A to be able to access any databases, tables or even columns on Server B with the exception of those contained within this view.
Is this possible, and how would I go about doing it? (Permission-wise)
I have just loaded SQL2005(server only)on my production box. This box also is running SQL2000. When I install the SQL2005 SP2 it says that if services are locked they will cause a reboot. I stop all the SQL 2005 services but it also want to stop SQL2000 Server for "backward compatiblilty". I thought installing a separate instance of SQL2005 would not have any effect on my SQL2000 instance. Thanks for your help R/P
I have an odd problem with sql 2005. I'm a long time sql 2000 user trying to migrate to 2005. My company uses CSVs to import data from our clients db into our SQL db. In 2000 I just create a txt source and pick whichever CSV and transform to a temp sql table. This has always worked just fine with no problems.
So we have a new server with sql 2005 installed. I go through the "migrate dts 2000" wizard and pull in all my DTSs from sql 2000. The first thing I see that needs to be fixed is "connection 1" which is my CSV connection manager along with the flat file source.
I went through both the connection and the flat file source and tried to copy exactly what I do in sql 2000. When I preview the data or even execute this package I get bad data.
Here is what my CSV looks like: "ACCT ","ACCOUNT DESCRIPTION ","ACCT TYPE","SCH NO","SC" "9999Z","Balance By Source Offset",9 "87B","UTILITIES(NOT PHONE)U-C",7 72,"ADM-LEGAL/AUDIT/COLL EXP",7 315,"SALES TAX - VEHICLES LOCAL 1",3 "90A","INTEREST(NON FPLAN/MORT)/N-C",7 73,"MEALS & ENTERTAINMENT-ALL",7 "210A","REBATES RECEIVABLE",2,17,4 "5A@","# OF EXT WARR SALES-UC",10 "51N","N/C-VEHICLE INV MAINTENANCE",7 "87D","UTILITIES(NOT PHONE)SVC",7 "90B","INTEREST(NON FPLAN/MORT)U-C",7 317,"ACCRUED OTHER",3,75,4
This is what it looks like when I preview it inside the flat file connection manager: ACCT ACCT DESC ACCT TYPE SCH NO SCTYPE 9999z blance by source... 9– – "87B" UTILITIES(NO... 7
So it is basically putting two rows of csv data into one row of SQL data. Now I realize my CSV isn't in the correct format because it doesn't have the extra commas at the end of a row IF the columns are null. It seems that 2005 doesn't recognize the carriage return/line feed. It puts the actual ascii characters in the preview. Once I execute the package it changes the ascii characters into blank spaces. My big issue is, why did this work just fine in 2000 but I can't get clean data in 2005? I'm completely clueless now, I have no idea where to go with this. Its impossible to change the output of the CSVs I get. There is literally no other options. I kinda get what I get with them. Why is this happening?
I have installed MSDE2000 (name: mypcsql2000, port 1433) and sql2005 Express (mypcsql2005, port 1434) on my WinXP. I'm developing some application and I need to test both server.
It has worked fine about 1 year, but last month i got error message.
When i'm trying to connect to SQL2005 from my application or import data from Excel, i get error message: [DBNETLIB][ConnectionOpen (Invalid Connection()).]Invalid connection.
I can access SQL2005 with Management Studio or cmd line (sqlcmd). But not with Excel (or with my application).
MSDE2000 works fine, i haven't any problems.
Last weekend I have reinstalled my WinXP and also MSDE2000, SQL2005 Express. Worked fine, but when turn on automatic updates ON and afterwards installed latest updates, the problem is here again...
Is there any difficulties I should be aware of? I'm not running DTS and I think my DB is relatively simple. I've googled and not found anything that sticks out as a problem.
We are getting a new server because we want more RAM, and better upgrade options. The hosting company recommended 64bit SQL, so I am thinking of following their recommendations.
I am upgrading from a 2 x p4 2.8ghz xeons to 1 x Intel 5130 dual core 64 bit chip. I also will be going from 2 gigs to 4 gigs of RAM.
I have a distributor setup on SQL Server 2005 (9.0.3042) and am trying to create a publication on SQL Server 2000 (8.0.2040) which receives the following error in my production environment:
Msg 8526, Level 16, State 2, Procedure sp_addpublication, Line 802
Cannot go remote while the session is enlisted in a distributed transaction that has an active savepoint.
The interesting part of this equation is that I was able to get this to work without error in my DEV (development) environment and well as my QAT (test) environment. This end result was that my distributor was SQL 2005, my publisher was SQL 2000 and my pull subscriber was SQL 2005. I have been diligently comparing our production environment to my other environment and have yet to find differences.
Has anyone else seen an error similiar to this? Any insight would be appreciated.
I need to install SQL2000 onto a machine (W2K3 R2, SP2) that already has SQL2005, SP1 running. I can't disturb the SQL2005 installation.
Are there any problems or pitfalls to avoid? I've googled and looked on Technet but not yet found an answer.
Has anyone done this?
I know that if I install a separate instance of SQL2000 alongside a default installation of SQL2000 then I'll get a totally separate installation which won't affect the other one at all, so I reckon it could be done. But I have to be sure before I start!
We have two systems, one working on SQL2000 and other working on SQL2005. In SQL2000, there is JOB which needs to execute a JOB in SQL2005, get feedback based (success or failure) and proceed accordingly.
I am not sure the best practice to call SQL2005 job from SQL2000 job. Both the server's run undersame domain account.
Restoring a DB from sql 2005 (which is located on my local computer) into sql 2000 (which is located on the server) and I am getting this type of message:
TITLE: Microsoft SQL Server Enterprise Edition ------------------------------
An exception occurred while executing a Transact-SQL statement or batch. (Microsoft.SqlServer.ConnectionInfo)
Too many backup devices specified for backup or restore; only 64 are allowed. RESTORE HEADERONLY is terminating abnormally. (Microsoft SQL Server, Error: 3205)
I'm running a VB6 app with MDAC 2.8 on Windows Server 2003 SP1. I create an ADO recordset with a SELECT statement which returns an empty recordset. I then add 2 new records to it with AddNew and later perform an UpdateBatch. Before the SQL upgrade it worked fine but now errors with: 'Cannot convert a char value to money. The char value has incorrect syntax.' I did a SQL Trace to find out what the Updatebatch was actualling sending to SQL (listed below). This works fine when I run it on Query Analyser using SQL 2000 but fails on SQL 2005. I worked out the problem is linked to the columns NewValue and OldValue both are varchar 70. The first insert has them defined varchar(7) and varchar(1). This insert succeeds, but the second insert has the columns defined as varchar(18) and varchar(12). This one fails (unless they only contains numbers!). I'm confused. I've read that sp_executesql has changed for SQL2005. Any ideas anyone?
I want to replicate from SQL2000 to SQL2005. I had configured distributor, publisher in SQL2000 and also subscriber in SQL2005. But so far no replication was done on SQL2005. I wonder SQL2000 (SP2) and SQL2005 replication will it work? Is it true that I should install Service Pack 3 and above in order to replicate my database to SQL2005.
Linked server from SQL2005 to SQL2000 Hi I use the following SQL statements to create a link server. RemoteServerName is an SQL2000 and I am executing this in another machine which is SQL2005.
Though the link server is created successfully, I am not able to se the tables under it so could not query anything.