Showing posts with label upload. Show all posts
Showing posts with label upload. Show all posts

Wednesday, March 21, 2012

How to tell if there is something in a binary field

I tried to upload a pdf file into a binary field using asp upload. I
cannot tell if there is anything in the field using query analyzer, and I wa
s
wondering what shows in the grid when something exists there. It is just
showing as <binary>Don't use a grid for this kind of thing.
SELECT DATALENGTH(col) FROM Table
This is my signature. It is a general reminder.
Please post DDL, sample data and desired results.
See http://www.aspfaq.com/5006 for info.
"Linda Lalewicz" <LindaLalewicz@.discussions.microsoft.com> wrote in message
news:3208A836-96ED-406C-BF8A-305946E6BFE7@.microsoft.com...
>I tried to upload a pdf file into a binary field using asp upload. I
> cannot tell if there is anything in the field using query analyzer, and I
> was
> wondering what shows in the grid when something exists there. It is just
> showing as <binary>|||I also found that a select for that field would return something if there wa
s
something in there, if not it came back null.
Now I need to figure out why the clues that you gave me yesterday don't seem
to show me my pdf file. I just see a blank page with no errors, no pdf. :
(
wahhhh
"Aaron [SQL Server MVP]" wrote:

> Don't use a grid for this kind of thing.
> SELECT DATALENGTH(col) FROM Table
> --
> This is my signature. It is a general reminder.
> Please post DDL, sample data and desired results.
> See http://www.aspfaq.com/5006 for info.
>
>
> "Linda Lalewicz" <LindaLalewicz@.discussions.microsoft.com> wrote in messag
e
> news:3208A836-96ED-406C-BF8A-305946E6BFE7@.microsoft.com...
>
>sql

Monday, March 19, 2012

how to target the file name with date variable

My client will upload a file to a FTP folder regularly, but the time patten is unknown, only thing i know is he'll use today's date as the file name. for example, he uploaded a file 'wk070705_id.txt' today, but i don't know when the next file will be uploaded. so how can i write a package like, eveytime when he upload a new file (for example if he upload a file 'wk070708_id.txt'), i can import the data into my table? i am a very newbie of SSIS, it would be perfect if i can get a full script for this. thanks in advance with appreciation!

ps: the date in file name is yymmdd

One way i can think of is to make use of gateway service to poll that directory and as soon as file arrives, parse the file name and load the corresponding package.|||

If you have normal file system access to the folder then you can use this task -http://www.sqlis.com/23.aspx

If you only have FTP access then polling is the way to go. You can request the file, but nee dto make the parameter dynamic based on todays date, for which you can use a property expression. Have a look in Books Online for the references to property expressions in SSIS they are what make it flexible and dynamic.

Some example date expressions - http://wiki.sqlis.com/default.aspx/SQLISWiki/ExpressionDateFunctions.html