Forum Replies Created

Viewing 15 posts - 10,306 through 10,320 (of 14,953 total)

  • RE: another problem I can't seem to work out.

    Use this:

    declare @ID int;

    --

    select @ID = productcontrolid

    from productcontrol

    where productcontrolid in

    (select top 25 productcontrolid

    from productcontrol

    order by productcontrolid desc);

    That'll get you an ID you can use for your update.

    Then just write whatever...

    - 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 TOP 100 based on sub query

    This should get you what you want.

    ;WITH

    CTE1 as

    (SELECT

    M.MemberId

    ,M.MemberForename + ' ' + M.MemberFamilyName AS MemberName

    ,FP.ProjectName

    ,FC.CampaignName

    ,FD.DonationPromisedAmount

    ,FD.DonationReceivedNet

    ,CASE

    WHEN...

    - 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: Almost Like a Service Pack

    mark.hammond (3/24/2009)


    I don't believe this is the first layoff at Microsoft. A friend was laid off from their graphics department in the 1990's.

    It's their first mass layoff, per 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: update data from one table to other table when both have unique identifier.

    That's an Oracle error message, unless I'm much mistaken.

    I'm pretty sure Oracle doesn't support Update From.

    Are you using Oracle? If so, why post the question in an SQL Server...

    - 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: Need improved approach to setting up Sql permissions

    Barkingdog (3/23/2009)


    Greg,

    You wrote

    >>> 2. I see no reason for a developer to ever be dbo of a production database. As GSquared said, they should do their troubleshooting in dev or...

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

    To steal from Ron White: I'm anywhere from 5'10" to 6'2", depending on which convenience store I'm leaving. 🙂

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

    Glad I could help.

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

    The way I'm reading the LOB data is that you can alter a non-clustered index on a heap, and if it contains LOB data in the include colums, you'll get...

    - 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: Missing indexes

    Really, you can't just follow the recommendations that the server gives you. You have to understand how indexes work, and then test the recommendations in a test environment.

    If you...

    - 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: update data from one table to other table when both have unique identifier.

    Is this what you're looking for?

    update Table2

    set columnA = column1

    from Table1

    where key1 = key2;

    - 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: PLEASE Help with sp_ExecuteSQL!!!!

    What are your functions returning?

    - 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: COUNT Question

    Look up Count in Books Online, and Group By.

    Basically, it's going to look like:

    select EmployeeID, count(*)

    from dbo.MyTable

    group by EmployeeID;

    - 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: Need improved approach to setting up Sql permissions

    1.Devs as dbo for the dev database should be fine. Should have a test server/database where they are not dbo, and where they use the "regular" login, in order...

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

    Needs to be:

    WHERE CHECKSUM(a.empid,a.empname,a.empph) != CHECKSUM(staging.empid,staging.empname,staging.empph);

    Try that, see if it gets 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: Is it possible to simulate the cross apply function?

    There are ways to simulate cross apply. You have to build a query that does what the function does, but which doesn't have input parameters. Then you include...

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