Forum Replies Created

Viewing 15 posts - 136 through 150 (of 2,006 total)

  • RE: Vulnerable to SQL Injection third-party API

    Thanks for taking the time to reply Jeff.

    Unfortunately, none of the options you've laid out are viable for me. If I did any of them, the only loser would be...

  • RE: Replacing recurring characters in a string with single character

    Probably not the best way to do this, just off the top of my head: -

    DECLARE @code NVARCHAR(255);

    SET @code = '12333345566689';

    WITH CTE(N) AS (SELECT 1 FROM (VALUES(1),(1),(1),(1),(1),(1),(1),(1),(1),(1))a(N)),

    CTE2(N) AS (SELECT 1...

  • RE: Converting GIVEN* XML to table

    Make sure that you understand it. You've got to support the code, not me 😉

  • RE: Converting GIVEN* XML to table

    Couple of minor corrections here.

    IF EXISTS (SELECT 1 FROM sysobjects WHERE id = OBJECT_ID('xml_to_table') AND OBJECTPROPERTY(id, 'IsProcedure') = 1)

    BEGIN;

    DROP PROCEDURE [dbo].[xml_to_table];

    END;

    GO

    CREATE PROCEDURE [dbo].[xml_to_table] (@XML XML) AS

    BEGIN;

    ...

  • RE: Converting GIVEN* XML to table

    This is going to need a lot of testing. Also, I'm not sure that it's the best way to go about this sort of problem. I've written this more as...

  • RE: Display data in a Table

    Also not exactly a wizard at XML, so I have no idea how this'll scale.

    --== SAMPLE DATA ==--

    DECLARE @XML XML = '<users>

    <userTime>

    ...

  • RE: convert - to datetime

    Minnu (11/29/2013)


    Hi,

    Gettting below error

    The conversion of a varchar data type to a datetime data type resulted in an out-of-range value.

    is there any method to convert '-' to datetime,

    in my scenario,...

  • RE: convert - to datetime

    Minnu (11/29/2013)


    Hi Team,

    DECLARE @TEMP VARCHAR(100),

    @DATETIME DATETIME

    SET @TEMP = NULL

    SET @DATETIME = CONVERT(DATETIME,ISNULL(@TEMP,'-'))

    PRINT @DATETIME

    Please help

    What are you trying to achieve? Currently, you're trying to convert the char value "-" into a...

  • RE: understanding the use of cross and outer apply operator

    Ed Wagner (11/25/2013)


    They aren't better or worse than joins, but they are different. Paul White has a good article posted at http://www.sqlservercentral.com/articles/APPLY/69953/ and part 2 is at http://www.sqlservercentral.com/articles/APPLY/69954/.

    To supplement...

  • RE: Need help on optimizing query

    vignesh.ms (11/6/2013)


    @ Cadavre :

    Thanks for your understanding

    Please explain how it works...?

    Note: This is the second version of this explanation as the forums ate the first explanation. No...

  • RE: Covert in Case

    Ryan Keast (11/6/2013)


    Hi,

    I have the following part in my Select statement -

    Select CASE WHEN dbo.[IH_RE-TNCY-PERSON].[ON-TNCY] = '1'

    THEN 'yes'

    ELSE dbo.[IH_RE-TNCY-PERSON].[ON-TNCY] END AS 'on-tncy',

    I get the error -...

  • RE: Need help on optimizing query

    Here's some code that replaces your loop and does the same job: -

    -- Sample data

    IF object_id('tempdb..#sample') IS NOT NULL

    BEGIN;

    DROP TABLE #sample;

    END;

    CREATE TABLE #sample (saledate DATETIME, custname...

  • RE: Need help on optimizing query

    vignesh.ms (11/6/2013)


    Thanks for your replies friends...

    * My query works what I'm intended to do.

    * My expectation is I dont want to hard code the date.

    I tried myself, following...

  • RE: Need help on optimizing query

    Cadavre (11/6/2013)


    Stab in the dark because you haven't been very clear in what you want to do: -

    -- Sample data

    IF object_id('tempdb..#sample') IS NOT NULL

    BEGIN;

    DROP TABLE #sample;

    END;

    CREATE...

  • RE: Help to Optimize query

    Stab in the dark because you haven't been very clear in what you want to do: -

    -- Sample data

    IF object_id('tempdb..#sample') IS NOT NULL

    BEGIN;

    DROP TABLE #sample;

    END;

    CREATE TABLE...

Viewing 15 posts - 136 through 150 (of 2,006 total)