Forum Replies Created

Viewing 15 posts - 16 through 30 (of 66 total)

  • RE: Is this Correct Use of Dynamic SQL???

    GilaMonster (9/28/2013)


    All of the posted code is vulnerable to SQL injection. Please, please, for the third or fourth time, read up on SQL injection and don't use dynamic SQL until...

  • RE: Is this Correct Use of Dynamic SQL???

    Lynn Pettis (9/28/2013)


    What are the correct data types for the following columns:

    sexID

    statusID

    firstname

    middlename

    lastname

    sexID int

    statusID int

    firstname varchar(20)

    middlename varchar(20)

    lastname varchar(20)

    that is in my table

  • RE: Is this Correct Use of Dynamic SQL???

    set ANSI_NULLS ON

    set QUOTED_IDENTIFIER ON

    go

    -- =============================================

    -- Author:<Author,,Name>

    -- Create date: <Create Date,,>

    -- Description:<Description,,>

    -- =============================================

    ALTER PROCEDURE [dbo].[SearchBiography]

    @firstname nvarchar(50),

    @middlename nvarchar(50),

    @lastname nvarchar(50),

    @sexID...

  • RE: Is this Correct Use of Dynamic SQL???

    pietlinden (9/28/2013)


    The correct use for dynamic SQL is Option 1: DON'T, especially if you're a noob.

    If you understand the repercussions of code that can't be optimized, and SQL injection attacks,...

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

    Cadavre (9/27/2013)


    enriquezreyjoseph (9/27/2013)


    Cadavre (9/27/2013)


    enriquezreyjoseph (9/27/2013)


    Thank you guys..

    so, i should change varchar now to my whole table and to my front-end...tsk :-(..

    You're also vulnerable to SQL injection. Please look over the...

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

    Cadavre (9/27/2013)


    Why not build up your WHERE clause like this?

    ALTER PROCEDURE [dbo].[SearchBiography] @firstname NVARCHAR(50), @middlename NVARCHAR(50), @lastname NVARCHAR(50), @sexID NCHAR(1), @statusID NCHAR(1) AS

    BEGIN;

    SET NOCOUNT ON;

    ...

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

    Sean Pearce (9/27/2013)


    enriquezreyjoseph (9/27/2013)


    Thank you guys..

    so, i should change varchar now to my whole table and to my front-end...tsk :-(..

    The table can contain varchar columns but the statement must be...

  • RE: DBCC CHECKTABLE not reporting errors

    EarnestGoesWest (9/27/2013)


    Hi,

    Here it is.

    DBCC CHECKTABLE ('[dbo].[CorruptTable]') WITH ALL_ERRORMSGS, TABLERESULTS;

    Thanks.

    i hope this will help

    http://www.sqlsoldier.com/wp/sqlserver/day24of31daysofdisasterrecoveryhandlingcorruptioninaclusteredindex

  • RE: DBCC CHECKTABLE not reporting errors

    EarnestGoesWest (9/27/2013)


    Hi,

    I've recently implemented a new DBCC INTEGRITY check process running a combination of CHECKDB (for the smaller databases) and CHECKTABLE for larger - spread over a few days.

    During...

  • RE: Duplicate key was ignored warning returned even when no duplicates are found

    jatighe (9/27/2013)


    Hi

    I am having problems with the "Duplicate key was ignored" warning message. The problem is that the message seems to happen randomly and cannot be reproduced. If i...

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

    Cadavre (9/27/2013)


    enriquezreyjoseph (9/27/2013)


    Thank you guys..

    so, i should change varchar now to my whole table and to my front-end...tsk :-(..

    You're also vulnerable to SQL injection. Please look over the code I...

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

    Thank you guys..

    so, i should change varchar now to my whole table and to my front-end...tsk :-(..

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

    dwain.c (9/27/2013)


    enriquezreyjoseph (9/27/2013)


    SET @sqlquery = ' SELECT * FROM TestMyView ' +

    CASE

    ...

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

    this is it

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

    dwain.c (9/27/2013)


    That is my recommendation.

    I find the resulting code to be a bit easier to understand.

    set ANSI_NULLS ON

    set QUOTED_IDENTIFIER ON

    go

    -- =============================================

    -- Author:<Author,,Name>

    -- Create date: <Create Date,,>

    -- Description:<Description,,>

    -- =============================================

    ALTER PROCEDURE [dbo].[SearchBiography]

    ...

Viewing 15 posts - 16 through 30 (of 66 total)