Forum Replies Created

Viewing 15 posts - 586 through 600 (of 1,082 total)

  • RE: Bootstrap

    You know the situation is bad, when you need a job to pay the taxes of another job 🙂

    ----------------------------------------------
    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: Separate a column into 2 columns

    Hi

    This is a basic example you may need to change it if you don't want leading spaces etc.

    DECLARE @string VARCHAR(100)

    SET @string = '123-458-856 -AD45 EXP 01/01/01'

    SELECT

    @string as [My...

    ----------------------------------------------
    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: DISTINCT AND COUNT

    try something like this:

    SELECT

    [Col1],

    [Col2],

    COUNT(*) as [Number of Dups]

    FROM [MyTable]

    GROUP BY --Use this for the rows you are comparing

    [Col1],

    [Col2]

    HAVING COUNT(*) > 1 --Only return rows where there are more than...

    ----------------------------------------------
    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: DISTINCT AND COUNT

    Hi,

    SELECT COUNT(DISTINCT ...)

    Will return a count unique of none-null values

    SELECT DISTINCT COUNT(...)

    Will return a distinct value for the count of all none-null values

    Add an extra column to a DISTINCT...

    ----------------------------------------------
    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: Happy Halloween 2008!

    Once upon a database there was a scary database owner.

    One day the database owner created lots of tables full of sweets.

    The following day an Index tried to scan some of...

    ----------------------------------------------
    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: Date issue

    HI There,

    try using the SET DATEFORMAT So that the system knows how to read your string.

    e.g

    SET DATEFORMAT dmy

    DECLARE @val VARCHAR(100)

    SET @val = '27/08/2008 05:37'

    SELECT CAST(@val as DATETIME)

    Thanks

    Chris

    ----------------------------------------------
    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: Change Where clause causes HUGE performance problem

    Sorry Guru,

    I totally understand.

    I guess I was just hoping that someone would spot a QUICK lucky fix for me.

    wishful thinking I guess

    ----------------------------------------------
    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: Change Where clause causes HUGE performance problem

    HI all,

    I think this is all the information need with regards to the from clauses of the views and that tables with there row counts and all the indexes on...

    ----------------------------------------------
    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: Change Where clause causes HUGE performance problem

    HI all,

    OK the view can't be indexed cause it has left joins in it 🙁

    Oh I also can't use temp tables cause the query is created dynamically by our Website...

    ----------------------------------------------
    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: Change Where clause causes HUGE performance problem

    HI all,

    Thanks for all the support.

    The wierd thing is that the where clause is on a table that only has 170+- rows in it.

    It seems that the problem is coming...

    ----------------------------------------------
    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: Change Where clause causes HUGE performance problem

    HI Grant,

    Ok there are no nest table functions, so I'll try and do a another stats update but with full scan this time.

    After that I'll have to supply the tables...

    ----------------------------------------------
    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: Change Where clause causes HUGE performance problem

    OK two problems I'm told.

    1 - Can't use the force casue our website builds the query so we can't use the force all the time incase it affects other queries....

    ----------------------------------------------
    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: Change Where clause causes HUGE performance problem

    The views are not indexed

    I'll have a look at indexing them and see if it makes a difference.

    just wierd that the force order works 🙁

    ----------------------------------------------
    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: Change Where clause causes HUGE performance problem

    no

    looks like I might not beable to implement the force plan.

    So I'm hoping someone could help me with the difference in plans I already supplied

    ----------------------------------------------
    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: Change Where clause causes HUGE performance problem

    OK might have found a solution but I'd like to know the impact.

    Adding a OPTION (FORCE ORDER)

    to the end of the query makes it run super fast.

    What are the draw...

    ----------------------------------------------
    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 - 586 through 600 (of 1,082 total)