Thursday, September 26, 2013

[SQL Server] Best way to store images

[SQL Server] Best way to store images


Best way to store images

Posted: 08 Mar 2013 06:59 PM PST

Hi.I recognized if we store an image in binary type in SQL SERVER they take more space. For example a 700kb image take about 900kb space.With this condition which way is better to store images?

Can You make this code Shorter??..

Posted: 26 Sep 2013 01:25 PM PDT

[code="sql"] DECLARE @SqlQuery varchar(max) , @SqlQueryFirstName varchar(max),@SqlQueryMiddleName varchar(max), @SqlQueryLastName varchar(max), @SqlQuerySex varchar(max), @SqlQueryStatus varchar(max) SET @SqlQuery = '' SET @SqlQueryStatus = '' SET @SqlQueryFirstname = '' SET @SqlQueryMiddlename = '' SET @SqlQueryLastName = '' SET @SqlQuerySex = '' SET @SqlQueryStatus = '' IF @sexID <> 0 SET @SqlQuerySex = ' WHERE sexID = ' + convert(varchar(20), @sexID) IF @statusID <> 0 BEGIN IF LEN(@SqlQuerySex) > 0 SET @SqlQueryStatus = ' AND statusID = ' + convert(varchar(20), @statusID) ELSE SET @SqlQueryStatus = ' WHERE statusID = ' + convert(varchar(20), @statusID) END IF LEN(@firstname) > 0 BEGIN IF LEN(@SqlQuerySex) > 0 or LEN(@SqlQueryStatus) > 0 SET @SqlQueryFirstname = ' AND firstname like ''%' + @firstname + '%''' ELSE SET @SqlQueryFirstname = ' WHERE firstname like ''%' + @firstname + '%''' END IF LEN(@middlename) > 0 BEGIN IF LEN(@SqlQuerySex) > 0 or LEN(@SqlQueryStatus) > 0 or LEN(@SqlQueryFirstname) > 0 SET @SqlQueryMiddlename = ' AND middlename like ''%' + @middlename + '%''' ELSE SET @SqlQueryMiddlename = ' WHERE middlename like ''%' + @middlename + '%''' END IF LEN(@lastname) > 0 BEGIN IF LEN(@SqlQuerySex) > 0 or LEN(@SqlQueryStatus) > 0 or LEN(@SqlQueryFirstname) > 0 or LEN(@SqlQueryMiddlename) > 0 SET @SqlQueryLastname = ' AND lastname like ''%' + @lastname + '%''' ELSE SET @SqlQueryLastname = ' WHERE lastname like ''%' + @lastname + '%''' END SET @SqlQuery = ' SELECT * FROM TestMyView ' + @SqlQuerySex + @SqlQueryStatus + @SqlQueryFirstname + @SqlQueryMiddlename + @SqlQueryLastname [/code]

Conversion failed when converting the varchar value ' WHERE statusID = 1' to data type int.

Posted: 26 Sep 2013 12:16 PM PDT

Hi everyone ;-)why is this statement has error??.. :-( i can't figure it out.. SET @statusID = ' AND statusID = ' + convert(varchar(20), @statusID)

Red-Gate SQL DBA Bundle

Posted: 25 Sep 2013 10:33 PM PDT

Hi Guys,Firstly I would like to say thanks to all replies on my previous post. SQLServerCentral is my number 1 forum site.Getting to the point. We as a company are looking at the Red-Gate software. Now me as newly inexperienced appointed dba are looking on providing this solution to the company.I'm currently looking at the SQL DBS Bundle option. Anybody have experience with this? What is your findings on this application. I've downloaded and used the free trial, and must say that it looked easy to setup and to use.Any suggestions from your side?

sql server 2008 r2

Posted: 25 Sep 2013 05:46 PM PDT

please from $ days I am struggling With it hi while installingsql server 2008 r2 at the end its giving error service 'sql browser' start errorand installation failing.please can anybody help me I have tried 13 to 14 timesI have searched the net they said use default instancedelete xml 7.0 nothing workingos:windows 7 home premiumregardssudarshan

Is this Vulnerable for SQL injection?..

Posted: 25 Sep 2013 04:02 PM PDT

Hi EveryoneI hope everyone is having a nice day.This is my Code[code="sql"]set ANSI_NULLS ONset QUOTED_IDENTIFIER ONgo-- =============================================-- Author: <Author,,Name>-- Create date: <Create Date,,>-- Description: <Description,,>-- =============================================ALTER PROCEDURE [dbo].[SearchBiography] @firstname varchar(50), @middlename varchar(50), @lastname varchar(50), @sex varchar(50), @status varchar(50), @sexID int, @statusID intASBEGIN SET NOCOUNT ON; DECLARE @SqlQuery varchar(max) , @SqlQueryFirstName varchar(max),@SqlQueryMiddleName varchar(max), @SqlQueryLastName varchar(max), @SqlQuerySex varchar(max), @SqlQueryStatus varchar(max) SET @SqlQuery = '' IF LEN(@sex) > 0 SET @SqlQuerySex = ' AND sex like ''%' + @sex + '%''' ELSE SET @SqlQuerySex = '' IF LEN(@status) > 0 SET @SqlQueryStatus = ' AND status like ''%' + @status + '%''' ELSE SET @SqlQueryStatus = '' IF LEN(@firstname) > 0 SET @SqlQueryFirstName = ' AND firstname like ''%' + @firstname + '%''' ELSE SET @SqlQueryFirstName = '' IF LEN(@middlename) > 0 SET @SqlQueryMiddleName = ' AND middlename like ''%' + @middlename + '%''' ELSE SET @SqlQueryMiddleName = '' IF LEN(@lastname) > 0 SET @SqlQueryLastName =' AND lastname like ''%' + @lastname + '%''' ELSE SET @SqlQueryLastName = '' SET @SqlQuery = 'SELECT * FROM TestMyView WHERE sexID = ' + convert(varchar(20), @sexID) + ' AND statusID = ' + convert(varchar(20), @statusID) SET @SqlQuery = @SqlQuery + @SqlQuerySex + @SqlQueryStatus + @SqlQueryFirstName + @SqlQueryMiddleName + @SqlQueryLastName EXEC (@SqlQuery) /* Should i need a parameter here??? */ please tell me :-( PRINT(@SqlQuery)END[/code]

No comments:

Post a Comment

Search This Blog