Forum Replies Created

Viewing 15 posts - 5,491 through 5,505 (of 14,953 total)

  • RE: UPDATE vs SELECT statements produce diff row stats with same conditions

    Your join is multiplying the number of rows in the target table.

    Try this:

    CREATE TABLE #T1 (

    ID INT IDENTITY PRIMARY KEY,

    Col1 CHAR(1));

    CREATE TABLE #T2 (

    ID INT IDENTITY PRIMARY KEY,

    T1ID INT,

    ColA CHAR(1));

    INSERT...

    - 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: Upper/lower case text

    Yes, it's slower. That's because of the extra checks for word-breaks on variable delimiters.

    - 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: Convert formula to sql

    If that's Excel, which is what it looks like, Offset isn't something that translates directly to T-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: Are the posted questions getting worse?

    CirquedeSQLeil (1/4/2011)


    GilaMonster (1/4/2011)


    <sigh> Talking plagiarism. He really should know better...

    http://www.sqlservercentral.com/Forums/Topic1042151-2799-1.aspx

    Missed it - what was it. Looks like Steve took it down.

    I "Report"ed it as plagiarism, so it's no surprise...

    - 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 search for a pattern of consecutive records?

    That would work. Do it in a temp table instead of the real table, and query the temp table. That way, you don't mess up 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: help for sql

    Take a look at "SUM" in Books Online (or on MSDN). T-SQL can aggregate data with functions like Sum, Max, Min, Avg, and so on.

    - 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: help for sql

    It looks to me like you have what you need in order to write a query. What's your 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 search for a pattern of consecutive records?

    First you need to identify the prior n rows for each set (dog, cat, etc.) for each entry. That can be done by using row_number and partitioning by 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: Upper/lower case text

    Here's a Title Case script I set up that avoids UDF overhead. It assumes you have a Numbers table. You can use the CTE from Jeff's script 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: Welcome to 2011

    I still think the most important resolution one can make is to enjoy the new year more than the last.

    Then work out ways to do so. You can always...

    - 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: Scope: The drastic caveat with Logon Triggers.

    Event notification works. I use a server-side trace for login events to get the same sort of data, mainly just because I've been doing that for eons at 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: Error: Initializing SQL Server Reconcilier has failed

    Not really. I'd pretty much just be poking around and talking to my network people at this point.

    - 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: logon triggers featuring EXECUTE AS is a good practice?

    I generally have login triggers use a sysadmin account. If you don't, and the trigger ends up blocking you from logging in, it's gets really messy really fast.

    - 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: change the following query to storedprocedure

    koolme_85 (1/3/2011)


    can you tell me how i can use parameters for the where clause in the following query

    thanks

    regards

    greg

    Do you know what parameters are?

    Do you know what 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: change the following query to storedprocedure

    It depends.

    Do you want any parameters? Perhaps something for the Where clause. That would be pretty normal for a stored procedure.

    - 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 - 5,491 through 5,505 (of 14,953 total)