Forum Replies Created

Viewing 15 posts - 10,741 through 10,755 (of 14,953 total)

  • RE: how to combine values generated from XML a field in table and fields from other tables and same table

    You can put a sub-query in the Select clause. Put parentheses around it and treat it as a column.

    For example:

    select Col1,

    (select ColA, ColB

    from dbo.Table2

    ...

    - 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: License Downgrade Then Upgrade to Original License

    How did you "downgrade"?

    - 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: ...I'll apologize in advance...

    Try this:

    SELECT Type, mrPriority, COUNT(*) AS P3HardwareCount

    FROM MASTER6

    GROUP BY Type, mrPriority

    See if that gets you closer to 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: how to Update One table from Multiple Tables?

    You could set up a trigger on the tables you want to monitor, and whenever they are updated, have them insert into this table, after checking to make sure they...

    - 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: Learning resources for T-SQL?

    Cool. I haven't paid attention to what versions of the books are available recently.

    - 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: Defragmenting indices on tables with a small number of pages

    I read somewhere that the limit was 8, but I'm not sure how universal that 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

  • RE: Result set truncated from view when using order by

    I would tend to say there are only 78 rows that satisfy the Where clause outside the view that are in the criteria within the view.

    First you ask for the...

    - 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: optimization help

    I see a fair number of bookmark lookups in the execution plan. You might want to look into what you have for indexes on this query. Covering indexes...

    - 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: optimization help

    Correlated sub-queries in the join criteria was my first thought for the cause of the slowness, but I wanted to see the execution plan to see what SQL Server did...

    - 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: Are the posted questions getting worse?

    I don't know about the three or more spaces thing. I've seen ones with punctuation and such that were basically a full description of the purpose of the database....

    - 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: Find user tables that have been updated in past week

    If you don't have an active auditing system (like triggers), and don't have a trace running, but do have the database in full recovery mode, you can get this data...

    - 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: Are the posted questions getting worse?

    jcrawf02 (2/25/2009)


    *sniff *sniff - smells like fish in here. :hehe:

    I think perhaps what we're looking for are a couple of questions that need to be answered as part of the...

    - 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: Using ISNUMERIC to determine JOIN criteria?

    Assuming you're using SQL 2005 from the forum posted in, try this:

    ;with

    AddNumCTE (ID, AddNum) as

    (select cust_num, left(add_number, charindex(' ', add_number, 0))

    from #cust_address

    where isnumeric(left(add_number, charindex(' ', add_number, 0))) = 1),

    AddStrCTE (ID,...

    - 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: Are the posted questions getting worse?

    Bob, it's a good thought, but it doesn't take the concept far enough.

    Civilization exists to allow people to specialize so they can help each other out.

    I need to get a...

    - 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: Index Question -Why the optimizer use ..

    Because the index doesn't include all the columns being used, so going with the clustered index (which has all the columns) will be faster and easier for the server.

    You can...

    - 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 - 10,741 through 10,755 (of 14,953 total)