Forum Replies Created

Viewing 15 posts - 421 through 435 (of 4,080 total)

  • RE: Synonyms

    Also, to save you the trouble of future attempts along similar lines, it is important to understand that SQL queries reference specific objects and create execution plans based on the...

    __________________________________________________

    Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
    Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills

  • RE: Ltrim not working, not able to remove prefixed "-" from a column.

    I'd use CASE and STUFF to replace a leading '-' when one exists.

    declare @input table (ID int identity(1,1) primary key, Country varchar(20));

    insert into @input

    values ('-UK'),('-US'),('SW'), ('DE'),('FR-CA')

    select ID, CASE WHEN...

    __________________________________________________

    Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
    Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills

  • RE: Using SP X View X Table with Multiple Values

    You can pass multiple CEPs to your procedure using a table-valued parameter. If your lookup to Google doesn't accept multiple values, you will have to use a...

    __________________________________________________

    Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
    Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills

  • RE: Simple Aggregate function.

    Odd problem. Was this a test or interview question?

    __________________________________________________

    Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
    Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills

  • RE: STDistance with SPATIAL INDEX QUERY TO SLOW :)

    Here is the format for nearest neighbor code in MSDN.

    https://msdn.microsoft.com/en-us/library/ff929109.aspx

    I agree with Eirikur, get rid of your hints.

    On a small scale, say within a city, you...

    __________________________________________________

    Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
    Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills

  • RE: How to improve performance for update statement on large table

    Second thought: Do your tables have indexes on ODGUID,ProvGuid, and UserGuid (where those are the first columns in the index) ?

    __________________________________________________

    Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
    Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills

  • RE: How to improve performance for update statement on large table

    FROM [SAC].[dbo].[SO] observ

    INNER JOIN [SS].[dbo].[WCD] cd on cd.ODGUID= observ.ODGUID

    AND Observ.EDtm >= 'Aug 6 2013 3:55PM' AND Observ.EDtm <= 'Aug 1 2016 12:00AM'

    INNER JOIN [SAC].[dbo].[SPDim] prov ON prov.ProvGUID = cd.UserGUID

    AND...

    __________________________________________________

    Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
    Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills

  • RE: How to identify parameter sniffing and fix it

    A good indicator of parameter sniffing can be found from looking at the actual execution plan. If estimated numbers of rows differ wildly from the actual number...

    __________________________________________________

    Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
    Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills

  • RE: Getting last good data for each id from each column

    Here is a two-pass approach to get you the values you want. The first pass gets the maximum date within ID for which each column has a (non-null)...

    __________________________________________________

    Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
    Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills

  • RE: Dynamic query

    I agree with Jeff, that if you have company name (or a company number integer) as part of the table, then you can just use one table and identify the...

    __________________________________________________

    Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
    Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills

  • RE: How to search exact match case

    While I loathe to place a solution for what you are asking for the very reasons explained before my post.....Based on your small dataset and given the constraint of NOT...

    __________________________________________________

    Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
    Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills

  • RE: How to search exact match case

    This should work for you, but your table design is incorrect. In the long term are much better off breaking the various component ID numbers down into...

    __________________________________________________

    Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
    Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills

  • RE: URGENT Please -Substring Formation in SQL SERVER 2014

    Another example, that simply uses a CASE expression to test whether a 1 appears before a 2 in the string.

    with ExampleData (AlphaNum) as (select...

    __________________________________________________

    Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
    Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills

  • RE: max degree of parallelism

    You can also look at the query plan and see how many threads are running from the outputs of parallel operations.

    __________________________________________________

    Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
    Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills

  • RE: Decrementing total for Sql server 2005

    As I recall, 2005 doesn't support windowed functions, so you have to deal with any running totals problem (decrementing from a total falls under the category of running totals) in...

    __________________________________________________

    Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
    Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills

Viewing 15 posts - 421 through 435 (of 4,080 total)