title: Create Database FILENAME attribute
body: <p>I have a web application, which does DB export (<code>export.asp</code>) and import (<code>import.asp</code>).
  In the <code>export.asp</code> I am trying to create a folder first using VBScript.</p>
  
  <pre class="lang-vb prettyprint-override"><code>If Not fs.folderexists(Path) Then
      fs.createfolder Path
  End If
  </code></pre>
  
  <p>later perform the SQL <code>CREATE DATABASE</code> using query</p>
  
  <pre class="lang-sql prettyprint-override"><code>Use master CREATE DATABASE DB_LOG ON (
      NAME = 'filename_LOG_Data',
      FILENAME = 'c:\PAth\filename_LOG_Data.mdf',
      SIZE = 153
  ) LOG ON (
      NAME = 'filename_LOG_Log',
      FILENAME = 'c:\Path\filename_LOG_Log.ldf',
      SIZE = 1
  ) EXEC sp_dboption 'DB_LOG', 'bulkcopy', 'TRUE'
  </code></pre>
  
  <p>With this I am able to create the required .MDF and .LDF files in the mentioned path, however when I try to import the same by selecting filename_LOG_data.mdf from File browse window, I am getting the below error.</p>
  
  <blockquote>
    <p>You don't have permission to open this file. Contact the file owner or the administrator to obtain permission.</p>
  </blockquote>
  
  <p>I am the administrator on the machine. when verified the security settings for both 'Path' folder and .MDF &amp; .LDF files, the security settings (user, groups) are properly set for 'Path' folder, but for the files created with SQL query the security tab in file properties shows "You must have Read Permission to view the properties of this object".</p>
  
  <p><a href="https://i.stack.imgur.com/b2bqg.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/b2bqg.png" alt="Security properties on .mdf file: &quot;You must have Read Permission to view the properties of this object&quot;"></a></p>
  
  <p>Question: how to make the SQL <code>CREATE DATABASE</code> query create the files with permissions set properly (or) is there any other way to set the security settings.</p>