Attach DB Fails If Not Located In Data Folder

Feb 4, 2008



Hi All:

Using SQL Express 2005.
I want to attach some *.mdf files that are located in a folder other than the SQL Server Data folder (for example, D:MyData). If I do so, then I get an error message that the files can not be updated because they are read only.
If I move the files to the SQL ServerData folder then they attach without errors and work fine.

Is there some way I can tell SQL Server to allow the attachments in my other folder as well?

View 7 Replies


ADVERTISEMENT

Rename All Files Located In Folder But Not Working?

Apr 24, 2015

SET nocount ON
DECLARE @fileNameNew VARCHAR(1024) -- filename of new error report
DECLARE @fileNameOld VARCHAR(1024) -- filename of old error report
DECLARE @out_fileDate CHAR(1024)
DECLARE @fileDate DATETIME -- used for file name

[code].....

View 0 Replies View Related

Can SA User Access Folder Located In Local System?

Mar 6, 2014

Is there any way sa user can access folder located in local system.

Server Info:
SQL Server 2008 r2
OS: Windows Server 2008

View 1 Replies View Related

SQL Server 2008 :: Create All Procedures Located In A Folder One By One And Saving Output File

May 15, 2015

I am asked to create 100 procedures to a database. Any best way to create them in a database one by one by calling the files and saving the execution output files in a folder?

View 9 Replies View Related

Send E-mail Attach All Files In A Folder

Dec 8, 2006

Is there a way to send an e-mail from SSIS that attaches all the files in a specified folder?

View 5 Replies View Related

.mdf File In Virtual Directory And Physical Folder, Which One Should I Attach To Sql Server Management Studio Express

Jun 26, 2007

I have a an asp.net application running under IIS. this application is using two folders, the virtual directory under C:Inetpubwwwroot and the application phisical folder at C:.
I want to manage this applications .mdf database using microsoft sql server management studio express(iam running sql express with advanced services) which means i have to attach the database to Ms sql server managemet studio express tool.
What i dont know is if i should attach the .mdf file in the physical folder's App_Data folder at C:myapplicationFolderApp_data or the .mdf file in the virtual directory under C:InetpubwwwrootMyapplicationFolderApp_Data
I dont know which of the two i should attach. Where exactly is the running database, the .mdf file in the physical folder or the .mdf file in the virtual directory under wwwroot.

View 3 Replies View Related

Attach Database Fails

Sep 20, 2004

Folks, i had a database with data and log file on seperate disks. After reboot, i've lost the log file; now i am trying to attache the data file using EM and QA, i get the following error; plz guide:

sp_attach_single_file_db 'production', 'd:production_data.mdf'

Server: Msg 1813, Level 16, State 2, Line 1
Could not open new database 'production'. CREATE DATABASE is aborted.
Device activation error. The physical file name 'D:production_log.LDF' may be incorrect.


Howdy!

View 2 Replies View Related

Osql Attach Db Fails With -S Option

Nov 1, 2005

Hi,

I am facing a problem with permissions while creating a database using script (i am using SQL Express database).

I am excuting a script using following command

osql -E -S <servername><instancename> -i <scriptpath> -o <log file name>

It is throwing the below error (copied from log file)
"1> 2> 3> 4> 5> 6> 7> Msg 1802, Level 16, State 4, Server DEV2SMSPUBTOOL, Line 3
CREATE DATABASE failed. Some file names listed could not be created.
Check related errors.
Msg 5123, Level 16, State 1, Server DEV2SMSPUBTOOL, Line 3
CREATE FILE encountered operating system error 5(Access is denied.)
while attempting to open or create the physical file 'C:Program
FilesMicrosoft Publishing ToolDATApubDB_Data.MDF'.
1> 2> 3> Msg 15010, Level 16, State 1, Server DEV2SMSPUBTOOL, Procedure sp_dboption, Line 64
The database 'pubDB' does not exist. Use sp_helpdb to show available
databases."

This problem occurs only if i give "program files" path for creating mdf and ldf files.
But i have admin previliges on the machine.
Can some doby suggest me if any other approach for creating database.

Thanks a lot for help

Krishna.s

View 1 Replies View Related

An Attempt To Attach An Auto-named Database For File (file Location).../Database.mdf Failed. A Database With The Same Name Exists, Or Specified File Cannot Be Opened, Or It Is Located On UNC Share.

Sep 2, 2007

Greetings, I have just arrived back into the country (NZ) and back into ASP.NET.
 I am having trouble with the following:An attempt to attach an auto-named database for file (file location).../Database.mdf failed. A database with the same name exists, or specified file cannot be opened, or it is located on UNC share.
It has only begun since i decided i wanted to use IIS, I realise VWD comes with its own localhost, but since it is only temporary, i wanted a permanent shortcut on my desktop to link to my intranet page.
 Anyone have any ideas why i am getting the above error? have searched many places on the internet and not getting any closer.
Cheers ~ J
 

View 3 Replies View Related

Detach/attach Move Fails To Bring Over Roles & Logins Correctly

May 23, 2001

A database move was accomplished by detaching the database from the legacy server and attaching it to the new server. The servers ran NT 4, SP6a, SQL 7 SP2. The new server had the same name and IP as the old server.

However that process (detach attach) does not bring over the users (who had access to the database on the legacy systems) correctly.

Under databases, roles the users existed. Under security, logins they did not.

We were obliged to drop the roles and recreate the logins and assign new roles. In the case of an NT user group we were unable to drop it. We had to create a new one and add the users to that group under User Manager.


So far I have not found anything that deals with the user account/role problem.

We have to move a similar database tonight. Do any of you know of an alternative "move" that brings the user roles/logins across correctly?

Thanks in advance.

View 4 Replies View Related

Data Files Not Located On SQL2000 Server

May 6, 2002

My company recently purchase a NetApp FS870 and we want to move the SQL data files for out production DB. The NetApp is a NAS. Without loggining in to the SQL Server and establishing a drive mapping.

Does anyone know how to connect SQL2K to the remote machine?

We would prefer to use UNC naming to access the share, as leaving servers logged in and open with a mapped drive is a huge secutrity hole, and presents a reliability issue too.

Thanks
Greg

View 1 Replies View Related

Attach Aspnetdb.mdf Failed, But I Can't Find Attach Statement In The Web.config

Nov 21, 2007

An attempt to attach an auto-named database for file C:WebApp_Dataaspnetdb.mdf failed. A database with the same name exists, or specified file cannot be opened, or it is located on UNC share.  
My web.config file, the connection strings
<connectionStrings>
  <add name="POAdatabaseConnectionString1" connectionString="Data Source=sss;Persist Security Info=True;Initial Catalog=POAdatabase.mdf;Integrated Security=SSPI"   providerName="System.Data.SqlClient" />
 </connectionStrings>
I cann't really find the statement for attaching aspnetdb.mdf. I don't where to find it. Is there any other web.config file in the C drive? Thanks for help!
 

View 3 Replies View Related

Unable To Copy App_data Folder Databases On Production Server To A Different Folder Or Location

Sep 19, 2007

I dont alot about sql server 2005(Express edition). For debugging purposes i want to copy  the whole app_data folder(.mdf & .log files) on the production server to another folder on the same machine(or sometimes to a network folder).  So when i copy and try to paste this App_data folder to a new location, i get this error message
"cannot copy ASPNETDB: it is being used by another person or program. close any programs that might be using the file and try again."
After reading the above message, i close visual web developer, stop the website in IIS and stop the SQLExpress service on the server and try again but still get the same message.
So how can i make sure that all the programs accessing these database files are closed such that i'm able able to copy them to a different location.

View 2 Replies View Related

Integration Services :: SSIS WMI Event Watcher Check For New Folder In Existing Folder

Jul 2, 2015

I know a WMI event watcher can be used to watch for a new file being added to a folder. However, I need to check for new folders being added to an existing folder. I haven't been able to find a post on doing this. Is there a way in WQL to check for a new folder being added instead of a new file? I've used SQL for years, but am new to SSIS.

View 2 Replies View Related

SSIS Or SQl Agent Job Moving From A Network Folder To A Sharepoint Folder - Errors...

Oct 31, 2007



Ok,

I have a network folder called A

I have a SharePoint (2007) Document Library site called B. Web Client is enabled on the server and B is mapped as a Drive (let's call it Y for this discussion)

I want to move documents in A to B. Easy enough, right? Not so....

I first started by creating a batch file that issues a COPY \A \Y /Y at the command prompt. Viola! Worked Great!

I then moved that command to a SQL Agent job as a CMDExec statement (exact same statement) and attempted to run it.....CRASH! It found the files in A but then said "The system cannot find the path specified"

Ok, so I tried it in SSIS. CRASH! Checked the error log. Same thing...

So I then checked the account under which the SQl Agent was running (special domain account for all our SQL Servers). Thinking it might mater I changed it to run under my name (I'm in Domain admin). I also ensured I had permissions to the SPS 2007 library as well. (I did).

Ran again! CRASH! Same error....

So, I created a batch file , placed thec ommand in the batch file and ran that from the command prompt! Viola! Worked Great.

So, I was thinking of how ingenious I was as I pasted my C:RootCopy.bat into my SQL Agent job. With a big grin on my face I right clicked and picked "Start Job at step".......CRASH! Same error.

Does anyone have any ideas on this ???????????????

Thanks,
Stephen

View 3 Replies View Related

Attach Data File

Nov 23, 2004

I have MS SQL server database with two files
1- x_data.mdf, 2- x_log.ldf
The database become suspect and i have no space problem.
now the problem is that the log file become corrupted because when i stop the database service I tray to copy the log file into another place but I can't
Now the result is that I have one data file x_data.mdf and how can I solve the problem
and the question is how can I back the data again when I have a data file without a log file
Thanks

View 1 Replies View Related

Can I Use The Foreach Loop To Obtain The Sub Folder Names Within A Folder?

Sep 4, 2006

I have a set of folders with the following structure:

MainFolder

1999

SpreadsheetA.xls

SpreadsheetB.xls

SpreadsheetC.xls

2000

SpreadsheetA.xls

SpreadsheetB.xls

SpreadsheetC.xls

etc.

Is there a way that I can use the foreach loop container to loop the sub folders? My plan was to get the folder name and path into a variable, use this to build the connection string for each file in this folder, carry out the upload for that folder, then move onto the next folder and do the same thing, but I cannot see a way to do this.

Thanks,

Sam

View 2 Replies View Related

If C:folder.. Contains Data Then Do..

Oct 10, 2001

hi, I am curious to know if I can do the following from within a store procedure.

If I have a folder under c drive c:clientand would like to check if there is any files inside the client folder, how can I write such code in sql into a store procedure. I want to do some actions like expoft table data (bcp) into the client folder if there is no text files..... I do appreciate your help

Ali

View 1 Replies View Related

How To Use An Folder As Data Source

May 15, 2008

Hi

I need to use .txt files as data source, those files are in same folder. Now I connect to them with ODBC, and allow client select which file they want to view by input the name of file as a parameter.
The problem is all those file are tabdelimited and the default of ODBC driver is CSV delimited. So once new file is added in the folder, we must refresh the ODBC otherwise the drive will deal all the data as one column.

Are there any better solution for this case?

View 6 Replies View Related

Where Data File And Log File Located???

Feb 20, 2004

Hi all,
I want to create a database on a computer but datafile nad transaction log file located on the other computer.
please show me,
best regard.

View 2 Replies View Related

Access File/Get Data Can't Attach To A SQL Table.

Jul 20, 2005

In Access 97, I am trying to attach to a table in my SQL Server 2000db.I use File/Get Data, which displays all the SQL tables including theone I can't attach to. (I can attach to all the other SQL tables.)But, when I select that table I get a message that tells me the nameis invalid. I don't understand this because it gives me the name inthe Get Data dialog, and I don't have to enter it manually.Any ideas?Thanks,Bob C.

View 3 Replies View Related

MS SQL Server 2005 Data Folder

Sep 22, 2006

It seems SQL Server 2005 can store data in both C:Program FilesMicrosoft SQL ServerMSSQL.1MSSQLData and C:Program FilesMicrosoft SQL ServerMSSQL.2MSSQLData. But what's the difference of the 2 folders? I accidentally found identical mdf files in the two folders and got confused. Thanks.

View 2 Replies View Related

Can't Restore To Custom Data Folder

Jun 3, 2008

I am having a problem with a client's MS SQL Server 2005. When doing a restore, SQL will not allow me to restore to the database mdf and ldf files outside the SQL root folder (C:Program FilesMicrosoft SQL Server). I want the data and log files to be on a separate disk with plenty of disk space. When I created the database, SQL allowed me to create the mdf and ldf files in the E:Data SQL ServerData folder. But when I perform the restore SQL reverts to the C:Program FilesMicrosoft SQL ServerMSSQL.1MSSQLData folder. I am specifically redirecting the mdf and ldf files to the custom folder by clicking on the button (...) to change the folder.

I have tried creating a new SQL Server instance and uninstalling and reinstalling SQL Server to no avail.

How can I force the restore task to restore my database to the custom data folder location?

Thanks

View 10 Replies View Related

How To Specify The MSSQL.1 DATA Folder In SQL Express?

Aug 2, 2007

How do you determine the data folder during the SQL2005 Express install?
No matter what folder I start with it gets appended with MSSQL.1 or MSSQL.2
If another vendor has installed a different instance of SQL2005 how do I know whether mine is .1 or .2 ?

Basically I need to know the full folder in order to copy our MDF/LDF files into so we can attach them.

Or is there another way?

Thanks.

Graham

View 7 Replies View Related

Use Bcp To Output Data To A Compressed (zipped) Folder

Jan 25, 2007

Hi all,

I am trying to use bcp to output data to a compressed (zipped) folder.
The bcp command is called from a step in scheduled job in SQL 2005 (T-SQL) similar to:

SET@chvCommand =
'bcp [working_t] out D:EprojectsEdataCdata200701.dat'
+ ' -c -STPISQL -T'

EXECUTE master.dbo.xp_cmdshell @chvCommand, NO_OUTPUT

.... where Cdata is a compressed (zipped) folder.
The scheduled job seems to work without errors, but afterwards there is nothing in the compressed folder.
If Cdata is a regular folder everything works fine.


Thanks for you insight.

View 8 Replies View Related

Automatic SQL Queries To Dump Data To Folder

Nov 2, 2005

Hey everyone, trying to set up a SQL Query to run on a pre-determinedbatch cycle that will automatically dump out specific table data to a..csv file so that users can load the file into Excel right away, withno manipulation or modification.We are running SQL Server 2000. I am a novice SQL user. Anysuggestions?

View 2 Replies View Related

How To Automate Cleaning The Data In Repldata Folder

Feb 23, 2006

hi everyone,

can any one suggest me how to clean the 'REPLDATA' folder created during snapshot replication. i want to automate the process.

can anyone suggest any undocumented sp like

'sp_MSDelete_publisherdb_trans'

thanks



View 9 Replies View Related

Help Understanding .cer File Found In DATA Folder

Nov 5, 2007

What is the purpose of the .cer file found in MSSQL.1MSSQLData? Something to do with encryption, but what?


Why do I see as many as three .cer files on a server?


Thanks, Dave

View 1 Replies View Related

Data Driver Subscriptions At The Folder Level

Nov 1, 2007



HI All,

I have created around 150 reports using SSRS. I just made a new data drive subscription(file sharing) using report manager. Now I'm wondering is there any option to make subscription at the higher level? That means instead of subscribing one report by one report , can I do it at the folder lever using report manager without writting a programm?

Thanks

View 2 Replies View Related

SSRS Missing/hidden Data Source Folder

Oct 19, 2007

I have inherited a SSRS setup and am trying to do some clean up. Problem is I cannot see the Data Sources Folder. I am setup as SA and SU on both the RS Server and SQL Server. When I go check the catalog in SQL db it does truly exist as well as a number of data sources in the folder that reports are currently using. How can I see this folder?

View 7 Replies View Related

Integration Services :: Data Folder Not Loading With New Project

Jun 30, 2015

When creating a new integration project, the data folder to create a new data source does not load. 

View 5 Replies View Related

Moving Csv File From One Folder To Another Folder

Mar 28, 2008

I am having problem with moving a file from one folder to another folder. Here is the detailed scenario:

I want to move a input.csv file from shared input folder to shared archive folder. i am using the below code to do this.
declare @inpath varchar(100)
SET @inpath = 'move "\abcdefINPUTinput*.csv" "\abcdefARCHIVEarchive.csv"'
EXEC @filestatus = master..xp_cmdshell @inpath
but the problem was it was cutting the input.csv file from INPUT folder but not pasting it in the ARCHIVE folder.
I really appreciate if anyone can help me to solve this or anyone can tell some workarounds.

Thanks,

View 20 Replies View Related

Reporting Services :: Data Source Account And Folder Access

Apr 28, 2015

I have a question about ssrs security. In report manager I have set a list of users as browsers, and the builtin administrators are content manager in the parent folder where reports are. A user that is not an administrator and neither a user I added, has access to reports.

I'm thinking this person is having access because the data source of the reports use a administrator account to connect to the analysis services  using the option Credentials stored securely in the report server with the 2 checkboxes marked (use as windows credentials when connecting to the data source and impersonate the authenticated user).

I simply marked this option because SSRS is in 1 server and SSAS in other and I think kerberos need to be configured and I haven't looked into it, but I think the report access is separated from the data source.

View 2 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved