Forum Replies Created

Viewing 15 posts - 421 through 435 (of 1,082 total)

  • RE: HELP: PLEASE!!!: Query with to long time execution..

    How about an Index on Cod_Batch and IND_ACTIVO with an includes for NUM_ORDEM?

    ----------------------------------------------
    Try to learn something about everything and everything about something. - Thomas Henry Huxley

    :w00t:
    Posting Best Practices[/url]
    Numbers / Tally Tables[/url]

    SQL-4-Life
  • RE: HELP: PLEASE!!!: Query with to long time execution..

    Hi there,

    Please could you save the execution plan from SSMS and post it here as a file.

    Also could you let us know the index definitions on this table and the...

    ----------------------------------------------
    Try to learn something about everything and everything about something. - Thomas Henry Huxley

    :w00t:
    Posting Best Practices[/url]
    Numbers / Tally Tables[/url]

    SQL-4-Life
  • RE: The T-SQL Quiz

    Jeff I hope you Proud changed you code a bit and and still using Setbased.

    Pumps on my machine 7secs

    SELECT TOP 1000000

    CASE

    WHEN ROW_NUMBER() OVER(ORDER BY GETDATE()) % 3 =...

    ----------------------------------------------
    Try to learn something about everything and everything about something. - Thomas Henry Huxley

    :w00t:
    Posting Best Practices[/url]
    Numbers / Tally Tables[/url]

    SQL-4-Life
  • RE: How to get a row number which is failing during conversion

    Ok assuming all your values are numeric then try this:

    in the where clause

    CHARINDEX('.',col1) > 6

    OR

    (CHARINDEX('.',col1) = 0 AND LEN(col1) > 5)

    Here is my example for returning values that would...

    ----------------------------------------------
    Try to learn something about everything and everything about something. - Thomas Henry Huxley

    :w00t:
    Posting Best Practices[/url]
    Numbers / Tally Tables[/url]

    SQL-4-Life
  • RE: How to get a row number which is failing during conversion

    The only other thing I can think of it to return all rows that have a Len(Col) greater than what your decimal can hold and look at those

    ----------------------------------------------
    Try to learn something about everything and everything about something. - Thomas Henry Huxley

    :w00t:
    Posting Best Practices[/url]
    Numbers / Tally Tables[/url]

    SQL-4-Life
  • RE: How to get a row number which is failing during conversion

    Also your select statement will normally return a number of rows before it actually falls over so you could use that as a point in the DB to start looking...

    ----------------------------------------------
    Try to learn something about everything and everything about something. - Thomas Henry Huxley

    :w00t:
    Posting Best Practices[/url]
    Numbers / Tally Tables[/url]

    SQL-4-Life
  • RE: How to get a row number which is failing during conversion

    Steve, cause it's an overflow I recon it's not that there is char

    Also be careful because

    This will return a 1 for ISNUMERIC but it's not convertible: '10,0'.

    What I normally do...

    ----------------------------------------------
    Try to learn something about everything and everything about something. - Thomas Henry Huxley

    :w00t:
    Posting Best Practices[/url]
    Numbers / Tally Tables[/url]

    SQL-4-Life
  • RE: rebuild script

    What is it that you would like us to do?

    ----------------------------------------------
    Try to learn something about everything and everything about something. - Thomas Henry Huxley

    :w00t:
    Posting Best Practices[/url]
    Numbers / Tally Tables[/url]

    SQL-4-Life
  • RE: Dynamic Date Range in CASE?

    is this what you looking for :

    Select distinct d.Field1, Field2,

    count (CASE

    when Field3 = 1 and (DateField between...

    ----------------------------------------------
    Try to learn something about everything and everything about something. - Thomas Henry Huxley

    :w00t:
    Posting Best Practices[/url]
    Numbers / Tally Tables[/url]

    SQL-4-Life
  • RE: General Search/SQL Performance question

    could you supply us with the query plan and or the actual query and any indexes you have on the tables in use.

    This way we can see what is being...

    ----------------------------------------------
    Try to learn something about everything and everything about something. - Thomas Henry Huxley

    :w00t:
    Posting Best Practices[/url]
    Numbers / Tally Tables[/url]

    SQL-4-Life
  • RE: Offset in the date-time inserted while insertion

    Here is another solution:

    SELECT DATEADD(dd,DATEDIFF(dd,0,GETDATE()),0)

    This one doesn't do any conversions it simply does Math 🙂

    ----------------------------------------------
    Try to learn something about everything and everything about something. - Thomas Henry Huxley

    :w00t:
    Posting Best Practices[/url]
    Numbers / Tally Tables[/url]

    SQL-4-Life
  • RE: convert DateTime to BigInt

    I'm with Jeff on this, why do you need to make the change?

    ----------------------------------------------
    Try to learn something about everything and everything about something. - Thomas Henry Huxley

    :w00t:
    Posting Best Practices[/url]
    Numbers / Tally Tables[/url]

    SQL-4-Life
  • RE: How many have same values?

    Thanks for the reply with the answer 🙂

    Looks like the requirements changed a bit 🙁

    ----------------------------------------------
    Try to learn something about everything and everything about something. - Thomas Henry Huxley

    :w00t:
    Posting Best Practices[/url]
    Numbers / Tally Tables[/url]

    SQL-4-Life
  • RE: How many have same values?

    Is this the sort of thing you looking for?

    DECLARE @ptInsurancePlans TABLE

    (

    MRN INT,

    CarrierID INT,

    GroupID INT,

    InsuranceLevel INT,

    EffectiveDtTm DATETIME ,

    ExpirationDtTm DATETIME

    )

    INSERT INTO @ptInsurancePlans

    SELECT 1,1,1,1,'2008-01-01','2008-01-01' UNION ALL

    SELECT 1,2,2,2,'2008-01-01','2008-01-01' UNION ALL

    SELECT 1,1,1,1,'2008-01-01','2008-01-01'...

    ----------------------------------------------
    Try to learn something about everything and everything about something. - Thomas Henry Huxley

    :w00t:
    Posting Best Practices[/url]
    Numbers / Tally Tables[/url]

    SQL-4-Life
  • RE: cannot understand why query analyzer is picking a specific index.

    Awesome example Gail...

    I hope everyone reads this thread as it's a perfect example of teaching someone to fish rather than just feeding them...

    ----------------------------------------------
    Try to learn something about everything and everything about something. - Thomas Henry Huxley

    :w00t:
    Posting Best Practices[/url]
    Numbers / Tally Tables[/url]

    SQL-4-Life

Viewing 15 posts - 421 through 435 (of 1,082 total)