Showing posts with label contain. Show all posts
Showing posts with label contain. Show all posts

Wednesday, March 28, 2012

Images in SQL Server

I'm architecting an application that is going to contain large amounts of
image files and display them on the web, with role-based security for the
images. From everything that I understand is that this should be done by
storing the image on the filesystem and links to that data in a database
table instead of storing these images to the database table. Does anyone
here have experience with this, and can give me some advice as to if this is
the correct direction I should go?
Thanks,
Jason WalravenCheck out: http://www.aspfaq.com/2149
Anith|||Thanks
"Anith Sen" <anith@.bizdatasolutions.com> wrote in message
news:%23PaWXNzLFHA.4028@.tk2msftngp13.phx.gbl...
> Check out: http://www.aspfaq.com/2149
> --
> Anith
>|||I don't quite share the same opinion as the author of this article.
Images in database with SQL 2000 and a proper designed file group system are
great. We use it and would never go to the nightmare of reconciling file
system with database.
You backup a database, you have everything your app needs, even if you send
it to China.
Thanks
"Anith Sen" <anith@.bizdatasolutions.com> wrote in message
news:%23PaWXNzLFHA.4028@.tk2msftngp13.phx.gbl...
> Check out: http://www.aspfaq.com/2149
> --
> Anith
>|||>> I don't quite share the same opinion as the author of this article.
Well, the article is pretty reasonable with generic arguments for both sides
with a few pointers to different issues. Performance requirements are often
at odds with ease of maintenance. Readers can always choose implement
solutions depending on their specific business needs.
Anith

Monday, March 19, 2012

I'm retarded and need help with Derived Column or Script Task

I am moving data from an oracle database to sql server. Two of the source fields are dates, which sometimes contain values I know to be incorrect ('0001/01/01' and '1900/01/01').

I'd like to use either the derived column or script task (or any other appropriate one) to update these incorrect values (in both columns) to null before inserting into sql server, smalldatetime field.

In sql 2000 dts, I would simply use a VBScript IF statement, but I'm somewhat clueless when it comes to .Net.

Does anyone have any ideas or sample code that may help?

Thank you much.

In a derived column you could do a comparison expression such as:

[ORACLE_COL] == (DT_DBTIMESTAMP)"0001/01/01" || [ORACLE_COL] == (DT_DBTIMESTAMP)"1900/01/01" ? NULL(DT_DBTIMESTAMP) : [ORACLE_COL]

|||

That worked perfectly, thank you. However it also looks like it's slowing me down quite a bit. I'm moving a lot of data, 16 million records, from oracle to sql server. Moving this into a temp table without the derived column task only took 8 minutes. After adding the new task I can see it would take far longer.

Do you know of any good learning resources for SSIS besides Books on Line?

Thank you.

|||

www.sqlis.com is the recognised community site.

The guys that run it (Darren and Allan) are also running a new wiki site: http://wiki.sqlis.com/

-Jamie

|||I found that the WROX press book "SQL Server 2005 Integration Services",, ISBN 0-7645-8435-9 is a very good resource. I normally do not like using anything other than online resources either.

Friday, February 24, 2012

iif stored procedure

Hi all,

I have a bunch of queries initially written for MS Access that contain iif
function.
Since I'm new in SQL Server and I don't like the idea of rewriting all
queries using CASE statement, I hope someone has written iif T-SQL stored
procedure.
If someone have T-SQL code of such procedure I would appreciate you post
this code here.

Thanks in advance!"Anabella" <x@.x.com> wrote in message news:cu86s9$pj0$1@.ls219.htnet.hr...
> Hi all,
> I have a bunch of queries initially written for MS Access that contain iif
> function.
> Since I'm new in SQL Server and I don't like the idea of rewriting all
> queries using CASE statement, I hope someone has written iif T-SQL stored
> procedure.
> If someone have T-SQL code of such procedure I would appreciate you post
> this code here.
> Thanks in advance!

Since IIF doesn't exist in TSQL, I don't think you have any other option.
The Upsizing Wizard might help, but the most reliable thing to do would be
to rewrite them.

Simon|||"Anabella" <x@.x.com> wrote in message news:cu86s9$pj0$1@.ls219.htnet.hr...
> Hi all,
> I have a bunch of queries initially written for MS Access that contain iif
> function.
> Since I'm new in SQL Server and I don't like the idea of rewriting all
> queries using CASE statement, I hope someone has written iif T-SQL stored
> procedure.
> If someone have T-SQL code of such procedure I would appreciate you post
> this code here.
> Thanks in advance!

I think maybe you could write a udf which took parameters.
I think handling the various comparisons might be hard work.
Off the top of my head, I think you'd have to change the syntax of your
query a bit so you handed the comparison as a parameter.
And... erm... changing your query is what you wanted to avoid.

I've got some other bad news for you as well.

MS Access sql is slightly different from sql server sql .
I would suggest you need to go through all your queries and check em out.
Changing iif to case statements is likely just part of the task you face.

--
Regards,
Andy O'Neill|||Andy O'Neill (aon14nocannedmeat@.lycos.co.uk) writes:
> I think maybe you could write a udf which took parameters.
> I think handling the various comparisons might be hard work.
> Off the top of my head, I think you'd have to change the syntax of your
> query a bit so you handed the comparison as a parameter.
> And... erm... changing your query is what you wanted to avoid.

Since boolean is not a datatype in SQL Server, you cannot write a
UDF which permits you to say:

SECECT dho.iif(@.x = @.y, 1, 2)

--
Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se

Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techin.../2000/books.asp|||"Erland Sommarskog" <esquel@.sommarskog.se> wrote in message
news:Xns95F7EFAAF416CYazorman@.127.0.0.1...
> Andy O'Neill (aon14nocannedmeat@.lycos.co.uk) writes:
>> I think maybe you could write a udf which took parameters.
>> I think handling the various comparisons might be hard work.
>> Off the top of my head, I think you'd have to change the syntax of your
>> query a bit so you handed the comparison as a parameter.
>> And... erm... changing your query is what you wanted to avoid.
> Since boolean is not a datatype in SQL Server, you cannot write a
> UDF which permits you to say:
> SECECT dho.iif(@.x = @.y, 1, 2)

I had in mind handing over the comparison operation as a string.
So check if the comparison to be made is varchar and '=' or maybe '>' or
'<'.
If that makes sense.

That's the part I'm actually most confident I could handle.
I didn't even begin to think about the various datatypes one could have for
other parameters...

--
Regards,
Andy O'Neill