Forum Replies Created

Viewing 15 posts - 6,256 through 6,270 (of 14,953 total)

  • RE: code to select highest in each of several catagories

    Take a look at Rank, Dense_Rank, and Row_Number. Those should give you what you need.

    - 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: Nonclustered Index on Temp Table

    Build cost vs use cost is an important part of determining whether to index a temp table. That's definitely true.

    Most of the time, if a temp table should have...

    - 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: SQL Job Dependencay

    Set them up as sequential steps in a single job.

    If you need to add a delay in between, set that up as step in between.

    - 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: Best practice scheduled maintenance downtime vs ad hoc live changes?

    This is going to depend on a LOT of factors.

    If, for example, your business requires 24x7x365 uptime, then you will pretty much have to apply them "on the fly".

    As for...

    - 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: One Time Passwords

    alan.paxton (11/4/2010)


    This could be done by adding two columns to your user table. They are:

    LoginCount int null

    AllowedLoginCount int null

    If AllowedLoginCount is greater then zero, this is how many time 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: Nonclustered Index on Temp Table

    TheSQLGuru (11/4/2010)


    I am going to step outside the box here and ask WHY you want to put a nonclustered index on a temp table?? In almost 15 years of...

    - 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 copy a table's index definitions and apply to copy of table ?

    Start with sys.indexes and sys.index_columns. Read up on those, and it'll get you started.

    Really though, I'd get a product like RedGate's SQL Compare or ApexSQL's Diff, which can compare...

    - 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: SQL Server Express for Mac ??

    You'd have to run it in a Windows VM. That would be easy enough to set up.

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

    Geoffrey Wrigg (9/3/2010)


    SQL Server DBA on the prowl at a singles bar:

    SELECT Date

    FROM Clientele

    WHERE Attached = 'FALSE'

    ORDER BY BloodAlcoholContent DESC

    😛

    And the execution plan for that is some sort of Re-BAR?

    - 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: One Time Passwords

    You could easily set something like this up with a login trigger.

    The problem would be getting and remembering the new password once it's issued, so the trigger would need to...

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

    And here I thought it was called by the more formal name, "bumping into someone in the hall and asking a question about a project". I guess "swarm" does...

    - 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 want to insert values from data table to emp table

    Yes, a case statement is another option.

    I don't like to use them when a table can be used, because changing data in a table doesn't require rewriting code, but changing...

    - 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: Select * from a table with one billion rows failing

    David Webb-200187 (11/3/2010)


    Was the error thrown on the database server or on the client receiving the data? Was there an 'order by' on the select?

    Honestly, does it matter whether...

    - 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: request a parameter when running sql

    CELKO (11/3/2010)


    No. SQL is not an application language; it is a data retrieval and management language.

    What you want is to return to the old days when 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: Subquery Returns No Rows when there are NULLs and "NOT IN" is used

    GilaMonster (11/3/2010)


    GSquared (11/3/2010)


    The Not Exists version is very similar, and SQL Server will often convert it to a Not In query anyway, behind the scenes.

    Except it behaves differently in 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

Viewing 15 posts - 6,256 through 6,270 (of 14,953 total)