Forum Replies Created

Viewing 15 posts - 31 through 45 (of 66 total)

  • RE: Can You make this code Shorter??..

    Thanks Dwain...so should i use CASE Statement instead??..

  • RE: Can You make this code Shorter??..

    Dwain,,,,

    My sexID will never contain embedded quotes...because with this table

    *Bio

    bioIB

    fname

    mname

    lname

    sexID

    statusID

    *sex

    sexID

    sex(male or female only)

    *status

    statusID

    status(single,married or divorced only)

    sexID and statusID from bioID belongs to different table...

    so my View table would be

    *MyViewTable

    (Contains...

  • RE: Can You make this code Shorter??..

    dwain.c (9/26/2013)


    The short answer is yes, however I have several issues with what you're trying to do.

    1. [Issue #1] In the statement below, you're setting the right part of the...

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

    dwain.c (9/26/2013)


    enriquezreyjoseph (9/26/2013)


    Hi everyone 😉

    why is this statement has error??.. 🙁 i can't figure it out..

    SET @statusID = ' AND statusID = ' + convert(varchar(20), @statusID)

    Most likely, the declaration...

  • RE: How to search?

    GilaMonster (9/26/2013)


    SysAdmin.

    I'm willing to learn sir gail...that is why i exist in this community because of you...

  • RE: How to search?

    GilaMonster (9/26/2013)


    enriquezreyjoseph (9/25/2013)


    Hi Sir Gail..

    Please see my Attachment..that is the result when i try to run your suggestion...

    Look at what the error say and see what I almost did to...

  • RE: Is this Vulnerable for SQL injection?..

    AndrewSQLDBA (9/26/2013)


    YES!

    Anything that is Dynamic can be. Plus as everyone else has said, it is very poor practice. And poor performing.

    I wish that it were illegal for a front-end programmer...

  • RE: How to search?

    GilaMonster (9/25/2013)


    enriquezreyjoseph (9/24/2013)


    But some post say that..Dynamic Sql is a powerful tool...

    Indeed, but you don't use a jackhammer to put a nail in the wall. Powerful tool != use all...

  • RE: How to search?

    Sean, What do you mean i don't have a parameter??....I guess i have parameters look at my first post above...

    like this..

    ==================================

    ALTER PROCEDURE [dbo].[SearchBiography]

    @firstname varchar(50),

    @middlename...

  • RE: How to search?

    Sean Lange (9/25/2013)


    It was me who has repeatedly told you over the last few days that you need to parameterize your dynamic sql. I have posted the same link to...

  • RE: An INSERT EXEC statement cannot be nested

    PRR.DB (9/25/2013)


    Hi All,

    i am trying to post sp result to temp table then am getting this error, How can i resolve this issue?.

    Msg 8164, Level 16, State 1, Procedure Rep_Accuracy_Achievement_Analysis_Report_PRR,...

  • RE: How to search?

    GilaMonster (9/25/2013)


    enriquezreyjoseph (9/24/2013)


    But some post say that..Dynamic Sql is a powerful tool...

    Indeed, but you don't use a jackhammer to put a nail in the wall. Powerful tool != use all...

  • RE: How to search?

    AndrewSQLDBA (9/24/2013)


    Well, you can either search the table for one, or both.

    SELECT

    <ColumnName>

    , <ColumnName>

    FROM

    <TableName>

    WHERE

    Sex = 'M' OR SEX = 'F'

    That will select all rows with either M or F in the...

  • RE: Display the results of search in a DataGridView

    Sean Lange (9/24/2013)


    PLEASE do yourself a favor and read this article. http://sqlinthewild.co.za/index.php/2009/03/19/catch-all-queries/[/url]

    It has been suggested to you at least a couple of other times in the various threads you have...

  • RE: Search Using Stored Procedure

    Sean Lange (9/24/2013)


    enriquezreyjoseph (9/23/2013)


    Sean Lange (9/23/2013)


    kapil_kk (9/23/2013)


    Instead of this:

    SET @SqlQueryFirstName = '@SqlQuery ' + 'firstname = @firstname'

    Write this:

    SET @SqlQueryFirstName = @sqlquery + 'firstname ='+ @firstname

    Instead of this, read...

Viewing 15 posts - 31 through 45 (of 66 total)