Getting Version of Database without convertign to SQL Server 2005
The reason is that I have to ask the user before a convert the database from SQL Server 2000 to 2005.
The reason is that I have to ask the user before a convert the database from SQL Server 2000 to 2005.
Hi,
actually I don′t know of any function for that. Never heard. Never seen. Never read. :-)
HTH, Jens K. Suessmeyer.
I have attached SQL 2000 databses to SQL 2005 without any converting. They work fine. Now if you have maintenance plans or DTS packages this requires conversion. There may be stored procs that may have issues with 2005 so you need to test. When you attach the database you may need to verify the Owner is ok (files page of the database properties) Make sure you have brought over all the logins and you may need to resync users with logins (EXEC sp_change_users_login)
HTH
Hello,
thanks for answers, but the problem is not to use the SQL2000 database in SQL2005. I have to know from which version the database file is - without any change in the database.
I tried to open the SQL2000 database with a SQL2005 Server. But the database will implicit updateted from version 539 to 611 while attaching (Converting database 'Test_DB' from version 539 to the current version 611).
I can not attaching the database (version 611) with SQL2000 Server again.
In my case we have to ask the customer before converting the database.
HTH, Jens K. Suessmeyer.
I found I way to get the Version of a database without attaching:
Dim oSQLServer
dim strDBFilename ' with comlete path
dim strSQLServer ' with comlete path
strDBFilename = "d:\test_3\test.MDF" set oSQLServer = CreateObject("SQLDMO.SQLServer2") With oSQLServer Dim result ' As QueryResults If Not result Is Nothing Then Dim i If result.GetColumnString(i, 1) = "Database version" Then if result.GetColumnLong(i, 2) = 611 then
strSQLServer = "(local)\PM"
oSQLServer.LoginTimeout = -1
.LoginSecure = True
.AutoReConnect = False
.Connect strSQLServer
Set result = .DetachedDBInfo(strDBFilename)
For i = 1 To result.Rows
txtMsg = "The Database '" & strDBFilename & "' is "
txtMsg = txtMsg & " a SQL Server 2005 database"
else
if result.GetColumnLong(i, 2) = 539 then
txtMsg = txtMsg & " a SQL Server 2000 database"
else
txtMsg = "The native version of Database '" & strDBFilename & _
"' is " & result.GetColumnLong(i, 2)
end if
end if
End If Next End If End With
MsgBox txtMsg