Detach,attach Db And Login,user And Master Database

Jan 30, 2000

I have similar question like Tim asked but from a different angle. I wish I pose my question here too anybody can help answer this.

I tried to use detach and attach method to do backup of the user database (not master, maybe we can do master too) on another server, but it looks the login and permission credential would not go together. I come to see different kind of message I tried to login as non-sa user after I attatch the database on different machine. I would be denied for SQL timeout. It looks like loginand user dose not exist in new server because I did not move master database too. But even if I recreate the login when I tried to associate user with login I will see a message saying user or role already exist in database. If I go back to check the user it did not show up on enterprize manager on that database.

So my question would be
1). how to move login and user together with user database.
2) do we have to move master database where the login infor. reside
3). if so how to move master database from one server to another when other server already have master database exist?

Hope somebody can answer this.


Wislon

View 2 Replies


ADVERTISEMENT

Detach && Attach Database

Oct 10, 2006

I've just created ASPNETDB database with ASP.NET Security. Now, I want to send this db to orther computer.First, I  detached this db, then when I used attach database in that computer, there is an error :Error 602: Could not find row in sysindexes for database ID 8, object ID 1, indext ID 1. RUN DBCC CHECKTABLE on sysindexes. Please help me .Thank.

View 3 Replies View Related

Attach/Detach Database

Nov 11, 2001

In SQL when I right click on Databases the option to use Attach/Detach is greyed out. I don't understand why. I'm running SQL 7 on Win2000 server and I have Win2k at sp2 and SQL at sp2.

Help please!

Chris

View 1 Replies View Related

Database Detach/attach

Jan 2, 2004

An original database (eg A.mdf) is imported/exported to a different server as named B.mdf. The detach of A.mdf was unitentionally not done. It seems that both the database were updated.

A.mdf - 123000KB 25/12/2003
A_log.ldf - 14000KB 25/12/2003
B.mdf - 67000KB 25/12/2003
B_log.ldf - 1024KB 25/12/2003

In this case, which mdf & ldf should be the correct database?
If I I remove A.mdf database by "detach", will B.mdf database work?

SQL server 2000 and SP3 installed.

Assistance is appreciated

View 9 Replies View Related

Question On Detach/attach Database

May 21, 2007

Hi, all experts here,

Thank you for your kind attention.

I am having a question on detach/attach database. As when we detach/attach database, we have to copy both of .mdf and .ldf files to the targeted filepaths, in this case, when the database is large, then it takes a pretty while to copy the physical files though. In this case, I dont really see the point to detach/attach the database? Instead, backup/restore may be faster? (also, as detach the database, the files has to be taken offline)

Just confused about the way we trasfer database files with detach/attach. I am looking forward to hearing from you shortly for any advices for that.

With best regards,

Yours sincerely,

View 3 Replies View Related

Using Detach/Attach Database To Copy/move

May 9, 2001

This might sound dumb, but BOL says you can use detach/attach to "MOVE" a database but can you detach and copy the files to a new server, leaving the files on the original and running the attach on the new and the old? (effectually a way to copy)? I know how to use data transformations/import,export was curious?

Help appreciated!!

View 4 Replies View Related

Backup/Restore Vs Attach/Detach 2000 Database To 2005

Jul 15, 2006

I'm trying to see the differences between Backup/Restore and Attach/Detach. I backup and detach a database from SQL Server 2000 SP3 and then attach and restore it to SQL Server 2005 SP1.

The differences I noticed are:

1. The restored database has a much larger initial size (database size is same) for data and log.
2. The attached database has a last backup date
3. If the backup is restored over a database, the restored database is showing owned by the database owner of the database restored over but syslogins and sysusers do not match.

I don't understand why #1 happens.

Are there any other differences between Backup/Restore and Attach/Detach?



Thanks,

Peter

View 2 Replies View Related

Detach Database, Attach Database Without Log File

Jul 20, 2005

If I detach a database on a server, then attach the database with asingle file only using the data file...will I lose any transactionsthat were in the original log file? There is a debate going on here atwork where some people think that during the detach, transactions inthe log file are saved to the data file.Thanks!

View 4 Replies View Related

Attach And Detach DB

Aug 11, 2004

Hello,

MSSQLSERVER VER : 2000
Using - Attach and Detach Database to move the database from one Server to another server.
I did detached the database from Production and attached my test server, everything OK

Questions about - syslogins & sysdevices data dictionary tables
1. When I select * from sysdevices on production it shows all the database name size,phyname etc. After attaching to my test server I cannot see these things.. I know because it different master database but, how do I fix this.
2. syslogins - is there way to move all the syslogins after attaching to test server.

Please let me know if you guys have done anything on this.

Thanks.

Regards,
K.

View 2 Replies View Related

Detach And Attach DB To SQL

May 23, 2006

How I can detach from DB and validate it?
(I mean check if it is detached or not)
Is there any why to return a value from sp_detach_db in C++?


(may a cross posting, please check under developer posts)

View 1 Replies View Related

Attach And Detach Db Woes

Jan 4, 2002

I have developed a db on a local machine (98) and would like to move it to another machine running nt 4 where it will function as a production db. I am mapped to see the other server (called "labnt"). The drive on "labnt" is partitioned, with the c drive holding programs, and the e drive designed to hold the data.

I would like to move the db (called SNB01) to the MSSQLData subdirectory on the e-drive. I have tried the following sproc to detach:

EXEC sp_detach_db 'SNB01', 'true'

And the following to reattach:
EXEC sp_attach_db @dbname = 'SNB01',
@filename1 = 'labntewmssqldataSNB01_Data.mdf',
@filename2 = 'labntewmssqldataSNB01_log.ldf'

The above path was given me by our network admin guy.


QA gives the following error:
Server: Msg 5105, Level 16, State 4, Line 1
Device activation error. The physical file name 'labntewmssqldataSNB01_Data.mdf' may be incorrect.


Please help. I am thrashing about. D. Lewis

View 7 Replies View Related

Detach On SQL 2000, Attach On SQL 7

Sep 23, 2004

Hi folks,

Is it possible to detach a database on SQL Server 2000 and attach it to SQL Server 7 ? I know it's fine to do the other way around. Also, any adverse effects I should be aware of ?

Thanks

View 3 Replies View Related

Is Restore Or Detach/Attach Better?

Nov 5, 2007

Hello, everyone:

I want to move a database instance (about 50 user databases) to another server, both are running SQL Server 2000. Which method is better, retore from backup files or detach/attach? Some papers said restore amybe cause incorrect login and password transfer. Is it true?

Thanks

ZYT

View 5 Replies View Related

How Can I Attach And Detach My MDf File

Jun 9, 2008

Hello Experts, How Can i Attach and Detach my MDf file to an instance of SQL server 2005 Programatically or by T-SQL :)

ElmasryA1

View 1 Replies View Related

Detach, Move, Attach Again

Mar 23, 2006

I created a db in ssms; I detached it and moved it into a subdirectory of a vb app. Now sql server says the database does not exist. If I recreate the database in smss, I can run an INSERT INTO using that db as the destination. However, this only works if I keep it in the mssql data directory. How can I move it to the apps subdirectory so that it can be deployed with the app and still work? BTW, I also tried creating the databases in VS2005 with same results.

This is the connection string (tried this and non-express version with same results):

  strDbConn = "Provider=SQLNCLI;Data  Source=.SQLEXPRESS; AttachDbFilename=" & DbPath & ";User Instance=True;Trusted_Connection=Yes"

This is the sql statement:

  sqlCopyTable = "SELECT * INTO "
  sqlCopyTable = sqlCopyTable & CleanDbName & ".dbo." & CleanTableName
  sqlCopyTable = sqlCopyTable & " FROM " & RawTableName & ";"
  ConnectSQLExpress RawDbPath, "Source"
  ConnectSQLExpress CleanDbPath, "Destination"
  SourceDbConn.Execute sqlCopyTable

View 1 Replies View Related

Detach/Attach DB VS Stopping SQL Server

Mar 21, 2002

What problems could be invoked by stopping SQL Server and copying a user databases data and log files and pasting these files over existing files on another machine.

Ex:
MyDB on Server1
MyDB on Server2
Stop SQL Server Server1 and Server2
Copy Server1.MyDB files
Over write Server2.MyDB files
Start SQL Server Server1 and Server2

Make sense. This scenerio seems to work but wonder what side affects could result.

Any comments would be helpful!!

View 1 Replies View Related

Attach And Detach My Mdf File Programatically T.SQ

Jun 9, 2008

Hello Professionals, How can i attach and detach my mdf file to an instanse of sql 2005 programatically or by T-SQL

ElmasryA1

View 1 Replies View Related

Attach/Detach On SqlExpress 2005

Sep 8, 2005

Alan writes "Is it possible to create scripts which can be started remotely
to attach and detach databases into SQLExpress 2005.
If so how."

View 1 Replies View Related

How To Attach And Detach Mirrored Databases

Apr 15, 2008

Hello all,

We are planning to change the location of the log files from my production server. We have setup the mirroring also for those databases. I know for the databases without mirroring job i could detach the database, copy the log file to the target location and attach the database with the new logfile location. But for the mirroring databases I don't have any idea how to do that. Could some body guide me thorugh the process on how to do this task? thank you very much for all your help!

View 16 Replies View Related

Error : Cannot Open User Default Database. Login Failed. Login Failed For User 'server/user'

Nov 22, 2007



i'm using the Enterpirse library logger to write logs into a database.
When choosing connection string i choose the database i want in the "connection properties" dialog box and
push 'Test connection' button.
everything goes well.

then i open the SQL Server Management studio express and connect to the databse to check some things,
from that point on , when i push the 'Test Connection' button in the Enterprise library i get the error:


"cannot open user default database. Login failed. login failed for user My'server/MyuserName'"


even when i close the sql server manager , it is still stuck - the connection test doesn't work anymore....
it only work when i restart the computer.

why ?

View 3 Replies View Related

Error: Cannot Open Database Requested In Login 'projectAllocations'. Login Fails. Login Failed For User 'sa'.

Oct 27, 2004

Hi,
Im getting this error when attempting to retrieve data from an sql database.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Data.SqlClient.SqlException: Cannot open database requested in login 'projectAllocations'. Login fails. Login failed for user 'sa'.

Source Error:


Line 13: objConn = New SqlConnection( "Server=LAB303-066NETSDK; Database=projectAllocations; User ID=sa;Password=mypassword")
Line 14: objCmd = New SqlCommand("SELECT * FROM project_descriptions", objConn)
Line 15: objConn.Open()
Line 16: objRdr = objCmd.ExecuteReader()
Line 17: While objRdr.Read()

Source File: C:finalyearproject2sample.aspx Line: 15



Please Help!! Im a beginner to this, so if anyone knows the answer, take baby steps when explaining. Thanks

View 3 Replies View Related

Cannot Open Database Requested In Login 'dbName'. Login Fails. Login Failed For User 'machineNameASPNET'

Jul 27, 2005

Been looking through the forums for a solution to this problem.I already tried granting access through statements such as:exec sp_grantloginaccess N1'machineNameASPNET'But they don't seem to work.. i vaguely remember seeing somewhere a DOS command line statement that grants access to the ASPNET_WP and that fixed my problem before on another computer.. but this is a new computer and i forgot to write down the command.Can anyone help explain and propose a solution to my problem. Many thanxs.

View 9 Replies View Related

Cannot Open Database Requested In Login 'sql'. Login Fails. Login Failed For User 'ASPNET'.

Dec 19, 2003

I am using the MSDE to connect to my ASP.NET application. I get this error after clicking the login button of my login page. Anyone know why this would happen?

Thanks for any help,

Cannot open database requested in login 'DataSQL'. Login fails. Login failed for user 'serverASPNET'.

View 5 Replies View Related

Detach And Attach Functions In SQL Server 2005

Apr 24, 2006

Hi,

View 5 Replies View Related

Can Detach/Attach MSDB To Retain My DTS Info?

Jun 18, 2002

We have a hardware problem and will be getting a new RAID HDD system.

I've asked the tech onsite to backup and detach the MSDB and then reattach.

Can this be done, I expect to have him detach the new MSDB when MSSQL is re-installed. Then replace that file with the previously detached version and run reattach from QA(?)

Will this work.

TIA

JeffP...

View 3 Replies View Related

SQL 2012 :: Attach / Detach Versus Backup And Restore

Mar 20, 2014

We have 5 databases which will sum up to 8+TB, housed in our EDW server. We are planning to migrate to another storage system for better performance.

I am planning Full backup and Differential backup and detach the DB and restore the DB in the new storage system.

Or should I detach,copy the data and log file and attach the files, will this approach have any advantages ?

View 5 Replies View Related

Cannot Open User Default Database. Login Failed. Login Failed For User 'DOMAINUser'. (.Net SqlClient Data Provider)

Apr 16, 2008

Hi when i try and open a database in sql server management studio i get the error "Cannot open user default database. Login failed. Login failed for user 'DOMAINUser'. (.Net SqlClient Data Provider)", what can i do to rectify this, i have googled around and still havent found no answers.

View 4 Replies View Related

SqlException (0x80131904): Cannot Open User Default Database. Login Failed. Login Failed For User 'xxxASPNET'

Jun 17, 2007

Hey Microsoft: this affects development that will eventually sell a lot of seats on SharePoint Server 2007. If you guys and gals can't straighten out this mess, you can't expect custom solutions with custom web parts. So pay attention for your own good. Yes, SPS 2007 is what this is all about. I've created simpe web parts and deployed them, same VS 2005, but I need local development and debugging for more complex stuff. I'm really disappointed that you have no solution for this problem.



I've seen other posts on this, but the result seems to be the same: if you fix it, it's by accident, not by design.



1. I created a blank ASP.NET web site

2. I added a web part manager

3. I added a web part zone



I get the error described above. I have no idea why SQL Server settings are so screwed up.



I've tried all the stuff in the other posts - security settings, command line installation, etc. None of those worked.



The default template(s) don't copy anything into App_Data, nor create an empty folder. I don't know why that is. I have other web sites working just fine, but they use remote SQL databases, or local ones I created, and didn't need profile management (no forms authentication, no web parts, no web zones).



I've also started out with a local database, using SQL Authentication, later moving it to a remote server, and never had any problems. The SQL Server developer edition and Express seem to work just fine. I can also debug stored procs when the .mdf is in App_Data. So the problem isn't one of connectivity.



What would cause the default screw-up? This would seem to point from all directions to a problem with Visual Studio (2005)? The installation is defalt - perhaps some extras included (copy local), but nothing unusual. AJAX for ASP.net is installed, but not used in the above "default web site" trial. Likewise Syncfusion's tools, which work fine on other developer workstations at this same location, all of which are from the same image (purchased at the same time & imaged). That web parts work on other boxes, running all the same management tools (anti-virus, remote sys admin/sms etc.) makes none of those suspect.



I think Microsoft needs to have a clean problem solution and publish it. SP1 certainly doesn't fix it. What's worse is the stupid, lame error message. "I can't open the default database". Well, what did you try? What do you think the default is? What settings are you using? Why is there no debugging information other than the usual worthless trace information showing it's all deep within the ProviderBase and SqlClient namespace code? How is that supposed to be helpful?



If anyone has anything solid, not guesses, I'd like to know.

View 1 Replies View Related

Detach/attach Move Fails To Bring Over Roles & Logins Correctly

May 23, 2001

A database move was accomplished by detaching the database from the legacy server and attaching it to the new server. The servers ran NT 4, SP6a, SQL 7 SP2. The new server had the same name and IP as the old server.

However that process (detach attach) does not bring over the users (who had access to the database on the legacy systems) correctly.

Under databases, roles the users existed. Under security, logins they did not.

We were obliged to drop the roles and recreate the logins and assign new roles. In the case of an NT user group we were unable to drop it. We had to create a new one and add the users to that group under User Manager.


So far I have not found anything that deals with the user account/role problem.

We have to move a similar database tonight. Do any of you know of an alternative "move" that brings the user roles/logins across correctly?

Thanks in advance.

View 4 Replies View Related

HOW TO LOGIN IN TO SQL EXPRESS AND HOW TO ATTACH DATABASE PLZZ ITS URGENT

May 23, 2006

Hi

i am developing an installer for our produce where there is a need to install sqlexpress and then i have to attach the database to that but i am unable to understand how to do that , i any one can help in this issue plss

View 1 Replies View Related

Sqlexpress Cannot Open Database Abc.mdf Requested By Login. The Login Failed For User 'machinenameASPNET'

Apr 18, 2008

Hi I have asp.net2 app using SQLExpress which works fine in VS2005.
When I compile it and try to run it from IIS on the same machine using the same
sql server database with:
connectionstring="server=.SQLEXPRESS;Database=abc.mdf;Trusted_Connection=yes"/>
I get the following error.
Cannot open database abc.mdf requested by login. The login failed. Login failed for user 'machinenameASPNET'
Any help much appreciated 
 
Thanks
David
 
 

View 2 Replies View Related

Cannot Open Database XYZ Requested By The Login.The Login Failed For User '[domainname]-[username]ASPNET'.

Sep 20, 2007

Hi all,
Iam getting this error
System.Data.SqlClient.SqlException: Cannot open database "XYZ" requested by the login. The login failed.Login failed for user 'xyz-abcASPNET'.
 when trying to open the page.... 
http://localhost:1807/projectname/WebFormName.aspx
as
http://localhost/projectname/WebFormName.aspx
Couldnt figure out the solution.Please help
Soujanya

View 2 Replies View Related

Cannot Open Database XXXX Requested By Login. The Login Failed. Login Failed For User 'xxx'

Mar 18, 2007

hi,
 so i have a new box and I'm trying to get my websites and SQL Server 2005 Standard Edition working on it, but the pages give me the following error when I try to load them:
"Cannot Open Database "XXXX" requested by login.  The login failed.  Login failed for user 'xxx'"
Everything seems exactly the same settings and user-wise from my old box to my new one, but nevertheless everything I've tried gives me the same error.
I've tried creating new users in SQL Server and giving them appropriate permissions to my database.  I've even tried just using the built in 'sa' account.  Nothing seems to change the error, except when I give it the incorrect password then it just says 'login failed'
This leads me to believe that i'm successfully logging into the SQL Server, but it doesn't want to give me access to the database I'm requesting access too.  But "apparently" the account i'm using should have access to the database.  If nothing else the 'sa' account should, but that didn't work either.
I'm stumped.  Any ideas?
 

View 6 Replies View Related







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