Showing posts with label practice. Show all posts
Showing posts with label practice. Show all posts

Wednesday, March 28, 2012

Images in SQL db

Hi all,
is it good practice to store product images in a sql db?

thanksSure,
Why not?
If you have the suffecient amount of disk space,
You can do it and with no problems,

Cheerz|||::is it good practice to store product images in a sql db?

Yes, it is the bes t thing you can do.
No, it is riiculously stupid.

And now the truth: tis is somewhere between, and it totally depends on what you do with them.

I WOULD store them in the DB - simply because this means ONE backup location for the complete shop (you talk of a shop here, right?), as well as referential integrity.

OTOH this means I HAVE to use the output cache to get decent server performance, which means I need more memory. Which is a negative. Some consider it a hugh negative, me not - the output cache is pretty smart about dropping stuff, AND - more important - memory is cheap. Cheaper than the developer having to write a cleanup routine because you have left-over stuff in the db.

It really depends a lot on WHAT you do with the images.|||Well, what is your reasoning for placing them in the db?|||Nice one thanks everyone.

Sunday, February 19, 2012

IIf in Query question

I am attempting to execute the following query but am getting syntax errors.
I don't have a lot of practice with the IIf function, need help.
Any Ideas??

--QUERY--
UPDATE View_Data SET
Num_07 = Num_01/IIf(Den_01=0,1,Den_01)
where Data_Set_ID = 444

--Error--
Server: Msg 170, Level 15, State 1, Line 2
Line 2: Incorrect syntax near '='.

More Info
----------------
The fields Num_07,Num_01, Den_01 are all of type 'float'I think that you need to replace the Jet/VB Iif() (http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vblr7/html/vafctiif.asp) with the SQL Server CASE (http://msdn.microsoft.com/library/default.asp?url=/library/en-us/tsqlref/ts_ca-co_5t9v.asp) statement.

-PatP