Forum Replies Created

Viewing 15 posts - 8,311 through 8,325 (of 14,953 total)

  • RE: Your Point of View

    I have to say that the car analogy to software is, while tempting and poetic, horribly flawed.

    First, a car really has one purpose, which is to get you from 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: SP with substring

    Patindex finds the first place that the substring appears. It nests that in Left, which gets everything up to that point. Then it replaces that in the string.

    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: Exec @SQL not working

    Are you using:

    exec (@SQL)

    or

    exec @SQL?

    The difference is the parentheses.

    - 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: Alter all the bit columns to allow null

    The results of the script I posted should look something like this:

    alter table dbo.MyTable alter column MyBitColumn bit null;

    alter table dbo.MyTable alter column MySecondBitColumn bit null;

    alter table dbo.MySecondTable alter column...

    - 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 help with a query

    You should be able to modify this to fit your needs:

    /*

    Multi-row string concat using XML and string functions.

    Pretty slick trick. Got it from RBarryYoung and Lynn Pettis on SSC.

    */

    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: CTE's and Temp tables??

    There are (basically) two ways to do this:

    ;with CTE1 (Col1) as

    (select 1 union all

    select 2)

    select Col1

    into #T

    from CTE1;

    or

    create table #T (

    Col1 int);

    ;with CTE1 (Col1) as

    (select 1 union all

    select 2)

    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: Alter all the bit columns to allow null

    Did you actually run the script from the results?

    I tested it, and it reset the columns in my table to allow nulls.

    - 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 can i increase datafile dynamically

    Steve: That looks like it's missing a close-paren on the string. Or am I missing something?

    - 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: Running DOS Command Prompt(cmd) command thought SSMS

    Take a look at xp_cmdshell. That allows you to run command prompt batches/commands from T-SQL.

    Be warned that it does create security risks if you turn that on. (It's...

    - 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: Sum not subtracting Negative Numbers?

    That looks correct.

    Test data would just be a matter of posting an insert statement with a few rows (5 or 10 is usually enough).

    Generally, I leave that kind of summary...

    - 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: Audit Log Question - May be silly

    Silverfox (9/28/2009)


    GSquared (9/28/2009)


    These two articles and their discussions cover the subject pretty thoroughly. If you haven't already, you might take a look at them:

    http://www.sqlservercentral.com/articles/Auditing/63247/

    http://www.sqlservercentral.com/articles/Auditing/63248/

    Very good articles, the author 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: Alter all the bit columns to allow null

    select * from sys.systypes

    Run that. It'll give you the type ID for every system data type.

    - 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: Logging record changes....

    If you have the before and after data, there's a trick you can do with it that will give you the fields that changed.

    create table #Before (

    ID int identity primary...

    - 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: Alter all the bit columns to allow null

    You're welcome.

    - 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: CTE's and Temp tables??

    CTEs only apply to the statement they appear in.

    What you would need to do is load the first CTE into a temp table, then the second, then the third.

    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

Viewing 15 posts - 8,311 through 8,325 (of 14,953 total)