sql server2005 back up error : access denied - sql-server-2005

I am trying to backup my sql server 2005 database using the query
backup database marksheet to disk='e:\backup\marksheet.bak'
when i execute the query it shows the following error
cannot open backup device 'e:\backup\marksheet.bak' operating system
error 5(access is denied)
I am using windows xp
please help me..

The account running the SQL Server service does not have access to that folder.
It doesn't matter if you have access to that folder.

You need to check the security permissions on the folder you are trying to backup to. Make sure the service account (Network Service) has write permissions. It may well not do.
SQL on changing the service account changes the permissions on the critical drives it knows about but won't do it for all the drives in a server.
Try adding the domain account that runs all SQL Services to the security of "e:\backup\".

Related

Bulk insert from share folder

I have share folder in server A with permissions.
and I'm trying to use bulk insert from server B.
I've also added network location to server 'B' with 'A'(trying to use the local path - but nothing).
using sql server 2008 r2
the SQL authentication is: Sql server.
In addition there is no domain controller to those servers, but obviously there are under the same network .
the error is:
Cannot bulk load because the file \\\server\folder\file could not be opened. Operating system error code 5(Access is denied.).
what can I do?
thanks
The SQL Server process identity (service account) security context is used when the BULK INSERT T-SQL statement is invoked from a SQL authenticated connection. Without a domain infrastructure, you will need to either allow Everyone access to the file and share or create a local Windows account on both servers with the same account name and password. Use that local Windows account as the SQL Server service account (specified via the SQL Server Configuration Manager).

Connecting to a SQL Server with SQL Server Managament Studio

I have looked everywhere on Stack Overflow and I have not found an answer that closely compares to my scenario, so please bear with me.
The issue is I was recently given a development server at work and I have to migrate my current project (which I have on SQL Server Management Studio running on SQL Server Express) so that it is hosted on that server. I was just given the server name and authorized access to it. So I can connect to it through Remote Desktop Connection (RDC), but I am clueless as to where to go from here.
I have tried going in through RDC and opening Management Studio from there but when plugging in my server name and using Windows Authentication it doesn't let me in. And I can't use SQL Server Authentication because I'd have to be actually in to be able to create an SQL login.
How can I connect to this server through Management Studio?
The server is in the same network? In the management studio, in server name, you can put a IP address or computer name.
Do you know if SQL is even installed on the server you are tasked to deploy to? You are able to "connect" to SQL Express locally because the instance is installed on your local machine. You will need an instance of SQL installed on the remote machine to be able to use SSMS to connect to the remote instance.
If you are attempting to connect to an already created DB that you have been using the credentials are the same, if you know the address and you have the ports opened on your computer to allow the connection. If you are going to start a new DB on the server, then you will have to connect via AD credentials IF your admin has given you the proper access. I personally suggest using AD credentials to create connections, it's just a lot more secure.
If you are trying to connect to the local db, then it should be on the drop down list on the log in screen.
You are going to have to talk with your admin who set it up if you are still having problems.
You might have to Enter your Server Details in the Hosts File on the Current Application Server
For Accessing Hosts File,
Go to Run and type drivers and Hit Enter. Go to the etc Folder and you will see hosts file in the Folder.
At the End of the File Enter the Server IP And Server Name
Save the file and try Logging into the Server Management Studio again
Hopefull, this would help

SQL Server 2008 database Publishing Wizard

I'm trying to run a database import using the Copy Database Wizard Tool from SQL Server Management Studio in SQL Server 2008.
I have connected to my database using the sa account and when I run the process I used the sa account on both the source and destination database.
All the processes are failing with
Event 18556, Login failed for user '{domain}\administrator'.
Reason: Failed to open the explicitly specified database. [CLIENT: ]
The SA account should have sufficient rights to import the database and the administrator account definitely has the rights.
So, the first question is, why is the administrator account even mentioned since everything is run as SA?
The second question is, why is the administrators account failing to open the explicitly specified database, when that account has total control of all databases on the destination server?
Finally, what exactly is the specified database? There is data in the binary portion of "event log" that points to Master but no mention of the database anywhere else.
Are you connecting to SSMS using pass through authentication? Your wizard will run as your user I believe if so. Connect to your database server in SSMS using the sa account and then try launching it.
Give it a valid account to the other database, sa needs access locally, the 2nd account needs access on your other SQL server.
Alternatively, make sure your domain user has access to the database in question (not the server, the db is dif.) and run it that way.
The master db is where all the sys tables reside, it's the overlord db so to say: http://msdn.microsoft.com/en-us/library/ms187837.aspx

Accessing Database with windows service

I was implemented a windows application which is working perfectly.
The concept is to read an Access Database and export to MS SQL Server 2005 Database.
Now i want to make it as windows service and half way done. The problem is it is not working (Not updating the database).
The service was installed perfectly and running but not updating the database. I made that service as "Local Service", "Network Service", "Local System" and "User" bu not working for any of this type.
Can any one help me out for solving this.
The development environment is MS Visual Studio 2005, C#.NET, MS Access, MSSQL SERVER 2005 and Network supported Environment.
Thanks.
You could do this with Linked Server or an SSIS job running on SQL Agent which may well have been easier but... to tackle your question itself:
You mention trying different accounts to run the service - have you granted any of those accounts the appropriate rights on your target database to allow the service to update the data. Do they also have rights on your source (Access) database to read it.
Have you checked the Event Logs on the server and the SQL Server logs to look for reported errors, failed logins etc?
You could hook up the debugger to your running service to try and identify the problem whilst it's running or alternatively you need to write in some kind logging statements so that you can identify where your code is getting up to before it fails and log out the error message(s) so give you something to work with.

Database Replication MSSQL 2000 to 2005

I am trying to replicate a database from SQL server 2000 to 2005 they are located on two different servers both running Windows Server 2003 R2. Im am using SERVER1(SQL2000) as the Transactional publisher and distributor and SERVER2(SQL2005) is the subscriber. I can set up the publication and subscription but when I try to syncronize them I get the following error:
SERVER1-TestReplication-TestReplication-IBSCNVII-ReplicationCNVII_2-99956FE2-402A-48D5-B801-2CBADF12BD3E has server access (reason: Could not obtain information about Windows NT group/user '', error code 0x5. [SQLSTATE 42000] (Error 15404)).
Do I need to add my domain user to a certain user group on server? Any ideas?
0x5 means "access denied" and that you're not allowed to query active directory user information. Likely, the sql server service account does not have proper domain privileges to perform look ups in AD. This could be caused by an account password simply being expired and therefore not enabling SQL to validate against AD or some other issue like services running as local system and not a domain account.
I would recommend confirming that both SQL servers are using a valid domain account and not something like local system. Then check that that domain account isn't locked up or expired.
make sure that the service account you are using to execute the replication has the appropriate rights to both your SQL servers
Aye, check your SqlAgent account in services.msc. Make sure it is a user with rights (in the domain and in SQL). If that fixes it, make sure you lookup the minimum rights required before you go into production.