Forum Replies Created

Viewing 15 posts - 436 through 450 (of 1,229 total)

  • RE: Using CTE doughts

    luissantos (10/14/2012)


    I want to know if is correct to use WHERE clause on each CTE to filter the information ?

    Also, for persons with more experience, i would like to know...

  • RE: Avg count of cases per day

    CELKO (10/14/2012)


    I am not surprised that loading the week_in_year_date is expensive; it is a lot of temporal and string function calls. Those are expensive in T-SQL.

    The function is thirty...

  • RE: Avg count of cases per day

    CELKO (10/14/2012)


    It's trivial to set up an inline table-valued function which models such a calendar table. The code is simple to modify, e.g. the startdate and enddate parameters could...

  • RE: T SQL Help - Comma separated numric value

    L' Eomot Inversé (10/14/2012)


    ChrisM@home (10/14/2012)


    Jeff Moden (10/12/2012)


    Cadavre (10/12/2012)


    If you insist on doing it in the database layer, it can be achieved like this:

    Check again. OP's desired output doesn't actually...

  • RE: T SQL Help - Comma separated numric value

    Vedran Kesegic (10/12/2012)


    Check for STR, CONVERT, and REPLACE functions to additionally format the numbers as string.

    I can't work out how any of these three functions can help. Please show us.

  • RE: T SQL Help - Comma separated numric value

    Vedran Kesegic (10/12/2012)


    Check for STR, CONVERT, and REPLACE functions to additionally format the numbers as string.

    I can't work out how any of these three functions can help. Please show us.

  • RE: T SQL Help - Comma separated numric value

    Jeff Moden (10/12/2012)


    Cadavre (10/12/2012)


    If you insist on doing it in the database layer, it can be achieved like this:

    Check again. OP's desired output doesn't actually have a comma as...

  • RE: Avg count of cases per day

    CELKO (10/13/2012)


    I also like your idea of having a report_periods_table to keep the business on the same page as to these reporting periods. I must confess though that I...

  • RE: How do I join tables, but select top 1 from 1-many tbl?

    Don. (10/13/2012)


    Hi Guys,

    Unfortunately neither of those scripts worked as there are multiple identical accountno and lastdate fields. Ideally Id need to filter on the History tables Recid field.

    I've dummied up...

  • RE: Char And int

    L' Eomot Inversé (10/13/2012)


    Eskandari (10/10/2012)


    Consider this Table :

    CREATE TABLE Test ( field_one nvarchar(10) );

    DECLARE @i int;

    WHILE @i<= 1000

    ...

  • RE: How do I join tables, but select top 1 from 1-many tbl?

    Don. (10/12/2012)


    Chris that looks almost perfect, thank you. (Needed x instead of h in the initial select)

    SELECT c.*, x.*

    FROM Contact c

    OUTER APPLY (

    SELECT TOP 1 h.*

    FROM History h

    WHERE h.Accountno...

  • RE: Should I use a nested subquery?

    thomasrichardson2000 (10/11/2012)


    CREATE TABLE #Temp (RepairSheetNr int, unitnr int, groupid char(4), brandId varchar(40), modelId varchar(40), version varchar(40), Type_Fleet char(10), close_date DATETIME, TotalModels INT)

    INSERT INTO #Temp

    SELECT '5000023', '83', 'EDMN', 'FIAT', 'GRANDE...

  • RE: Should I use a nested subquery?

    thomasrichardson2000 (10/11/2012)


    "What do you see if you order the results by Vehicle.modelId? Do you get multiple rows per model? That's what I'm looking for."

    Yes when I order them by Vehicle.modelId...

  • RE: Table-Valued Functions in Stored Procedures

    Can you post an example of one of the TVF's?

  • RE: Should I use a nested subquery?

    What do you see if you order the results by Vehicle.modelId? Do you get multiple rows per model? That's what I'm looking for.

Viewing 15 posts - 436 through 450 (of 1,229 total)