Changing Directory Where Database Files Are Stored

Aug 31, 2007

Hi
After install the mdf and log files are stored in the Program Files directory tree.
How do I change the place were they are stored to a path of my own choice, so that new DBs get created there too?
I've looked though the docs, but I can't find this.
Thanks
John

View 1 Replies


ADVERTISEMENT

Changing Default Directory For Stored Procedures

Oct 21, 2006

I want to change the default directory for my stored procedures. It is extremely inconvenient for me that they are placed in documents and settings... I cannot find a place in the Tools where I can change it.

Thanks.

View 5 Replies View Related

How To Delete Old Files Stored In A Directory?

Jan 7, 2003

Hello,
How to delete old files stored in a directory using dos script?.
I appreciate your feedback.
Thanks,
Ravi

View 7 Replies View Related

Storing Files To Server, Directory Or Database, Which Is Better?

Feb 9, 2007

Which is better, to store the files onto the server's folders or to a database?
I tried storing to MSSQL 2000 but the varbinary does not allow me to set "MAX" for the data type.
 

View 1 Replies View Related

Changing Location For Transaction Log Directory

Nov 7, 2007

Hi Experts,
Can we change the transaction log directory to a different location?
If so Can any help to know how it is possible?

View 18 Replies View Related

Changing Database Within A Stored Procedure

Jul 20, 2005

I need to create a stored procedure in the master database that canaccess info to dynamically create a view in another database. Itdoesn't seem like it should be very hard, but I can't get it to work.Here's an example of what I want to do.CREATE PROCEDURE create_view @dbname sysnameASBEGINDECLARE @query varchar(1000)SELECT @query = 'use ' + @dbname + ' go CREATE VIEW ........'EXEC(@query)ENDIn this case, I get an error with the word "go". Without it, I get a"CREATE VIEW must be the first statement in a batch" error. I tried asemicolon in place of "GO" but that didn't help either.Thanks

View 4 Replies View Related

Get The Specific Files From Directory

Nov 6, 2007

Hi,
      I have some some files names in SQL DATABASE but my actuall files are keep in a seperate folder. so please help me that becasue i dont know that how i can select the specific files from folder and fetch into the imageArray according to the database table. In my coding its get the all files from directory but i want to get from database with where class and then select from directory.
The structure of my table is
create table event_pic(  event_sub_id integer,  event_pic_name varchar(50) )
here is code below:
Sub displayMe()      dim con as new SQLConnection("server=london-home; Database=tony; uid=rashid2; pwd=test; ")    dim cmd as new SQLCommand("select * from event_pic where event_sub_id='5' ",con)       con.open()    dim SDR as SQLDataReader SDR = cmd.ExecuteReader()       con.close()            Dim imageArray() As String        Dim i As Integer                ' grab full path and file of images on server in images folder        imageArray = Directory.GetFiles(Server.MapPath("upload/"), "*.*") 
       ' remove the full path from the image filenames        For i = 0 To (imageArray.Length - 1)            imageArray(i) = Replace(imageArray(i), Server.MapPath("upload/"), "")                    Next                 ViewImages.DataSource = imageArray        ViewImages.DataBind()                    End Sub

View 15 Replies View Related

Deleting Files In A Directory More Than 200

Dec 1, 2003

http://forums.databasejournal.com/showthread.php?s=&threadid=29895

View 2 Replies View Related

Delete Files From Directory?

Nov 15, 2014

how can I delete files, which are allready imported into a database. I have a folder with 600,000 files . All Files should be in a database. And I want to delete the files that are found in the table with filename . How can I make the ?? The Filename and physicals Name is the same so i can say table.filename=physical.filename.

View 20 Replies View Related

Get List Of Files In Directory Using A SP

Jul 23, 2005

Is there an XP/SP out there that will return a list of files residingin a specified directory?I'm looking for something simlar toExecute master..xp_subdirs N'C:'But instead of it returning a list of subdirs I want it to return alist of files in that directory.Jeff

View 5 Replies View Related

Deleting Files In A Directory More Than 200MB

Dec 1, 2003

Hi,
I have posted a request regarding deleting the file more than 1 month old that we have discussed in bleow URL.

http://forums.databasejournal.com/showthread.php?s=&threadid=29895

My new request is I have enabled C2 Audit mode and wanted to delete old files that is more than 200MB.
Could you Please give me a query ?.
Thanks,
Ravi

View 2 Replies View Related

Copy Files Into Same Destination Directory

Mar 14, 2008



Hi,

How do I copy files from several subdirectories into the same directory? I have about 80 subdirectories of a parent directory from which I want to copy the files and place the copies into the same, flat destination directory. I tried using the copy file and copy directory file system tasks, but this always seems to recreate the subdirectory structure under the destination directory.

How can I get around this in SSIS?

Thanks in advance,

Bruce.

View 6 Replies View Related

SSIS - Best Way To Copy Files From One Directory To Another

May 8, 2007

In SSIS, I was to:

take files from c:directory1
copy them to cirectory2 with a different name (concatenated date on the end)
delete them from c:directory1

Should I be using the Script Task for this? I am wondering if I should be using the File System Task which copies directories or files, but I don't know if I could rename the files during the copy.



Also, I want the directory names to be in the configuration file. I am not sure how to do this. If I set up a flat file source connection, I need to specify a file name and I just want the directory names. How do I get them in the config file and how to I read them into my script from the config file?



Linda

View 25 Replies View Related

How To Load And UnZip Files From FTP Directory

Mar 5, 2008



HI All,
I have Uzip Files to be loaded From ftp.companyname.com, the zip files get updated everyday thus i have to load the newly added files, the Zip file has got 13 text Files within it, the issue is:
1. how do i load it for the new zip file only, the zip files are shown below, i am trying using FTP Task, but need more info.
2. How do i UnZip it and and take the text files and then load them to sql server 2005, each text file has to be loaded to sql server tables.
3. How do i automate it, i mean every time i run the package (on Job based) it has to look the new file only, see the zip file below to understand what i am saying about.

02/25/2008 09:02PM 2,780,729 CompanyName_2008-02-22.zip
02/27/2008 09:04PM 1,274,557 CompanyName_2008-02-23.zip
02/25/2008 08:57PM 1,383,112 CompanyName_2008-02-24.zip
02/26/2008 04:21PM 3,327,882 CompanyName_2008-02-25.zip
02/27/2008 08:44PM 3,623,334 CompanyName_2008-02-26.zip
02/28/2008 05:27PM 3,570,243 CompanyName_2008-02-27.zip
02/29/2008 04:20PM 3,444,375 CompanyName_2008-02-28.zip
03/01/2008 04:17PM 2,655,782 CompanyName_2008-02-29.zip
03/03/2008 04:09AM 1,179,338 CompanyName_2008-03-01.zip
03/03/2008 05:21PM 1,267,777 CompanyName_2008-03-02.zip
03/04/2008 04:49PM 3,238,121 CompanyName_2008-03-03.zip


As you can see the Zip file names are the blues color, they are added at different time, thus what i need is only the current Zip file (i mean i have to Load only the newly added Zip file (recent one)). Thus the SSIS Task has to go to this FTP server and look the newly added zip file. After that i have Unzip it b/se i have 13 text files there, and then Load them to Sql Server 2005.

Please get help on this, the deadline is near by time, if possible try as soon as possible, I would like to say Thank you for every help you do and try.
Thanks,

View 1 Replies View Related

How To Add Multiple A Directory Tree Of Aspx Files

Nov 10, 2006

My problem, I have the aspx, .cs and ascx files but I don t have a project or solution that came with the files (since that was done by front page). So I need to add all those files in a solution or a project so that I can maintain the site that was created by front page using Visula Studio.

Do you know how i Can put all those files in a new project or new solution.

2/Also, when we modify the the pages, how can i put them beck in the site, will I have to compile the files again, or not. thank you.

Thank you

View 1 Replies View Related

Watching An Incoming Directory For Files To Process

Oct 21, 2005

Here's the senario: 

View 8 Replies View Related

How To Archive The Flat Files After They Are Loaded Into A Directory

Aug 21, 2007

I have to archive the Flat files after they are loaded into an archive folder with a Date time stamp on the folder in the format mmddyyyyhhmmss what task should i use in ssis to complete this and can i do this task for multiple files in the directory, how should i configure such that all files are archived and placed in one directory with a current timestamp, Please Provide me with a solution

View 11 Replies View Related

What Directory Are My Nightly Backups (.bak) Files Written To?

Aug 29, 2006

where in sql server 2005 ( and 2000 for that matter) do i find the path to the location where backups are placed (.bak files)? is there sql i can use to find this out

View 6 Replies View Related

SQL Server 2014 :: Convert / Insert All Files In A Directory

Feb 24, 2015

My task is to convert jpeg's to binary and then insert them into a table called "images". I need to convert/insert all jpeg files in a directory. I'm able to accomplish the task if the files are numbered. The query below works by retrieving one file at a time based on the value of @i. However, I also have directories where the files are not numbered but have ordinary text names like "Red_Sofa.jpg". I need to iterate through these directories as well and convert/insert the jpeg's. I'm running SSMS 2014 Express on 4.0 and Windows 7.

DROP TABLE images
CREATE TABLE images
(
image_name varchar(500) null
,image_data varbinary(max) null

[Code] ....

View 2 Replies View Related

How To Move The Bad Data Into Another Directory While Looping Through A Set Of FLAT FILES ?

Sep 1, 2007

Currently looping through the set of flat files like CHK0604, CHK0611, CHK0618, and CHK0625 from the source folder C:SOURCE



OBJECTIVE within the flat file if any records/rows cause error i have to move the bad data into separate folder C:ERROR



STEPS TAKEN

1) In FOREACH LOOP component i specified the variable User:: sourceFilePath for my source file CHK0604 etc. location C:SOURCE. The loop walkthrough each file in C:SOURCE and if no error then moves the flat file into another folder C:ARCHIVED. This task is perfectly working.



2) Within the dataflow I am diverting the the bad rows from "conditional component" into "Flat File Destination" Component.



3) "Flat File Destination" Connection manager i set the expressions as @[User:: sourceFilePath] +"_Error.TXT".



ISSUE

Because of point (3) the error file is created in the SOURCE flat file location C:SOURCE.



QUESTION



1) My error file name should be CHK0604_Error, CHK0611_Error, CHK0618_Error, CHK0625_Error created in another folder C:ERROR.



2) How to move the bad data into another directory while looping through a set of FLAT FILES ?

3) If i have to create another variable like @[User:: ErrorFilePath] where to create ? How to use the source file title as the title of error file.?

Thanks for the help

View 4 Replies View Related

Move Files From Directory Based On Names On A Static List.

May 2, 2008

I have a scenario where I need to move a series of files from within a directory of many files. The files follow no nameing convention and are more of less random. However the file names never change from week to week. I tried various different options in a 'file system task', no go.
Any ideas on how to move only a list of files?

or

can I load only specific files into a 'Foreach Loop container' from a certain directory. I tried delimiting file names in the file source, that did not work.

Either way can work,
Thanks

View 1 Replies View Related

Receive Files From Remote Site Only If File Does Not Exist In Local Directory

Jul 13, 2007

I need to only receive files via ftp when the file does not exist on my local machine. FIles are being added to the remote location on a weekly basis and they are being downloaded locally. I do not want to download all the files each time. Instead, just download what was not already downloaded. Is there a way to do this? I want to do this using SSIS / ftp task.



Thanks in advance.

View 4 Replies View Related

SQL Server 2008 :: Copy Multiple CSV Files Into Database Using Stored Procedure?

Feb 9, 2015

I need to import multiple csv files and load into table and everytime new database has to be created .

I was able to create new databases using stored proc

How do i do a bulk insert for all the files at once to insert into tables .

i want to load all the files at once .

View 6 Replies View Related

Changing Path Of Data && Log Files On The Fly

Dec 4, 2004

We have a SQL Server setup as a publisher to 15 subscribers. We need to change the path of the data & log files to a new drive (added a new harddisk). We plan to take a cold backup of the database and shift the data & log files to the new drive. Then we just attach the data & log files from the new path.

Will this disturb my existing replication Setup?
Is the the correct procedure for changing the path of the existing data & log files?
What is the appropriate method for shifting data & log file of a live database to a different location (directory/drive) ?

thanks in advance

View 2 Replies View Related

Changing The Data Files To Another Disk Partition

May 26, 2004

Hi,

I have a sql server 7 running on a machine with two disk partitions (D: and E:).

The data files xxx.mdf and xxx.ldf are stored in D:, which has very few space available. I want to copy these files to E: but I get an error saying that it is not possible to change the source file of a database. Is it possible to do it or do i have to create another data file in E: and keep the old one in D:?

Thanks in advance,

browser

View 3 Replies View Related

Active Directory And Stored Procedures

Aug 16, 2006

I have a need to access the active directory from a stored
procedure. I am certain that CLR is the answer but I am having a
hard time finding and example and I am a true newbie to AD and CLR.



Has anyone ever attempted to do this? I would love to see an example in VB if possible.

View 3 Replies View Related

Active Directory Sync With Stored Procedure

Feb 28, 2006

Hello,I need a permanent synchronization between the "Active Directory" and the UserTable in my WebApp.I think a good solution for my interface can I realize with the "Stored Procedures" in SQL Server 2005. Is this the right way?I can create a Stored Procedure and a AD-Reader separately, that's no problem. But how I can import the "System.DirectoryServices"-Assembly in my Stored Procedure?Or is there an other solution?Thanks a lot!NussyStar*

View 2 Replies View Related

Using Provider For Microsoft Directory Services For Querying Active Directory

Apr 6, 2007

Has anyone used this successfully from an OLEDB source component, or even from the Execute SQL Task? I've seen some examples of using a script component, but nothing that uses it through a connection manager.

View 6 Replies View Related

Query LDAP/Active Directory In Stored Procedure

Apr 28, 2004

I know you can access LDAP via ADO.NET and the ADsDSOObject Provider.

Is there away to do it within a SQL Server Stored Procedure?

Thanks,
Tim

View 2 Replies View Related

Stored Procedure - Create Trigger File In Particular Directory

Oct 26, 2012

I created stored procedure to create trigger file in a particular directory using xp_cmdshell.

I am calling the procedure from windows batch script as follows

@@set osq200=osql /a 4096 /b /E /e /d %dbn% /m-1 /r 0 /S %dbs% /Q "exec SP_Create_TriggerFile %2,%1 "
@%osq200% >>%3rec.txt 2>%3rec_err.txt
@set dberr=%errorlevel%
@if %dberr% GTR 0 goto createDATriggerFileErr >>%3rec.txt

If the directory doesn't exist, its throwing error "The system cannot find the path specified" , but the %errorlevel% still showing as 0..

View 1 Replies View Related

Database In Different Directory.

Dec 28, 2007



i am creating a program with Local Database (sdf file).
i want my application to read the Database file from a different directory and not the application program?
does one SQL Database can hold many users Data's or can i create Database per user..
i am novice about SQL and Databases...

Thank you ..

View 4 Replies View Related

I Cant Set Directory For Backup Database.

Nov 23, 2004

after selecting the presetted directory .. i clicked ok and they said this," The file name specified is recongnized as a directory name. The file won't be able to be rewritten. Would you like to continue? "

then i clicked " Yes " .. - nothing happened ..
then i clicked " Yes " .. - nothing happened again ..
now i click ok again to close the "restore database" icon .. and they give me this.. i attached a screenshot .. pls have a look ..

i tried clicking "Manage Attachments" somewhere at the bottom of the page to upload .. but ragezone gave me a page telling me that they are sorry for any inconvenience caused .. so i cant attach it .. here is a link .. its kinda small .. but it says:

"Cannot open backup device 'C:Program FilesMicrosoft SQL ServerMSSQLBACKUP'. Device error or device off-line. See SQL Server error log files for more details. RESTORE DATABASE is terminating abnormally."

thank you for helping me .. thanks in advance ..
http://img.photobucket.com/albums/v81/xiaoboy/error.bmp
http://img.photobucket.com/albums/v...oy/untitled.bmp

PLEAS PLEASE HELP ..

View 14 Replies View Related

Change Database Storage Directory

Jul 18, 2001

hi,
I have a database whose mdb and ldb files are located in C drive.
I need to change these files to D drive.When i go to the database properties
and try to change the location it does not allow me.It has given me a message(The database physical file cannot be changed once it is created).
I can drop the table and recreate it from a BackUp but is there a better way
to do this.

Thank you,

View 2 Replies View Related







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