SQL 2005 Make Restoring User Db_owner

Feb 29, 2008



Hi all,


I'm kinda stuck with the following issue and would apreciate some help with it.

Basically i need to have a user within SQL that has rights to restore databases and is the owner of that database so it can alter the data. The problem i face is that at this moment i see no other way then making that user either member of the server role "sysadmin" or "serveradmin".

Anyway, these roles have to much rights. I tried using the dbcreator role which will make a the needed user db_owner but only when a new database is created, not when a database is restored.

Tried to resolve this with a DDL trigger and then temporarily run as a user with serveradmin rights, however there is no system event for restore database, so that doesn't work either.

Anybody got any suggestions?


View 3 Replies


ADVERTISEMENT

User Not A Choice When Trying To Add To Db_owner Role For Database

Mar 14, 2008


How do I get a particular user to be a choice under the db_owner role for a particular database?
The user is listed under logins and even shows to be the db_owner for the database under the database access tab of the login properties. This is SQL 2000.
Thanks,
David P.

View 1 Replies View Related

How To Xfer Db_owner From User Back To Where It Belongs?

Aug 22, 2007

OK. I screwed-up. SS2005. I gave a user ownership of schema "db_owner" and now I can not change it back to what it was (unknown) so I can delete the user. So how do I change ownership of "db_owner" back to what it was so I can delete the user???

Thanks,

Michael

View 2 Replies View Related

URGENT: Problems With Guest User In SQL 2005 Restoring Databases From Sql 2000

Sep 18, 2006

Hi all.

I don't know if this is the right forum to post this question, but here it goes.

We have restored into sql 2005 the database backups made in sql 2000. We connect with trusted connection and application roles, and when trying to execute a transaction to another database (with the guest user), we get a permission error.

Does anyone know if, apart from restoring the databases, we should do something else to get the guest user working the same way as with sql 2000 in the restored databases?

Thanks in advance for your help.




View 1 Replies View Related

Failed To Generate A User Instance Of SQL Server Due To Failure In Retrieving The User's Local Application Data Path. Please Make Sure The User Has A Local User Profile On The Computer. The Connection Will Be Closed

Dec 7, 2006

This is my first time to deploy an asp.net2 web site. Everything is working fine on my local computer but when i published the web site on a remote computer i get the error "Failed to generate a user instance of SQL Server due to failure in retrieving the user's local application data path. Please make sure the user has a local user profile on the computer. The connection will be closed" (only in pages that try to access the database)
Help pleaseee

View 3 Replies View Related

Granting Db_owner To The Windows Group In 2005

Feb 12, 2008

When granting db_owner to the SINGLE user, it's automatically set the DEFAULT_SCHEMA to dbo so when the user created the table, the table will be owned by "dbo"

When granting db_owner to the Window group, DEFAULT SCHEMA WILL NOT be "dbo", for this reason when the user A(belonging to this Windows Group) created a table, that's table will be owned by user A instead of dbo.

1. is it normal behavior for the Windows group?
2. Is there any way you can grant to the group so the objects will be owned by dbo instead of the user who created the objects? or this is a behavior when MS introduce SCHEMA in 2005.

Thanks,

View 1 Replies View Related

Restoring User Permission

Sep 10, 2000

I have a nightly job that restores a production database to a reporting server. I have some report- related stored procedures
that need to run on the reporting server once the database is restored. However, during the restore, the permissions for the
reporting stored procs get deleted and replaced with the production permissions, which are useless in this case.

Is there a script or system stored procedure I can schedule to run after the nightly restore that will also restore user
permissions? Thanks, Frank.

View 1 Replies View Related

Restoring A Databse User

Sep 8, 2005

I'm new to working in SQL, so forgive my lack of terminology.

View 1 Replies View Related

Make A User For The Database

Nov 14, 2003

hi
how can i make a user give it a name ReportUser and a password msdn for a certain database named on the sql server 2000 and thank you for your help and oyur time

View 1 Replies View Related

Database User Problem When Restoring

Mar 14, 2001

Hi everybody

i am taking the full database backup on server sql1 and restoring on sql2. there are some logins in sql1 which are not in sql2. i restored the database ,and try to create the login with same name as in sql1 and try to create the user in the database ,its giving me the error the user is already in the database . when i checked the users the user is not in the database ,but he is in the public role .i try to remove from the role its not doing it..

some body please tell me fix for this broblem

ThanKs prasad

View 2 Replies View Related

Orphaned User Accounts When Restoring

Dec 29, 1999

I am copying a database to an alternate server by restoring a full backup onto the new server. However, whether I create the logins prior to the restoration or not the user accounts in the database no longer map to logins in the master.

Unfortunately it is not simply a case of dropping the acounts as they own objects in the database.

My best solution to date has been to use the sp_addalias to alias logins of the same name to the original user. However this is a far from ideal situation as one cannot readily tell that the logins are aliased and there must be an additional overhead in doing this.

View 3 Replies View Related

How To Make Database Accessible To User

Apr 12, 2008

I am setting up a web application, where the application needs to access a database. I have created the user (for the application) and it can log in to the SQL 2005 Sp2 server, but when I try to open the required database using Server Management Studio, it says "The database [name] is not accessible. (ObjectExplorer)"How do I make a database accessible to a login, using Server Management Studio?

View 2 Replies View Related

Make Normal Windows NT User As DBO??

Jul 4, 2002

Hi,

How do we make a normal Windows NT user as DBO in Sql server 2000?

Thanx

View 2 Replies View Related

Is There A Way To Make A Column Re-sizeable By The User?

Dec 10, 2007

when we display hierarchies, we'd like the user to have the option of expanding a column for wider viewing, perhaps by dragging a border. Is this possible?

View 3 Replies View Related

Problem In Restoring Database In User Instance

Mar 17, 2007

Hi, Folks. I hate to have to come back and ask about restores right after I had to ask about Back ups, but I'm in a bind and can't seem to find other resources that address this issue.

I'm using VB Express 2005 and SQL Express 2005 to develop a windows form application that uses a User Instance of a database. With help from this forum, I was able to get the backup working. Now, I can't get the restore to work. Here's the code I'm using:

Dim SqlConnection As SqlClient.SqlConnection = New SqlClient.SqlConnection(My.Settings.NCSConnectionString)

SqlConnection.Open()

Dim ServerConnection As ServerConnection = New Microsoft.SqlServer.Management.Common.ServerConnection(SqlConnection)

Dim srv As Server = New Server(ServerConnection)



'Declare a BackupDeviceItem by supplying the backup device file name in the constructor, and the type of device is a file.

Dim bdi As BackupDeviceItem

bdi = New BackupDeviceItem(My.Settings.DefaultBackUpPath & "NCS_Full_Backup1.bak", DeviceType.File)



''Define a Restore object variable.

Dim rs = New Restore

'Set the NoRecovery property to true, so the transactions are not recovered.

rs.NoRecovery = True

rs.ReplaceDatabase = True

'Add the device that contains the full database backup to the Restore object.

rs.Devices.Add(bdi)

rs.NoRecovery = False

'Specify the database name.

rs.Database = SqlConnection.Database.ToString()

'Restore the full database backup with no recovery.

rs.SqlRestore(srv)

'Inform the user that the Full Database Restore is complete.

MsgBox("Full Database Restore complete.")

The error is:

- InnerException {"RESTORE cannot process database 'C:DOCUMENTS AND SETTINGSMARCOSMY DOCUMENTSVISUAL STUDIO 2005PROJECTSWORKING COPY OF NCSNCSBINDEBUGNCS.MDF' because it is in use by this session. It is recommended that the master database be used when performing this operation.
RESTORE DATABASE is terminating abnormally."} System.Exception

I think that I need to either free up something that's locking the database or I need to switch to the master table in the User Instance. I tried a number of variations in attempt to try both of these avenues without sucess.

I'd really appreciate any guidance that I might be able to get.

Thank you,

MF

View 11 Replies View Related

How To Remove NT User After Restoring Back Up From Diffrent Domain

Jul 18, 2001

hi everybody.
Scenario

Company X has Sql server and domain x.com

so
on sql server
they have logins
XA
XB
XC

Back of database Production was done

database Production was restored in Company Y

use Production
select name from sysusers
name
----
XA
XB
XC

sp_dropuser 'XA'

Server: Msg 15008, Level 16, State 1, Procedure sp_dropuser, Line 12
User 'XA' does not exist in the current database.

How to drop 'XA' ?

View 2 Replies View Related

More On Restoring Database In User Instance - Exclusive Use Not Obtained

Apr 11, 2007



Hi all. I have read and implemented the very helpful threads on backing up and restoring with user instance posted with MFriedlander. Thank you. However, during the rs.SqlRestore(srv) command I am getting the following error "Restore failed for Server '\.pipe4A1F91FF-F6FE-45 sqlquery'. "
"Exclusive access could not be obtained because the database is in use."

I have implemented the changedatabase method as described in that thread.

SqlConnection.ChangeDatabase("master")

right before the line

rs.SqlRestore(srv)

I do not use the default instance of sql express, but I do use an instance called 'test' for my app. Should my changedatabase method also refer to my sql instance?

I am running from VS 2005 debug (F5) when it fails and cannot think of anything that would be locking it. Any help would be appreciated. Thank you. Below is the full code of the restore.

Robert



Dim sqlconnection As SqlConnection = New SqlConnection(My.Settings.dbTestConnectionString)

sqlconnection.Open()

MsgBox(sqlconnection.Database.ToString())

Dim ServerConnection As ServerConnection = New ServerConnection(sqlconnection)

Dim srv As Server = New Server(ServerConnection)

'Declare a BackupDeviceItem by supplying the backup device file name in the constructor, and the type of device is a file.

Dim bdi As BackupDeviceItem

bdi = New BackupDeviceItem(txtRestoreFile.Text, DeviceType.File)

''Define a Restore object variable.

Dim rs As New Restore

'Set the NoRecovery property to true, so the transactions are not recovered.

rs.NoRecovery = True

rs.ReplaceDatabase = True

'Add the device that contains the full database backup to the Restore object.

rs.Devices.Add(bdi)

'don't know why the below norecovery is changed to false

rs.NoRecovery = False

'Specify the database name.

rs.Database = sqlconnection.Database.ToString()

sqlconnection.ChangeDatabase("master")

'Restore the full database backup with no recovery.

rs.SqlRestore(srv)

View 4 Replies View Related

Restoring In SQL 2005

Feb 8, 2006

Hi ,

I am trying to restore database , which is backed up from SQL 2005 ver 9.00.1399.06

to anothere machine have SQL 2005 ver 9.00.1399.00.



When I try to do a restore I am getting the following error!

Too many backup devices specified for backup or restore ; only 64 are allowed.

RESTORE HEADER ONLY is terminating abnormally . (Microsoft SQL Server, Error:3205)

Please give me some solution for this.

View 12 Replies View Related

Restoring Filegroups In 2005.

May 3, 2007

Howdy all. I want to be able to restore just 1 filegroup from a filegroup backup, without having to restore the log afterwords even if the data has changed post filegroup backup. While this would leave the data inconsistant, it may be desired at times. From BOL: ms-help://MS.SQLCC.v9/MS.SQLSVR.v9.en/udb9/html/2f552700-efb3-48f1-b96d-c073049100f0.htm

************************************************** ******
If the files have been modified after the file backup was created, execute the RESTORE LOG statement to apply the transaction log backup, specifying:

The name of the database to which the transaction log will be applied.
The backup device from where the transaction log backup will be restored.
The NORECOVERY clause if you have another transaction log backup to apply after the current one; otherwise, specify the RECOVERY clause.
The transaction log backups, if applied, must cover the time when the files and filegroups were backed up until the end of log (unless ALL database files are restored).
************************************************** ******

But thats just it, I may not want to take this action. Maybe some data got deleted from a set of tables in a filegroup right after I took my last filegroup backup, so I just want to restore that filegroup back to that backup, but leave my other filegroups alone. Restoring the log brings the data back to a consistant state when the log was backed up, which may not be what I want.

Can this be accomplished?

TIA, cfr

View 2 Replies View Related

Restoring A 2000 Db To 2005

Jun 20, 2007

Hello,

I'm having an issue with stored procedures after restoring a db from 2000 -> 2005.

If any stored procedures isnt owned by dbo (eg tomsqluser.updateItems rather than dbo.updateItems) then it just wont work and Studio Management Server doesnt give the permission to change it to dbo.

Is there any way around this after restoring?

View 10 Replies View Related

Restoring DB From Sql 2005 To Sql 2000

Nov 11, 2007

hi there,
I've got a problem while restoring a DB from sql server 2005 to sql server 2000 I always got an error message 3169.
Please I want if it's possible to make it, it urgent.


Thanks in advance

View 1 Replies View Related

Restoring A Db In SQL Server 2005

Dec 21, 2006

Hello,

I received a backup Sql Server file and I am trying to restore it. When trying to restore the backup using SQL Server 2000, I get the following message:

"the backed-up database has on-disk structure version 611. The server supports version 539 and cannot restore or upgrade this database. RESTORE DATABASE is terminating abnormally."

After doing some research online, I figured out that the backup I received must be from SQL Server 2005. Therefore, I installed SQL SErver 2005 on my laptop (so now I have both 2000 and 2005 on my laptop)..

I tried to use the restore database option in SQL Server 2005 ( SQL Server Management Studio) to restore my backup, and I get the same error message (written again below) as I did when using SQL Server 2005:

"The backed-up database has on-disk structure version 611. The server supports version 539 and cannot restore or upgrade this database. RESTORE DATABASE is terminating abnormally"

Can anyone please provide me assistance on what I'm doing wrong? Is the issue that I have both SQL Server 2000 and SQL Server 2005 installed on my laptop? Thanks.

View 7 Replies View Related

How Can I Make Log Transactions Using SQL 2005

May 4, 2008

Hi all,
I am have database consist of 10 tables, I want to make log transactions for this tables, So any act happened on these tables, such as adding or modifying or deleting record, I want to put this information somewhere in the database, to determine the user who has done such acts on these tables.

I would high appreciate for any assistant.

View 7 Replies View Related

Migration Problems From SQL 2000 To SQL 2005: User Cannot Find The User 'RSExecRole'

Jan 25, 2008



Hello,



I am trying to migrate reporting services from SQL server 2000 to SQL 2005. I followed the migration steps listed in one of the TechNet documents. Installed SQL 2005 and SP2.

Backed up existing SQL 2000 databases and restored on SQL 2005.

Went to Configuration tool and then to the Database setup. Connected to SQL 2005.

Clicked on the Upgrade button. The upgrade fails and I always get the following errors:

"The database version (C.0.6.54) does not match your reporting services installation. You must upgrade your Reporting services database"

Then I get this exception:

System.Data.SqlClient.SqlException: Cannot find the user 'RSExecRole', because it does not exist or you do not have permission.
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.ReportingServices.Common.DBUtils.ApplyScript(String connectionString, String script)
at ReportServicesConfigUI.SqlClientTools.SqlTools.ApplyScript(String connectionString, String script)



I do not understand why it is looking for user 'RSExecRole', which is a role.



Appreciate your help

View 3 Replies View Related

Restoring A Sql Express Backup To Sql 2005

Jun 2, 2008

i'm trying to set up one of the asp.net website starter kits and part of the process is to backup the sql express db and then import it into the sql 2005 at the web hosting account.  it's not working and i'm wondering if there's any difference between the backups they make.  the sql express makes a file with a .bak extension and the sql 2005 at the host makes a file with a .sqlbak extension.  i was assuming that was just a naming thing and not a structural thing but the host's tech support has said:
"This sort of thing happens when the database being imported is not properly formatted. You can try downloading and using sql express from microsoft to see if you can do it manually, but most likely you will need to save your database again properly set for import to an mssql server rather than however you did."
all i had done was rename the .bak file from express to .sqlbak as that was the choice for backup files.
i will note that it also failed importing the .mdf, which works fine locally with the site but i did make some changes to it from the original that came with the starter kit.
should a backup file made with sql express (using sql management studio express, by right clicking on the file and choosing tasks > backup) normally be importable by sql 2005?
or, i suppose, does it make sense that a db that works fine locally with sql express (within a visual web developer express project anyway) would actually be "formatted" in a way that would cause it to fail to import into sql 2005?
thanks much for any assistance.

View 3 Replies View Related

Problem With Restoring An SQL 2K Backup On To SQL 2005

Oct 24, 2006

I am currently having a problem with restoring a backup made on SQL 2000 XP machine onto a Windows server 2003 machine with SQL Express 2005. I am getting the following error

"System.Data.SqlClient.SqlError: The operating system returned the error '5(Access is denied.)' while attempting 'RestoreContainer::ValidateTargetForCreation' on 'C:Program FilesAvidian TechnologiesProphetavidian.mdf'. (Microsoft.SqlServer.Express.Smo)"

I'm not sure what is going on becuase I have no issues installing the backup on my XP Pro machine that has SQL Express 2005 Dev edition. So what I did was restore the backup on to SQL Express 2005 on my dev machine and backup again. Unfortunately when I took the newly created backup and tried again to restore the database on to my window server 2003 machine it failed again. Exact same message was displayed.

Any suggestions or help would be greatful.

Thanks,
Rodney

View 1 Replies View Related

Restoring Differentials From 2000 To 2005

Oct 16, 2007

Hi Guys,
I have two servers at my site out of which one is our production server (on SQL 2000) and the other being a reporting server (SQL 2005). Now the question i have are the following..

Q1) Can i restore an hourly differential backup of my SQL 2000 to SQL 2005?
Q2) If yes, are there any specific way i need to go about it other than the conventional Restore with NoRecovery option?
Q3) If the answer is no to Q1, then is there any 3rd party software that does this(restoring differentials from 2000 to 2005)?


I had tried this once some time back and at that time it failed to keep the database in a state(norecovery) where in it would accept timely differential db restoration.

Appreciate your help

sk

View 5 Replies View Related

Restoring Linux ANSI_SQL To SQL 2005

Jun 12, 2007

Our firm needs to analyze some financial data for a client. They gave us a SQL database file in ANSI format. Is there a way to import this data into SQL 2005?



Thanks,



Steve

View 4 Replies View Related

Problems Restoring 2000 Db To 2005

Aug 22, 2005

Hello,

View 7 Replies View Related

How To Make HTTP Request From SQL 2005

Oct 28, 2007

Hi All,


I want to make a simple http request from SQL to a web server, something like this:
HTTP_REQUEST('http://www.domain.com/page.asp?var=value')
I don't want to get any response back, just a request.
Is there something like this in SQL 2005? or if anyone had wrote something like this.. I'll be greatfull if you can help me.

Thanks in advance

View 1 Replies View Related

Make Instalable For Sql Report 2005

Nov 13, 2007

Hi,
I made a sql report and deployed it on my system.Its working fine.
Now i need to install the same report on my client system.The client wants an installable package kind of thing which when runs installs all the report on that system.
How do i acheive this???
please help

View 6 Replies View Related

How To Make New Database Sql Server 2005!

Aug 29, 2006

i had no problems working whith sql server 2000
but whith 2005 i am unable to make new database!
question : HOW?
respond asap

View 1 Replies View Related

Db_owner?

Jan 31, 2008

when i try to create an ER diagram in VB Web Server Express it tells me that You do not have the required permissions..
What's up?

View 2 Replies View Related







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