Forum Replies Created

Viewing 15 posts - 196 through 210 (of 1,228 total)

  • RE: CTE with Linked Server: Mulitpart Identifier could not be bound

    Lynn Pettis (7/21/2014)


    Just a thought, but I was wondering if the following would work:

    SELECT WorkOrder, TakTime

    INTO

    [plc].[TaktTime]

    from openquery([SAPETL],'

    WITH TaktValues ([Counter], NODE, PLNNR) AS

    (

    ...

  • RE: CTE with Linked Server: Mulitpart Identifier could not be bound

    Lynn Pettis (7/21/2014)


    DevNate (7/21/2014)


    Lined server is connected via Symbols.

    So you are saying the Linked Server is hidden by using a synonym? Well, not obvious from what you posted. ...

  • RE: Splitting time span into multiple entries

    sgmunson (7/10/2014)


    There's a much simpler query:

    DECLARE @DATE AS datetime = '07/10/2014';

    DECLARE @TIME_START_INT AS int = 820;

    DECLARE @TSV AS varchar(4) = RIGHT('00' + CAST(@TIME_START_INT AS varchar(4)), 4);

    DECLARE @TIME_END_INT AS int =...

  • RE: seven digit random number

    All at once or one at a time?

  • RE: Ugly Index Spool

    On phone so long shot - try LEFT REMOTE JOIN ticket.

  • RE: Please help to reduce query time

    Lynn Pettis (5/13/2014)


    Is the temp table created on the fly (SELECT INTO) or is it predefined using CREATE TABLE and then populated with an INSERT INTO statement? If the...

  • RE: Table scan paranoia

    sqldriver (5/9/2014)


    I have a stored procedure hitting a 761969 row table and doing several table scans on it...

    Properly written queries will cut down on those scans. Consider the query you...

  • RE: Slow self join

    Without sample data to test against...

    Try this.

    ;WITH Updater AS (

    SELECT

    FTEHrsAVG,

    NewFTEHrsAVG = AVG(CASE WHEN FlexVast = 'VAST' THEN FTEHrs ELSE NULL END)

    ...

  • RE: Are the posted questions getting worse?

    Jeff Moden (4/22/2014)


    ChrisM@Work (4/22/2014)


    The easiest method I've seen was shown to me by a prawn fisherman in Ullapool and I've only tried it with herring but it would probably work...

  • RE: Query optimization help

    EasyBoy (4/16/2014)


    Thanks Scott and Lynn for your inputs.

    As suggested by Scott i have made changes in existing index with filtered index (suggested by Lynn). And i am able to bring...

  • RE: Variables inside linked server queries... stumped!

    Back to basics. Change Exec(@Tsql) to PRINT @Tsql. Examine the output. Too many delimiters around your variables perhaps.

  • RE: Find sequential numbers

    The easiest and fastest way to process your table would be the "quirky update". See Jeff Moden's article here[/url]. Post back if you have any questions after reading the article.

  • RE: Select Top x% From Group Based on Total

    tfendt (3/21/2014)


    I also posted this question in StackOverflow. Here is the solution:

    select DealerId, Tire, count(*) as RepairsOfThisTire,

    max(cnt) as TotalRepairs,

    ...

  • RE: Select Top x% From Group Based on Total

    tfendt (3/21/2014)


    The Preagg query is just counting the total number or records per dealer in table 2.

    ...

    It also counts the total number of repairs per dealer.

    ;WITH

    Preagg AS (

    SELECT DealerID,...

  • RE: Filtering on CTE result

    cgreathouse (3/15/2014)


    Thanks Igor, however I was looking for a solution. I was able to put the results into a table first and then use that table, just like...

Viewing 15 posts - 196 through 210 (of 1,228 total)