Solved

SQL SERVER Express backup batch file problem

Posted on 2010-11-22
3
954 Views
Last Modified: 2012-05-10
Created the folling batch file to backup SQL Server Express DB. If I copy to the c:\program file\SQL Server folder and run it works but from a folder called c:\mssqlbackup\ it does not. What permissions in windows or sql server do I need to run this?

'--------------------------------------------------------------------------------------------


C:\Documents and Settings\glennr>sqlcmd -S GLENN\SQLEXPRESS -Q"EXEC expressmaint
 @database = 'test1', @optype = 'DB', @backupfldr = 'C:\Program Files\uniPoint\C
lient\DB\Backups\', @reportfldr = 'C:\Program Files\uniPoint\Client\DB\Backups\'
, @verify = 1, @dbretainunit = 'months', @dbretainval = 1200, @rptretainunit = '
months', @rptretainval = 1200, @report = 1"
Error  Source Description HelpFile HelpID
------ ------ ----------- -------- -----------
0x800A NULL   NULL        NULL               0
Msg 50000, Level 16, State 1, Server GLENN\SQLEXPRESS, Procedure expressmaint, L
ine 304
Error creating log file

0
Comment
Question by:glenn_r
  • 2
3 Comments
 
LVL 58

Expert Comment

by:cyberkiwi
ID: 34191840
SQL Server by default runs with limited permissions.  The account used to start the SQL Server service does not permissions to make changes (create .ldf file) in where you want to put it.
Using Control Panel, Admin Tools, Services applet, go to SQL Server and check the startup account, and give permissions to that account in Windows Explorer, folder permissions, Security.
0
 
LVL 58

Accepted Solution

by:
cyberkiwi earned 125 total points
ID: 34191841
SQL Server by default runs with limited permissions.  The account used to start the SQL Server service does not permissions to make changes (create .ldf file) in where you want to put it.
Using Control Panel, Admin Tools, Services applet, go to SQL Server and check the startup account, and give permissions to that account in Windows Explorer, folder permissions, Security.
0
 

Author Closing Comment

by:glenn_r
ID: 34192549
Thanks for the quick and thourough response.
0

Featured Post

Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Help with simplifying SQL 6 54
Alert on Server memory 2 45
Hyper-V won't start Server 2003 as a guest OS 7 100
Using this function 4 40
by Mark Wills Attending one of Rob Farley's seminars the other day, I heard the phrase "The Accidental DBA" and fell in love with it. It got me thinking about the plight of the newcomer to SQL Server...  So if you are the accidental DBA, or, simp…
INTRODUCTION: While tying your database objects into builds and your enterprise source control system takes a third-party product (like Visual Studio Database Edition or Red-Gate's SQL Source Control), you can achieve some protection using a sing…
Attackers love to prey on accounts that have privileges. Reducing privileged accounts and protecting privileged accounts therefore is paramount. Users, groups, and service accounts need to be protected to help protect the entire Active Directory …

749 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question