Home All Groups Group Topic Archive Search About

Error in SQL 2005 Maintenance Plan

Author
17 Feb 2006 11:25 PM
The Cornjerker
I'm trying to setup a nightly backup to a remote computer using an SQL
Server 2005 Maintenance Plan.  It keeps giving an error.  I've narrowed
the cause down to an execute command...

EXECUTE master.dbo.xp_create_subdir
N'\\\\10.2.32.15\\Backup_SQL2005\\\\IOC'

which is giving the error below...

Msg 22048, Level 16, State 1, Line 0
xp_create_subdir() returned error 123, 'The filename, directory name,
or volume label syntax is incorrect.'

I am signed on as administrator on both computers.  I'm able to map a
drive though the Windows Explorer and create a subdirectory on the
remote machine.

I have also tried...
EXECUTE master.dbo.xp_create_subdir N'\\10.2.32.15\Backup_SQL2005\IOC'
EXECUTE master.dbo.xp_create_subdir N'\\GOMB-BACKUP\Backup_SQL2005\IOC'
EXECUTE master.dbo.xp_create_subdir N'G:\IOC'  (after mapping a drive)

This works...
EXECUTE master.dbo.xp_create_subdir N'C:\IOC'
....but of course it's on the local computer.

Any ideas why this doesn't work?

Thanks,
C

Author
18 Feb 2006 8:35 AM
Tibor Karaszi
The stuff you do in Explorer uses the Windows account *you* have logged in with. The stuff that SQL
Server does uses the Service account for the SQL Server service. Verify that the service account has
proper permissions.

Show quote
"The Cornjerker" <add***@gmail.com> wrote in message
news:1140218704.513963.300930@g44g2000cwa.googlegroups.com...
> I'm trying to setup a nightly backup to a remote computer using an SQL
> Server 2005 Maintenance Plan.  It keeps giving an error.  I've narrowed
> the cause down to an execute command...
>
> EXECUTE master.dbo.xp_create_subdir
> N'\\\\10.2.32.15\\Backup_SQL2005\\\\IOC'
>
> which is giving the error below...
>
> Msg 22048, Level 16, State 1, Line 0
> xp_create_subdir() returned error 123, 'The filename, directory name,
> or volume label syntax is incorrect.'
>
> I am signed on as administrator on both computers.  I'm able to map a
> drive though the Windows Explorer and create a subdirectory on the
> remote machine.
>
> I have also tried...
> EXECUTE master.dbo.xp_create_subdir N'\\10.2.32.15\Backup_SQL2005\IOC'
> EXECUTE master.dbo.xp_create_subdir N'\\GOMB-BACKUP\Backup_SQL2005\IOC'
> EXECUTE master.dbo.xp_create_subdir N'G:\IOC'  (after mapping a drive)
>
> This works...
> EXECUTE master.dbo.xp_create_subdir N'C:\IOC'
> ...but of course it's on the local computer.
>
> Any ideas why this doesn't work?
>
> Thanks,
> C
>
Author
19 Feb 2006 10:46 PM
The Cornjerker
Tibor, thanks for the replay.

How do I give the Service account access to create remote
subdirectories?

C
Author
19 Feb 2006 11:27 PM
Erland Sommarskog
The Cornjerker (add***@gmail.com) writes:
> Tibor, thanks for the replay.
>
> How do I give the Service account access to create remote
> subdirectories?

As you would to for any other Windows user. (Which if you don't know is
a question for a Windows newsgroup. I hardly know it myself.)

Note howver, that you cannot do this if SQL Server is running under
Local System. In this case you need to change which account under which
SQL Server is running. To do this, right-click My Computer, select Manager,
find Services, and there find the SQL Server service. Double-click, and
log-on information is on the Log On tab.

If you are using SQL 2005, you should use the SQL Computer Manager instead.




--
Erland Sommarskog, SQL Server MVP, esq***@sommarskog.se

Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/prodtechnol/sql/2005/downloads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinfo/previousversions/books.mspx
Author
2 Mar 2006 4:02 PM
The Cornjerker
Erland,

Thanks for the replay.  Are there any disadvantages to running the
MSSQLSERVER service under the Administrator account?

C

AddThis Social Bookmark Button