Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Database & SysAdmin
  3. Database
  4. Create database to share folder

Create database to share folder

Scheduled Pinned Locked Moved Database
databasehelpsql-serversysadmin
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • N Offline
    N Offline
    ndkit
    wrote on last edited by
    #1

    Hi all, Currently, I used SQL Server 2008 to create database on share folder as below query: DBCC TRACEON (1807,-1) CREATE DATABASE 20100914 ON (NAME="20100914_dat",FILENAME="\\HOST1\SHARE\20100914_DATA.MDF") LOG ON (NAME="20100914_log",FILENAME="\\HOST1\SHARE\20100914_LOG.LDF") with \\HOST1\SHARE has full permission for all person. When I run above query, the error is shown: System.Data.SqlClient.SqlException: Directory lookup for the file "\\HOST1\SHARE\20100914_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. Pls help me to solve it if you know. Thanks a lot.

    L 1 Reply Last reply
    0
    • N ndkit

      Hi all, Currently, I used SQL Server 2008 to create database on share folder as below query: DBCC TRACEON (1807,-1) CREATE DATABASE 20100914 ON (NAME="20100914_dat",FILENAME="\\HOST1\SHARE\20100914_DATA.MDF") LOG ON (NAME="20100914_log",FILENAME="\\HOST1\SHARE\20100914_LOG.LDF") with \\HOST1\SHARE has full permission for all person. When I run above query, the error is shown: System.Data.SqlClient.SqlException: Directory lookup for the file "\\HOST1\SHARE\20100914_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. Pls help me to solve it if you know. Thanks a lot.

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      Error 5 indicates that the access has been denied; your share probably needs a username/password combination. If you want to share your data, create a TCP/IP connection to the server from a remote machine, putting the database on a unc-path is asking for problems;

      MSDN states:[^]

      If access to a disk resource requires that a share be mapped, or if the disk resource appears as a remote server through a UNC path, (for example, \\Servername\Sharename), on the network, then by default, the disk storage system is not supported as a location for SQL Server databases.

      I are Troll :suss:

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups