Forum Replies Created

Viewing 15 posts - 3,151 through 3,165 (of 10,144 total)

  • RE: Group Column Based On Anouther column

    CREATE TABLE #Sample (t_id int, w_id int, t_code CHAR(5), w_name VARCHAR(25))

    INSERT INTO #Sample (t_id, w_id, t_code, w_name)

    SELECT 35855, 3680, 'A1100', 'EVM Method Project' UNION ALL

    SELECT 35856, 3680, 'A1110', 'EVM Method...

  • RE: Splitting time span into multiple entries

    DROP TABLE #Sample

    CREATE TABLE #Sample (Startdate DATE, [start-time] INT, [end-time] INT, duration INT)

    INSERT INTO #Sample (Startdate, [start-time], [end-time], duration) VALUES ('20140710', 820, 1000, 20)

    -- How it's done

    SELECT *

    FROM #Sample s

    CROSS...

  • RE: Are the posted questions getting worse?

    Koen Verbeeck (7/10/2014)


    Jack Corbett (7/10/2014)


    Koen Verbeeck (7/10/2014)


    So I tried to endorse Jeff on LinkedIn for BCP, but somehow it doesn't work.

    I saw Jeff was endorsed 9 times for...

  • RE: Strange behaviour

    The query was failing because one or more columns in the original multi-statement table-valued function were non-nullable. It's unlikely that changing the nullability of those columns would change the plan.

  • RE: Whats wrong with this query?

    cstrati (7/10/2014)


    select mvID, title, rating, length ,studio

    from MovieInfo

    where rating not like 'R'

    and

    where (length > 90)

    Seems to be a problem with line 5

    Thanks in Advance.

    There may be a problem with line...

  • RE: Strange behaviour

    -- You might want to configure that function as an iTVF for performance:

    CREATE FUNCTION [dbo].[iTVF_CallbackService_ufn_GetCallerData]

    (

    @nCaller_NoArgINTEGER,

    @cCallerLangArgCHAR(1)

    )

    RETURNS TABLE

    AS

    RETURN (

    SELECT

    [Caller_No]= @nCaller_NoArg,

    [Clientname]= RTRIM(LTRIM(c.First_Name)) + ' ' + RTRIM(LTRIM(c.Last_Name)),

    [ClientLanguage]= CASE

    WHEN @cCallerLangArg = 'F'

    THEN...

  • RE: Strange behaviour

    schleep (7/9/2014)


    So it turns out that in the 2 failing scenarios, the function is going through the full table before applying the WHERE clause, and failing on a row where...

  • RE: how to use substring and charindex to extract desired string

    SELECT

    MyString,

    x.p1, y.p2, z.p3,

    LeftBitty = LEFT(MyString,NULLIF(z.p3,0)-1)

    FROM (VALUES ('ek/df/cv/'), ('ek/df/cv/f'), ('ek/df/cvf')) d (MyString)

    CROSS APPLY (SELECT p1 = CHARINDEX('/',MyString,0)) x

    CROSS APPLY (SELECT p2 = CHARINDEX('/',MyString,p1+1)) y

    CROSS APPLY (SELECT p3 =...

  • RE: Parsing strings from a field value

    Joe Contreras-290946 (7/9/2014)


    Hi,

    I created an ETL process using C# (SSIS was not available) and ran into some issues with one of the fields.

    I have a [description] that contains...

  • RE: Are the posted questions getting worse?

    Grant Fritchey (7/9/2014)


    Where does my data come from?

    Well the mommy data and the daddy data loved each other very much so....

    Bwahaaaa! I was so tempted to post "Haven't you had...

  • RE: How to Consume Return Values From Table Valued Function

    INSERT INTO TargetTable (<<columnlist>>)

    SELECT <<columnlist>>

    FROM SourceTable

  • RE: How to Consume Return Values From Table Valued Function

    Treat it as any other table source: SELECT * FROM dbo.MyFunction(param, param)

    Having said that, the rCTE string splitter is known to perform poorly against other methods. You can read about...

  • RE: set date value based on other row values

    This should get you started:

    ;WITH SequencedData AS (

    SELECT *, rn = ROW_NUMBER() OVER(PARTITION BY order_id ORDER BY [Priority])

    FROM #set_dates

    )

    SELECT

    [Split3_ID], [CU_ID], [order_id], [st_date], [sku], [Priority],

    o.[Delay],

    [CourseDate] = CASE WHEN o.rn =...

  • RE: Transpose rows into one column

    prabhu.st (7/8/2014)


    yes, ChrisM's query is simple aswell it is more efficient and Optimized too..

    --Estimated Subtree Cost = 0.0034222 (to calculate 21.6 rows)

    select Field from #tempunpivot UNPIVOT (Field for ColumnName IN...

  • RE: Transpose rows into one column

    SELECT NewColumn

    FROM #test t

    CROSS APPLY (VALUES (id_respondent), (projid), (gfkroid)) d (NewColumn)

Viewing 15 posts - 3,151 through 3,165 (of 10,144 total)