Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2008 Forums
 Transact-SQL (2008)
 problem creating database over UNC path

Author  Topic 

gico2107
Starting Member

3 Posts

Posted - 2010-09-15 : 03:42:42
I'm having problem with running SQL statement like below:

DBCC TRACEON (1807, -1)
CREATE DATABASE FILE ON (NAME="file_dat", FILENAME="\\host1\share\file_data.mdf") LOG ON (NAME="file_log", FILENAME="\\host1\share\file_log.ldf")

If I run this SQL statement on a Vista x64 and host1 is Vista x64 too, then the database is created successfully.
If I run SQL on a Vista x64 or XP x86 and host1 is XP x86 then the database is failed to create with error like below :

Directory lookup for the file "\\HOST1\SHARE\FILE_DATA.MDF" failed with the operating system error 5(failed to retrieve text for this error. Reason: 15105).
CREATE DATABASE failed. Some file names listed could not be created. Check related errors.
DBCC execution completed. If DBCC printed error messages, contact your system administrator.

I have shared \\host1\share with Full Control permission for Everyone.

RickD
Slow But Sure Yak Herding Master

3608 Posts

Posted - 2010-09-15 : 04:26:06
That will be Vistas UAC, not sure you can get around this unless you disable the UAC.

http://lifehacker.com/230866/windows-vista-tip--disable-annoying-need-your-permission-to-continue+-prompts
Go to Top of Page

gico2107
Starting Member

3 Posts

Posted - 2010-09-15 : 22:08:33
Thanks for your reply, but I've already turn off UAC on Vista and also the fire wall on all testing PCs.
Go to Top of Page

gico2107
Starting Member

3 Posts

Posted - 2010-11-04 : 05:32:10
I've solved this.
The problem is user permission under XP machine.

First you need to Logon SQL service with a domain user. Then add that user to the administrator group on the target PC.
Then you can run the SQL to create file on the shared folder.
This problem just happen on the XP. If both PC are Vista, no need to do this.
Refer to : http://support.microsoft.com/kb/555128

We also need to turn on the trace flag 1802, when you want to overwrite an existed file. This problem seem to be solved under SQL 2008 R2
Refer to: http://support.microsoft.com/kb/922804
Go to Top of Page
   

- Advertisement -