Forum Replies Created

Viewing 15 posts - 571 through 585 (of 1,082 total)

  • RE: Return from a cursor with resome

    what is the some processing select stuff?

    Depending on what it is you may not need a cursor

    ----------------------------------------------
    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: Question on DATEADD

    well other than the fact that you missing half the BETWEEN statement I would say yes almost there.

    c.Date > = DATEDIFF(yy,-5,GETDATE())

    Please not the this will take into account time as...

    ----------------------------------------------
    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: Create a table with select statment values from store procedure

    Ok cool.

    My question is why do you need a table, I'm going to assume that you want to work with the data set from the proc.

    I assume this because otherwise...

    ----------------------------------------------
    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: Create a table with select statment values from store procedure

    Are you doing a pivot in your proc call?

    What is it that you want to achieve here it might help us help you.

    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: ADHOC suddenly taking a long time

    Is the plan the same or different?

    Could you post the plan for sum of us to look at?

    ----------------------------------------------
    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: ADHOC suddenly taking a long time

    Have you had any recent data changes as in large amounts of updates or inserts?

    I would check the stats on the indexes in that query

    ----------------------------------------------
    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: please help with query regarding reports

    HI there,

    OK this is still not clear to me.

    Please could you read this:

    http://www.sqlservercentral.com/articles/Best+Practices/61537/

    Then re-post your data samples for input and output

    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: please help with query regarding reports

    ok based on your first post I wrote up a query.

    Does that query work?

    ----------------------------------------------
    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: please help with query regarding reports

    Ok without a table structure or sample data and a sample of what you want to output this is hard.

    but this is what I have so far:

    [font="Courier New"]

    DECLARE @imports TABLE

    (

    qty...

    ----------------------------------------------
    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: please help with query regarding reports

    what are the possible years?

    ----------------------------------------------
    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: Get Top Items by Group

    yes read up about the partitioning it's sort of like a "GRouping"

    ----------------------------------------------
    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: Get Top Items by Group

    Try this:

    [font="Courier New"]

    DECLARE @MyTable TABLE

    (

    [Id] INT,  

    [User] VARCHAR(10),        

    [Item] CHAR(3),      

    [EventTime] DATETIME

    )

    INSERT INTO @MyTable

    SELECT 1,'Bob','AAA','2008-02-02 11:02:51.000' UNION ALL

    SELECT 2,'Bob','BBB','2008-02-04 09:10:52.000' UNION ALL

    SELECT 3,'Sue','CCC','2008-02-04 15:00:13.000' UNION ALL

    SELECT 4,'Bob','DDD','2008-02-04 16:02:05.000' UNION ALL

    SELECT 5,'Peter','EEE','2008-02-07 16:03:43.000'...

    ----------------------------------------------
    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

    Hi there,

    I'm sure there is a set based solution to this which I will try and find.

    But for now here is my solution.

    I left the last part out which is...

    ----------------------------------------------
    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

    HI there,

    I'm not sure I understand how you are getting your result?

    Please could you explain a bit more how to construct the new row?

    e.g

    Show distinct start_dates + All End dates...

    ----------------------------------------------
    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: NOT NULL and Spaces

    Lynn yours would work if you LTRIM RTRIM the status first.

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