Forum Replies Created

Viewing 15 posts - 13,141 through 13,155 (of 14,953 total)

  • RE: Compare 2 tables

    You can always build a set of left outer joins between the two tables. That'll give you which exact column was modified.

    Something like:

    select t1.Col1

    from dbo.Table1 t1

    left outer join 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: Sample Data Required

    If you don't need the data to actually mean anything, you can generate unlimited random data by doing something like:

    ;with Numbers (Number) as

    (select row_number() over (order by t1.name)

    ...

    - 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: Making duplicates unique

    In 2005, take a look at Row_Number in Books Online. It's very simple and easy to use.

    For 2000, take a look at Jeff Moden's Running Totals article 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: Can I only install Mgmt Studio?

    I know how to do it from within installation wizard, but haven't looked into a command line for it. But since it can be done from the installation wizard,...

    - 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: Checking for query in transaction logs

    If the database is in Simple Recovery, no, you don't have anything of any interest in the transaction log. It only holds onto transactions till they commit, then junks...

    - 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 Group by Error

    I don't see any aggregate functions in this query. If I'm missing one, I'd try removing each piece of the Group By till you find the one that's 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: 2005 SQL Agent strange problem

    I also would try switching to the built-in notifications function and see if that handles it better.

    As far as a job going on to a step that doesn't apply, I...

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

    The first thing to do is define what you want it to do.

    - 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: Handling hirarchy in tables

    If the hierarchy is relatively static (doesn't change often), you might want to look up "nested sets" online. It does hierarchies MUCH faster than CTEs or other methods. ...

    - 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: Inserting row with Procedure

    Am I mistaken, or did you answer your own question?

    - 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 get the list of dates between two dates usind sql query?

    You can use a Numbers table for this. Or a recursive CTE. I use a calendar table for it. It's generally faster, and it gives me more...

    - 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: A question about selects.

    There can be differences in performance and results between the two ways of writing the query. In a more complex query, having the join data in the From clause...

    - 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: String Execution in SQL

    Mahesh Bote (6/26/2008)


    [font="Verdana"]

    Try this...

    declare @i varchar(100)

    set @i = '''as400'',''cps'''

    select * from t_system where systemcode in (@i)

    Mahesh

    [/font]

    That won't work. "In" doesn't work that way with variables.

    There are a couple...

    - 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: Frequent calls to sp_send_dbmail result in only few actually sent emails

    Is it possible that the send-credentials are being messed up by the whole From part? I've used sp_send_dbmail for tons of things, including pretty high traffic stuff, and never...

    - 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 T-Sql really that hard to learn?

    David O (6/26/2008)


    Jeff

    Have you consider decaf?:w00t:

    David

    Nah. It's just that time of the hour for him. 🙂

    He does have a good point. I've worked with people who could build...

    - 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 - 13,141 through 13,155 (of 14,953 total)