Showing posts with label files. Show all posts
Showing posts with label files. Show all posts

Tuesday, March 20, 2012

Retrieving list of files from XML in SSIS

I have an XML file which is having path for source files.
<files>
<file>c:\windows\1.xml</file>
<file>c:\windows\2.xml</file>
<file>c:\windows\3.xml</file>
</files>
1. I need to retrive these list in SSIS.
2. Find out if any of the file is modified within last 24 hours
time ... only if it exists.
3. send a mail to a given e-mail address.
I want to run it as a daily job and the list of file can change every
day in XML file.
~ShijuI'd probably "cheat" and create a script task to do the job.
"shiju" <shiju.samuel@.gmail.com> wrote in message
news:1171689178.353072.302370@.l53g2000cwa.googlegroups.com...
>I have an XML file which is having path for source files.
> <files>
> <file>c:\windows\1.xml</file>
> <file>c:\windows\2.xml</file>
> <file>c:\windows\3.xml</file>
> </files>
> 1. I need to retrive these list in SSIS.
> 2. Find out if any of the file is modified within last 24 hours
> time ... only if it exists.
> 3. send a mail to a given e-mail address.
> I want to run it as a daily job and the list of file can change every
> day in XML file.
> ~Shiju
>|||Hi
"shiju" wrote:

> I have an XML file which is having path for source files.
> <files>
> <file>c:\windows\1.xml</file>
> <file>c:\windows\2.xml</file>
> <file>c:\windows\3.xml</file>
> </files>
> 1. I need to retrive these list in SSIS.
> 2. Find out if any of the file is modified within last 24 hours
> time ... only if it exists.
> 3. send a mail to a given e-mail address.
> I want to run it as a daily job and the list of file can change every
> day in XML file.
> ~Shiju
>
I am not a SSIS expert but I think you should be able to use a foreach loop
for the XML file and specify the XPATH query to retieve the nodelist into a
variable which you can then use in a script task to check it exists.
John

Retrieving list of files from XML in SSIS

I have an XML file which is having path for source files.
<files>
<file>c:\windows\1.xml</file>
<file>c:\windows\2.xml</file>
<file>c:\windows\3.xml</file>
</files>
1. I need to retrive these list in SSIS.
2. Find out if any of the file is modified within last 24 hours
time ... only if it exists.
3. send a mail to a given e-mail address.
I want to run it as a daily job and the list of file can change every
day in XML file.
~ShijuI'd probably "cheat" and create a script task to do the job.
"shiju" <shiju.samuel@.gmail.com> wrote in message
news:1171689178.353072.302370@.l53g2000cwa.googlegroups.com...
>I have an XML file which is having path for source files.
> <files>
> <file>c:\windows\1.xml</file>
> <file>c:\windows\2.xml</file>
> <file>c:\windows\3.xml</file>
> </files>
> 1. I need to retrive these list in SSIS.
> 2. Find out if any of the file is modified within last 24 hours
> time ... only if it exists.
> 3. send a mail to a given e-mail address.
> I want to run it as a daily job and the list of file can change every
> day in XML file.
> ~Shiju
>|||Hi
"shiju" wrote:
> I have an XML file which is having path for source files.
> <files>
> <file>c:\windows\1.xml</file>
> <file>c:\windows\2.xml</file>
> <file>c:\windows\3.xml</file>
> </files>
> 1. I need to retrive these list in SSIS.
> 2. Find out if any of the file is modified within last 24 hours
> time ... only if it exists.
> 3. send a mail to a given e-mail address.
> I want to run it as a daily job and the list of file can change every
> day in XML file.
> ~Shiju
>
I am not a SSIS expert but I think you should be able to use a foreach loop
for the XML file and specify the XPATH query to retieve the nodelist into a
variable which you can then use in a script task to check it exists.
John

Retrieving list of files from XML in SSIS

I have an XML file which is having path for source files.
<files>
<file>c:\windows\1.xml</file>
<file>c:\windows\2.xml</file>
<file>c:\windows\3.xml</file>
</files>
1. I need to retrive these list in SSIS.
2. Find out if any of the file is modified within last 24 hours
time ... only if it exists.
3. send a mail to a given e-mail address.
I want to run it as a daily job and the list of file can change every
day in XML file.
~Shiju
Hi
"shiju" wrote:

> I have an XML file which is having path for source files.
> <files>
> <file>c:\windows\1.xml</file>
> <file>c:\windows\2.xml</file>
> <file>c:\windows\3.xml</file>
> </files>
> 1. I need to retrive these list in SSIS.
> 2. Find out if any of the file is modified within last 24 hours
> time ... only if it exists.
> 3. send a mail to a given e-mail address.
> I want to run it as a daily job and the list of file can change every
> day in XML file.
> ~Shiju
>
I am not a SSIS expert but I think you should be able to use a foreach loop
for the XML file and specify the XPATH query to retieve the nodelist into a
variable which you can then use in a script task to check it exists.
John

Monday, March 12, 2012

Retrieving data from .MDF?

Dear fellows,

Up to the moment I've got enough knowledge for read data stored into .LDF files by dbcc log and so on. It's very useful and interesting. Now, I wonder how to retrieve the same information but on MDF files.

At first, I want to make sure that is not possible by mean of traditional methods (dbcc or something like that) I suppose so but I'd like to hear opinions regarding that.

Thanks in advance for any idea, though or further information.

Enric,

We don't support reverse engineering the data from .mdf files in general, however we license our API's to third party vendors so that they can build tools to support these types of disaster recovery operations.

-Matt

|||Thanks a lot|||If you're just interested in poking about though, checkout this link.

Wednesday, March 7, 2012

retrieve special column with Sql Full Text Search

hi,
I'm using SQL Server to store files in image column (blob).
Previuosly I Used 'Index Server' with FileSystem To Search text in the files
by doing this i could retrieve special column like DocAuthor,Content, ...
I didn't find a way to do the same in SQL Server Full Text Search to
retrieve the
abstract of the file.
Is there a way to do this and extend the query to more "in file" data?
Any help would be greatly appreciated.
Nissim L
This feature is rumored to ship in SQL 2005. It is not present in SQL 2000.
Hilary Cotter
Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602.html
Looking for a FAQ on Indexing Services/SQL FTS
http://www.indexserverfaq.com
"nissiml" <nissiml@.discussions.microsoft.com> wrote in message
news:BBA52221-EAEF-428D-BAB1-D61AAE21AE65@.microsoft.com...
> hi,
> I'm using SQL Server to store files in image column (blob).
> Previuosly I Used 'Index Server' with FileSystem To Search text in the
files
> by doing this i could retrieve special column like DocAuthor,Content, ...
> I didn't find a way to do the same in SQL Server Full Text Search to
> retrieve the
> abstract of the file.
> Is there a way to do this and extend the query to more "in file" data?
> Any help would be greatly appreciated.
> Nissim L
>

Tuesday, February 21, 2012

Retrieve file stored in SQL database ...

Hi there

I'm using VS2005 (VB.net) and SQL 2005.

We've uploaded files from the web application to the SQL database.
The next thing I want to be able to do is to retrieve this uploaded file(s) from the database and attach it in the email when the user click on the Submit button on the web form.

How can this be done ?

Any help would be greatly appreciated.

TIA

Maybe you can use xp_sendmail, which allows sending SQL mail with query result as attachment. For example:

EXEC xp_sendmail @.recipients = 't-leijie',
@.query = 'SELECT pr_info FROM pubs..pub_info',
@.subject = 'SQL Server Report',
@.message = 'Test attachment',
@.attach_results = 'TRUE', @.width = 250

For more information, you can refer to:

Configuring Mail Profiles

xp_sendmail

Retrieve date from filename

Hye all,

I need help on this.

Let say my source file in excel format. Currently i'm using foreach loop to execute those source files. The problem is that , i want to retrieve a date from the source(filename) itself. i've tried using derived column. but it doesnt work.

eg: Source file name Email_Jan_05.xls, i want to grab the string JAN and 05 which later i'm going to put it in my database.

any suggestion? Thanks in advance.

Inside foreach loop, insert a script task before the data flow task, create a presedence constraint between them. Inside the script task, obtain the file date and store it in some variable.|||

Thanks Michael.

Anyway, do u have any source code / syntax or reference for this?

|||I don't have any code at hand, but look at System.IO.File.GetCreationTime and System.IO.File.GetLastWriteTime (depending on what time you need).