Attaching Database Without Ldf File?
Jul 24, 2007Hi all,
I have deleted the .ldf file now i am having only the .mdf file. Is it possible to attach the database without shutdown the sql server.
Thanks.
Hi all,
I have deleted the .ldf file now i am having only the .mdf file. Is it possible to attach the database without shutdown the sql server.
Thanks.
there was a failure due to power shutdown,and the .mdf and .ldf files on the DB is not longer available. there is a backup done 5days ago with the title nice_cls.BAK. How do i restore or reattach the .bak file on the NICE-CLS database.
View 10 Replies View RelatedHiis it possible to attach a database when a log file is missing?My database had one .MDF file and 2 .LDFs. I lost one of the .LDFs. Is itpossible to recover any data?Tegie
View 1 Replies View RelatedHello
Please can anyone help me
I've been given a .mdf file from sql server 2000 which i need to attach but we do not have the .ldf file
I am unable to recover the old .ldf file
I have tried the attach single file command but obvioulsy this still looks for the old .ldf file path which no longer exists
any help would be mostly appriciated
many thanks
Martin
I had taken back up on employee from my office. Office server name is UMASHANKAR. My server name is XYZ. I had attached that back up file BY RIGHT CLICKING :: SERVICE OBJECT-->BACKUP DEVICES-->NEW BACK UP DEVICE.Now i create database of EMPLOYEE my server XYZ. I had tried to restore EMPLOYEE back file by right clicking EMPLOYEE database-->TASKS-->RESTORE-->FILE OR FILEGROUP-->To Database: EmployeeSource of Restore:From Device: Employee.bak(I had selected from file by browsing)i had selected recent back up.But server name in back up is UmashankarMy server name is XYZwhen i am clicking ok then i am getting this error.Restore failed for Server 'XYZ'.(Microsoft.SqlServer.Smo)Additional information:|--> An exception occured while executing a Transact-SQL statement or batch. | --> The media set has 2 media families but only 1 are provided. All members must be provided. All members must be provided. RESTORE DATABASE is terminating abnormally. (Microsoft SQL Server, Error: 3132)Plz solve this problem. I need it urgently
View 6 Replies View RelatedHello,
if i have a given database (a model) and i want to copy this database in the same database instance. Is it ok to copy the mdf and ldf file and attach the files with a new database name in the same instance.
Or is the datebase name part of the .mdf file?
Regards
Markus
hi !!
I want to attach database to SQL Server, but I'hv only .mdf file.
I lost .ldf file, how should i attach this DB to server ?
Thanks
SP
Hi guys,
we lost a drive that was holding our log files for a database. I have the .mdf file from the database. So I'm trying to attach the database using just the mdf file but it fails because its still looking for the log file.
How do i work around this?
Bit of a SQL newbie, having taken over a support role for a piece of software that my firm sells. It is basically a DB that runs on MSDE or SQL Server in either desktop or enterprise scenarios.
We do sell our software to clients who may or may not already have SQL on their machines. During installation, it searches for sqlservr.exe for existing SQL installations and if it finds nothing, will then install MSDE 1.0 to house the db files.
My question is this -
I can manually create a db or manually attach an existing db through sql query analyser where there is a full-blown SQL installation. Is there any way I can do the same where there is only MSDE installed? The simple solution, I guess, would be to download one of the freeware or shareware MSDE "Enterprise Managers", but this won't always be suitable for a client installation.
Many thanks for your assistance all.
:cool:
Hi there,
I'm trying to attach a DB using a single MDF file. The file was not properly detached as our server had crashed suddenly neither was the a proper backup done..When I try to attach it says
"the file you've specified is not a valid sql server database file" . But another database was restored using a MDF file without any problems ?
Please do get back if anyone may get what the problem likely is ? It'd be of great help. Let me know if my problem was clear or if I've to put it in a different fashion.
Cheers
Ganesh
Attemping to reattach a recovered .mdf and associated .ldf from a crashed disk drive and I am getting the error below. I attempted to create a new db, stop the service, replace the new data files with the recovered db files and restarted the SQL service so that I could run a dbcc checkdb while the db was in suspect mode, however was unable to do this. This error leads me to belive that the log file needs to be rebuild, but that the mdf files could be a decent shape. Any help would be apprecaited. Thanks!
===================================
Attach database failed for Server 'AUTOBASEAutobase'. (Microsoft.SqlServer.Smo)
------------------------------
For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=9.00.1399.00&EvtSrc=Microsoft.SqlServer.Management.Smo.ExceptionTemplates.FailedOperationExceptionText&EvtID=Attach+database+Server&LinkId=20476
------------------------------
Program Location:
at Microsoft.SqlServer.Management.Smo.Server.AttachDatabase(String name, StringCollection files, String owner)
at Microsoft.SqlServer.Management.SqlManagerUI.AttachDatabaseData.PrimaryFile.Attach()
at Microsoft.SqlServer.Management.SqlManagerUI.AttachDatabase.SendDataToServer()
===================================
An exception occurred while executing a Transact-SQL statement or batch. (Microsoft.SqlServer.ConnectionInfo)
------------------------------
Program Location:
at Microsoft.SqlServer.Management.Common.ServerConnection.ExecuteNonQuery(String sqlCommand, ExecutionTypes executionType)
at Microsoft.SqlServer.Management.Common.ServerConnection.ExecuteNonQuery(StringCollection sqlCommands, ExecutionTypes executionType)
at Microsoft.SqlServer.Management.Smo.ExecutionManager.ExecuteNonQuery(StringCollection queries)
at Microsoft.SqlServer.Management.Smo.Server.AttachDatabaseWorker(String name, StringCollection files, String owner, AttachOptions attachOptions)
at Microsoft.SqlServer.Management.Smo.Server.AttachDatabase(String name, StringCollection files, String owner)
===================================
An error occurred while processing the log for database 'ABSystem7'. If possible, restore from backup. If a backup is not available, it might be necessary to rebuild the log.
Could not open new database 'ABSystem7'. CREATE DATABASE is aborted. (.Net SqlClient Data Provider)
------------------------------
For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&EvtSrc=MSSQLServer&EvtID=9004&LinkId=20476
------------------------------
Server Name: .Autobase
Error Number: 9004
Severity: 21
State: 1
Line Number: 1
------------------------------
Program Location:
at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection)
at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection)
at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj)
at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj)
at System.Data.SqlClient.SqlCommand.RunExecuteNonQueryTds(String methodName, Boolean async)
at System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(DbAsyncResult result, String methodName, Boolean sendToPipe)
at System.Data.SqlClient.SqlCommand.ExecuteNonQuery()
at Microsoft.SqlServer.Management.Common.ServerConnection.ExecuteNonQuery(String sqlCommand, ExecutionTypes executionType)
I have a VBExpress 2008 application that uses LINQ to SQL to manipulate data in an SQLExpress 2005 database.
I successfully instatiate a DataContext object and examine its metadata through its .Mapping methods and properties. But when I attempt to set the DataSource for a BindingSource control to one of the tables, I get a run-time error.
Specifically:
Dim dc As New DiabetesData(My.Settings.DiabetesData_dbPath)
For Each mt As MetaTable In dc.Mapping.GetTables
...(examine some properties)...
Next
frmEZView.bsPrimary.DataSource = dc.GetTable(Of BGTest)()
generates the error:
System.Data.SqlClient.SqlException was unhandled
Class=14
ErrorCode=-2146232060
LineNumber=65536
Message="An attempt to attach an auto-named database for file SbearMedicalDiabetesDiabetesData2.mdf failed. A database with the same name exists, or specified file cannot be opened, or it is located on UNC share."
Number=15350
Procedure=""
Server="\.pipe8280AA0D-38A6-41 sqlquery"
Source=".Net SqlClient Data Provider"
State=1
From the Immediate window: ?My.Settings.DiabetesData_dbPath
"SbearMedicalDiabetesDiabetesData2.mdf"
bsPrimary is a BindingSource on a form named frmEZView.
Public Class DiabetesData includes a property Public BGTests As Table(Of BGTest) and a subsequent definition of BGTest.
Can anyone tell me what I'm doing wrong?
Thanks,
--Mable
How do I reattached a SQL server database if the log file was not backed up and none is available. Our server went belly up and the backups were only copying the *.MDF files. The log files were not being included in the backup for some reason.
I know in version 7.0 you could reattach with out the log file but I am having a more difficult time figuring out how to get around thin in SQL 2000. Anybody got any ideas???
Thanks!!!
Hi ,
we have a requirement to create a database of our application in client's system. and we assume that already MS Sql server is installed.
we have a .mdf file of our database. Is there any way I can attach .mdf file to the database using command line. so that I can write a batch file and run that batch to create the database in our client's system.
-regards
GRK
Hi,
can any one help me , i am facing an issue on SSIS mail task, i want to attach a file of size 2 MB. it's getting error :
[Send Mail Task] Error: An error occurred with the following error message: "The operation has timed out.".
thanks,
sun.
Hi All,
I have a dataflow task that creates a text file and posts it in a FTP share.
In need to rename the file attaching datestamp(current date of package execution) at the end of filename.
For ex: My dataflowtask creates a file called 'Samplename.txt'
I need to rename it to : 'Samplename20080225.txt.
I think it can be done using the File task...I see an option to rename the file but not sure of how to configure the task to attach current datestamp.
I see some suggestions online, but complete steps on how to implement the above would be highly appreciated.
Thanks,
Hi there,
I got this error when i tried to attach the adventureworks database and SSIS training database.
an exception occurred while executing a transact-sql statement or batch
(microsoft.sqlserver.connectioninfo)
could not find row in sysindexes for database ID 17, object ID 1, index ID 1. Run DBCC
checktable on sysindexes.
I join join a network domain for my computer. Previously it doesnt have this problem.
The situation :
I am making mass changes to my program and database.
The goal is to not make changes to the database at the customer sites, but to clone their current database, and work with that one.
The solution:
I wrote code and queries to detach the database, copy it to another directory on the same computer with a different name, then attach it with the new name.
The process is:
run : sp_detach_db "' + aDatabase + '", ''false'';' (aDatabase is the original database name)
Then, in code, delete the original .ldf file, and copy the database.mdf file to new directory with new name.
then run (for both the new and the original databases):
Create Database "' + aDatabase + '" on
(NAME = ''' + aDatabase + ''', FILENAME = ''' + FormatFilePath(aPath) + aDatabase + '.mdf''
For Attach
This works, up to a point.
The problem :
When I inspect the properties of the newly attached database, with the new name and new directory, the logical name of the database is still the original name.
I TRIED running this query :
sp_attach_single_file_db @dbName= "' + aDatabase + '",'
@physname= ''' + FormatFilePath(aPath) + aDatabase + '.mdf'
but it returns(even though I have deleted the .ldf files for the original dataset) :
Could not open new database 'Test62'. CREATE DATABASE is aborted.
Cannot create file 'E:Data6Test62Test62_log.LDF' because it already exists. Change the file path or the file name, and retry the operation.
File activation failure. The physical file name "E:Data6TestTest_log.LDF" may be incorrect.
(original database name = data6 est est, new database name is data6 est62 est62)
Is there a way to do this? Or do I just need to give it up?
hello
i am having a problem attaching database.
The Problem :
I have created a database using sqlserver express edition.now i have installed enterprise edition ,so i am attaching the database which is created in sqlserver express edition into the enterprise edition.it is showing error
TITLE: Microsoft SQL Server Management Studio
------------------------------
Attach database failed for Server 'SRINIVAS'. (Microsoft.SqlServer.Smo)
For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=9.00.1399.00&EvtSrc=Microsoft.SqlServer.Management.Smo.ExceptionTemplates.FailedOperationExceptionText&EvtID=Attach+database+Server&LinkId=20476
------------------------------
ADDITIONAL INFORMATION:
An exception occurred while executing a Transact-SQL statement or batch. (Microsoft.SqlServer.ConnectionInfo)
------------------------------
Could not find row in sysindexes for database ID 13, object ID 1, index ID 1. Run DBCC CHECKTABLE on sysindexes.
Could not open new database 'FMS'. CREATE DATABASE is aborted. (Microsoft SQL Server, Error: 602)
For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&EvtSrc=MSSQLServer&EvtID=602&LinkId=20476
------------------------------
BUTTONS:
OK
------------------------------
Can anyone Help me
thanks
i try to attach sqlserver db but i get this error
TITLE: Microsoft SQL Server Management Studio Express------------------------------
Attach database failed for Server 'srvsqlsrv'. (Microsoft.SqlServer.Express.Smo)
For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=9.00.2047.00&EvtSrc=Microsoft.SqlServer.Management.Smo.ExceptionTemplates.FailedOperationExceptionText&EvtID=Attach+database+Server&LinkId=20476
------------------------------ADDITIONAL INFORMATION:
An exception occurred while executing a Transact-SQL statement or batch. (Microsoft.SqlServer.Express.ConnectionInfo)
------------------------------
One or more files do not match the primary file of the database. If you are attempting to attach a database, retry the operation with the correct files. If this is an existing database, the file may be corrupted and should be restored from a backup. (Microsoft SQL Server, Error: 5173)
For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=09.00.2047&EvtSrc=MSSQLServer&EvtID=5173&LinkId=20476
------------------------------BUTTONS:
OK------------------------------
what i will do to solve this error
Hi,
I wanted to create a removable SQL Server 7.0 database. So I created the database using the sp_create_removable system stored procedure, imported objects and data, ensured that the database is configured properly for distribution on removable media (using sp_certify_removable system stored procedure), and detached it from original SQL Server. So far, so good. The database consists of 3 files: MYDB_SYS, MYDB_DATA and MYDB_LOG. I copied
MYDB_DATA on a CD, and MYDB_SYS and MYDB_LOG on hard disk of a different server. If I execute the following statement:
Execute sp_attach_db
@dbname = 'MYDB'
, @filename1 = 'C:MYDB_SYS.MDF'
, @filename2 = 'E:MYDB_DATA.NDF'
, @filename3 = 'C:MYDB_LOG.LDF'
I get the following messages:
Server: Msg 5105, Level 16, State 4, Line 1
Device activation error. The physical file name 'E:MYDB_DATA.NDF' may be incorrect.
Server: Msg 945, Level 14, State 1, Line 1
Database 'MYDB' cannot be opened because some of the files could not be activated.
Server: Msg 1813, Level 16, State 1, Line 1
Could not open new database 'MYDB'. CREATE DATABASE is aborted.
I can successfully execute the above statement if I make MYDB_SYS.MDF file read only, but then MYDB is created as read only, and this option can not be changed.
Please, help.
Maja
Hi all,
I am facing a problem during attaching a database (.mdf and .ldf files are copied fro another server). the message I am getting as follows:
messages was from 'Microsoft SQL Server Management Studio Express':
===================================
Attach database failed for Server 'CTPL-1'. (Microsoft.SqlServer.Express.Smo)
------------------------------
For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=9.00.2047.00&EvtSrc=Microsoft.SqlServer.Management.Smo.Exceptio nTemplates.FailedOperationExceptionText&EvtID=Attach+database+Server&LinkId=20476
------------------------------
Program Location:
at Microsoft.SqlServer.Management.Smo.Server.AttachDa tabase(String name, StringCollection files, String owner)
at Microsoft.SqlServer.Management.SqlManagerUI.Attach DatabaseData.PrimaryFile.Attach()
at Microsoft.SqlServer.Management.SqlManagerUI.Attach Database.SendDataToServer()
===================================
An exception occurred while executing a Transact-SQL statement or batch. (Microsoft.SqlServer.Express.ConnectionInfo)
------------------------------
Program Location:
at Microsoft.SqlServer.Management.Common.ServerConnec tion.ExecuteNonQuery(String sqlCommand, ExecutionTypes executionType)
at Microsoft.SqlServer.Management.Common.ServerConnec tion.ExecuteNonQuery(StringCollection sqlCommands, ExecutionTypes executionType)
at Microsoft.SqlServer.Management.Smo.ExecutionManage r.ExecuteNonQuery(StringCollection queries)
at Microsoft.SqlServer.Management.Smo.Server.AttachDa tabaseWorker(String name, StringCollection files, String owner, AttachOptions attachOptions)
at Microsoft.SqlServer.Management.Smo.Server.AttachDa tabase(String name, StringCollection files, String owner)
===================================
Could not find row in sysindexes for database ID 8, object ID 1, index ID 1. Run DBCC CHECKTABLE on sysindexes.
Could not open new database 'mci'. CREATE DATABASE is aborted. (.Net SqlClient Data Provider)
------------------------------
For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&EvtSrc=MSSQLServer&EvtID=602&LinkId=20476
------------------------------
Server Name: (local)
Error Number: 602
Severity: 21
State: 50
Line Number: 1
------------------------------
Program Location:
at System.Data.SqlClient.SqlConnection.OnError(SqlExc eption exception, Boolean breakConnection)
at System.Data.SqlClient.SqlInternalConnection.OnErro r(SqlException exception, Boolean breakConnection)
at System.Data.SqlClient.TdsParser.ThrowExceptionAndW arning(TdsParserStateObject stateObj)
at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj)
at System.Data.SqlClient.SqlCommand.RunExecuteNonQuer yTds(String methodName, Boolean async)
at System.Data.SqlClient.SqlCommand.InternalExecuteNo nQuery(DbAsyncResult result, String methodName, Boolean sendToPipe)
at System.Data.SqlClient.SqlCommand.ExecuteNonQuery()
at Microsoft.SqlServer.Management.Common.ServerConnec tion.ExecuteNonQuery(String sqlCommand, ExecutionTypes executionType)
===============================================
********************************
the followings are the command and mesage from Query Analyzer:
*****************************************
command:
-- =============================================
-- Attach database via sp_attach_db
-- =============================================
EXECUTE sp_attach_db @dbname = N'mci',
@filename1 = N'd:ifgldatabasemci.mdf',
@filename2 = N'd:ifgldatabasemci_log.ldf'
GO
*****************************************
message:
Server: Msg 602, Level 21, State 50, Line 1
Could not find row in sysindexes for database ID 8, object ID 1, index ID 1. Run DBCC CHECKTABLE on sysindexes.
Connection Broken
*******************************************
I am new to MS SQL Server and unable to solve the problem. Can anyone help me in this metter.
Thanks in advance.
Hi,
My current server going nuts it restaring every one hour, I have 200+GB (80+ files) database size. The network guyes don't have backup. This is what I am trying to do. I have detach my database. I have copied all the file to new server. Now i am trying to attach using create, I can't just use attach because 16+ files. When I run following on my server it gives me an error.
Any help will be highly appreciated.
please email me the answer if you have.
Thanks.
Samir
CREATE DATABASE KEYFILE
ON PRIMARY (NAME= 'KEYFILE001' FILENAME='F:KEYFILEDBKEYFILE001.MDF')
ON SECONDARY (NAME='KEYFILE002' FILENAME='F:KEYFILEDBKEYFILE002.NDF')
ON SECONDARY (NAME='KEYFILE003' FILENAME='F:KEYFILEDBKEYFILE003.NDF')
ON SECONDARY (NAME='KEYFILE004' FILENAME='F:KEYFILEDBKEYFILE004.NDF')
ON SECONDARY (NAME='KEYFILE005' FILENAME='F:KEYFILEDBKEYFILE005.NDF')
ON SECONDARY (NAME='KEYFILE006' FILENAME='F:KEYFILEDBKEYFILE006.NDF')
ON SECONDARY (NAME='KEYFILE007' FILENAME='F:KEYFILEDBKEYFILE007.NDF')
ON SECONDARY (NAME='KEYFILE008' FILENAME='F:KEYFILEDBKEYFILE008.NDF')
LOG ON SECONDARY (NAME= 'KEYFILE_LOG' FILENAME='F:KEYFILEDBKEYFILE_LOG.LDF')
FOR ATTACH
hi all
i am working on sql server 2005
When i am trying to attach database in my server i am getting following error. Plz help me to fix this error.
the error as as follows :
Attach database failed for Server 'myserver'. (Microsoft.SqlServer.Smo)
For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=9.00.1399.00&EvtSrc=Microsoft.SqlServer.Management.Smo.ExceptionTemplates.FailedOperationExceptionText&EvtID=Attach+database+Server&LinkId=20476
------------------------------
ADDITIONAL INFORMATION:
An exception occurred while executing a Transact-SQL statement or batch. (Microsoft.SqlServer.ConnectionInfo)
------------------------------
Could not find row in sysindexes for database ID 10, object ID 1, index ID 1. Run DBCC CHECKTABLE on sysindexes.
Could not open new database 'ReportServer'. CREATE DATABASE is aborted. (Microsoft SQL Server, Error: 602)
hi all
i am working on sql server 2005
When i am trying to attach database in my server i am getting following error. Plz help me to fix this error.
the error as as follows :
Attach database failed for Server 'myserver'. (Microsoft.SqlServer.Smo)
For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=9.00.1399.00&EvtSrc=Microsoft.SqlServer.Management.Smo.ExceptionTemplates.FailedOperationExceptionText&EvtID=Attach+database+Server&LinkId=20476
------------------------------
ADDITIONAL INFORMATION:
An exception occurred while executing a Transact-SQL statement or batch. (Microsoft.SqlServer.ConnectionInfo)
------------------------------
Could not find row in sysindexes for database ID 10, object ID 1, index ID 1. Run DBCC CHECKTABLE on sysindexes.
Could not open new database 'ReportServer'. CREATE DATABASE is aborted. (Microsoft SQL Server, Error: 602)
Hi,I am tring to attached a database in SQL using the following command.Can any one please help. Basically I have a MDF and LDF files which Ineed to open in SQL 7.0, these files are from a diff SQL7.0 machinewhich is crashed.PLEASE HELP. There are many valuable info in the database.Command :EXEC sp_attach_db @dbname = N'Digitalindia',@filename1= N'C:SqlMaster.MDF',@filename2= N'C:SqlMaster.LDF'Error :Server: Msg 5172, Level 16, State 15, Line 1The header for file 'C:SqlMaster.MDF' is not a valid database fileheader. The PageAudit property is incorrect.*** Sent via Developersdex http://www.developersdex.com ***Don't just participate in USENET...get rewarded for it!
View 1 Replies View RelatedQ1.)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
View 1 Replies View RelatedToday I installed SQLEXPR.EXE that I found here:
http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=09.00.3042&EvtSrc=MSSQLServer&EvtID=5120&LinkId=20476
I made sure that I downloaded the 64-bit version.
I then wanted to download and install the Adventure Works database located here: http://www.microsoft.com/downloads/details.aspx?familyid=E719ECF7-9F46-4312-AF89-6AD8702E4E6E&displaylang=en
Since I am running Vista 64-bit, I downloaded and installed AdventureWorksDB_x64. It wouldn't install. I got "Access is denied" and CREATE FILE error plus several others.
I then uninstalled it and downloaded AdventureWorksDB - this is the X86 version. It installed fine.
Can anyone explain what am I missing? Thanks!
Hi Mike,
I've had a look at the white paper on use instances and also stopped using Management Studio, as you suggested. The problem is that I can run my application from VWD quite happily, until for no reason the application can't connect to the database. This happens ramdomly and is very frustrating. I have worked out a way to correct this problem with the following method (I don't know if this is correct but it's the only work around I know.
1) I close down VWD and open Management Studio,
2) I right click to attach a database, and then navigate to the .mdf file for the database, and click to attach it. I then delete the existing icon for that database (which I can't acess anyway, it only shows me the main icon but not the tables)
3) I rename the new instance of the database to the correct name (minus path info etc)
4) I create an SQL script as follows:
EXEC sp_grantlogin 'jonASPNET'
(This line executes correctly),
Then I enter these lines:
USE BalloonShop *name of database *
EXEC sp_grantdbaccess 'jonASPNET'
(At this stage when I execute the query, Management Studio informs me that this name already exists in the database and so doesn't execute)
5) I now close out of Management Studio and re-open VWD, and I can now run my application correctly.
I know I've got some configuration settings wrong somewhere but I find the whole user instance thing confusing. For the record I'm running the appllication through VWD's built in web server, I did originally have it through IIS but I moved it (this will explain the confusion of locations from my first post, I gave you the original location, sorry about that).
Any advice you can give would be gratefully recieved, ie is there an easy way to reconfigure my settings to make everything work as expected or have I got to start the database again from scratch (not a pleasent thought). Also is there an idiots guide to SQL Server Express anywhere that I can read.
Jon
ps I've just realised that I get the 'can't connect to database problem when running the application after I've made a change to the database from VWD ie adding a new stored proceedure, Don't know if this helps, but better you get the full picture.
I've created a simple database using Visual Web Developer Express.
I is located in "C:Documents and SettingsRomanMy DocumentsVisual Studio 2005WebSitesNewSiteApp_Data" Folder.
When I try to attach this database using SQL SERVER Management Studio Express: it doesn't allow me to view the contents of "C:Documents and SettingsRoman" Folder - it just won't expand any further!!!!!
Anyone had a similar problem. I think it is some sort of a bug, maybe
Please help!
Thanx
Michael
Hi Mike,
I hope you can help me with my SQL Server Express problem. I have a database that was created in VWD Express 2005, that is currently in C:web projectsproject nameApp data...etc. I have been able to connect to and use the database with an application that I am building as a learning exercise, ( I'm a complete newbie to .NET and SQL Server) but now I can't connect to the database from SQL Server manager.
I have tried attaching the file which has worked a few times, but now that won't work either. I keep getting a message that the file can't be found or I do not have sufficient permissions to access it. I can connnect to the file fine from within VWD, but because of the above problem I can't now run the application (it throws an exception).
I suspect that I've got some of the basic configuration settings wrong, but I really don't know where to start looking. Below is an example of one of the messages I've been getting
Failed to retrieve data for this request. (Microsoft.SqlServer.Express.SmoEnum)
CREATE FILE encountered operating system error 32(error not found) while attempting to open or create the physical file 'C:InetpubwwwrootBalloonShopApp_DataBalloonShop.mdf'. (.Net SqlClient Data Provider)
Any help would be very gratefully recieved
regards
jon
When attaching a database that was detached from another SQL Server instance(copied raw .mdf and ldf files)..
I got the error message below:
Error 602: Could not find row in sysindexes for database ID 25, object ID 1,
index ID 1. Run DBCC CHECKTABLE on sysindexes.
how can i solve this problem. i am using SQL Server 2000
Thanks and Regards
I'm trying to attach a database to sql express with the following code from the management tool. I keep getting an error message. An someone explain what I'm doing wrong.
Msg 102, Level 15, State 1, Line 9
Incorrect syntax near '<'.
IF NOT EXISTS(
SELECT *
FROM sys.databases
WHERE name = N'<northwind.mdb, I4V0Y6SQLEXPRESS, northwind>'
)
CREATE DATABASE <database_name, sysname, your_database_name>
ON PRIMARY (FILENAME = '<c:my documentsmy websmyweb3,,C:Program filesMicrosoft SQL ServerMSSQL.1MSSQLDataorthwind.MDF>')
FOR ATTACH
GO
Ira