Forum Replies Created

Viewing 15 posts - 14,701 through 14,715 (of 14,953 total)

  • RE: Narrow down the recordset

    I may be missing something, but why not just use a Group By, Max(Date) and Having Count(*) > 1, type query on this?

    - Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
    Property of The Thread

    "Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon

  • RE: get all the child categories in the parent category

    Please provide a copy of the table structure.

    (Right click the table in Management Studio, select Script Table as -> CREATE to -> clipboard, then paste that into the forum here.)

    If...

    - Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
    Property of The Thread

    "Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon

  • RE: The Identity Debate

    I use Identity columns in many, but not all tables.

    For example, and identity is the best key I've found yet for people. Same name different person, same person different...

    - Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
    Property of The Thread

    "Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon

  • RE: Reindexing..

    "IDs" is a valid name for them. Same as "identities".

    "Indexes", on the other hand, are a means of storing parts of a table in a separate structure, to speed...

    - Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
    Property of The Thread

    "Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon

  • RE: Is there a way to overcome the limitation of 8k per record in a table?

    Vertical partion on the table is the only real way. Works just fine.

    - Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
    Property of The Thread

    "Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon

  • RE: Is there a reason why i get an error on line 4 next '=' ? Are variables not aloud in subqueries???

    You might try changing it to a derived table in the From clause, instead of an inline sub-query in the Select clause. I haven't tested that, but from what...

    - Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
    Property of The Thread

    "Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon

  • RE: SP - Stored Procedure

    Of course!

    - Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
    Property of The Thread

    "Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon

  • RE: Reindexing..

    Aha! You're using the wrong word. The word you want is "identities", not "indexes". ("Indexes" is probably the right word in some other context, but in SQL,...

    - Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
    Property of The Thread

    "Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon

  • RE: CASE with more than one result

    You'd need to have some sort of payment category datum. Then "Express Cash" and "Payment Services" could be part of the same category, and the case statement could refer...

    - Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
    Property of The Thread

    "Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon

  • RE: Is there a reason why i get an error on line 4 next '=' ? Are variables not aloud in subqueries???

    Timothy Ford (2/8/2008)


    I would focus on the derived table:

    (SELECT @list_id = COALESCE(@list_id + ', ', '') + ' ' + LTRIM(RTRIM(pit1.secondary_id))

    FROM partyInfoTable pit1

    WHERE pit1.primary_id = pidt.primary_id) as list_id

    Pay...

    - Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
    Property of The Thread

    "Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon

  • RE: Is there a reason why i get an error on line 4 next '=' ? Are variables not aloud in subqueries???

    You don't have a comma after "pidt.primary_id" on the first line of the outer select.

    If you get rid of the "@list_id = " part of the sub-query, it compiles. ...

    - Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
    Property of The Thread

    "Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon

  • RE: SP - Stored Procedure

    Joe Celko (2/7/2008)


    No, of course not! Think about it for a minute. Tables are all different; they model one and only one kind of entity. So your...

    - Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
    Property of The Thread

    "Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon

  • RE: get all the child categories in the parent category

    I've had to solve this one numerous times.

    A cursor is deadly slow.

    A while loop is pretty fast.

    A CTE is the fastest, but only by a small margin.

    Here are some tests.

    Set-up:

    use...

    - Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
    Property of The Thread

    "Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon

  • RE: Add weighing to rank outcome

    Sounds to me like you'll need to add a column to the Rank function. Something like "(select count(*) from uploads where userid = users.userid)". Join to a CTE/Derived...

    - Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
    Property of The Thread

    "Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon

  • RE: IDENTITY column on PRIAMRY KEY list

    It seems odd to me to have an identity column be part of a primary key, as opposed to being the whole primary key by itself.

    The way the table is...

    - Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
    Property of The Thread

    "Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon

Viewing 15 posts - 14,701 through 14,715 (of 14,953 total)