Forum Replies Created

Viewing 15 posts - 14,026 through 14,040 (of 14,953 total)

  • RE: using regular expressions

    System views can give you this information without having to roll your own pattern matching.

    sys.procedures has all the procs listed in it.

    sys.all_parameters has the parameters.

    sys.types has the data types.

    select procs.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: SQL Job - Deadlock

    Is the job something you can change the isolation level on? Or change the sequence in which it locks resources?

    - 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: passing parameters to function w/ inner join

    Gail (4/25/2008)


    GSquared (4/24/2008)


    How accurate do you need this to be?

    Let's say you're starting with latitude 47.61, longitude -122.34 (which happens to be in Seattle, WA), and you want to find...

    - 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: Get rid of Dynamic SQL

    One way to do this is liberal use of IsNull/Coalesce in the Where clause. For example:

    Where MonthToDate_Total >= Coalesce(@MTDGreaterThan, -1) -- Assumes can't validly be negative

    and MonthToDate_Total <= Coalesce(@MTDLessThan,...

    - 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: querying a string

    Jeff Moden (4/25/2008)


    MarkusB (4/25/2008)


    The most simple option would be using LIKE

    SELECT myvarcharCol from mytable

    WHERE myvarcharCol LIKE '%project%'

    Another option would be using the PATINDEX function

    SELECT myvarcharCol from mytable

    WHERE PATINDEX('project',myvarcharCol) > 0

    Try...

    - 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: Extracting Rows from Delimited Strings

    This one will handle the data even if one or more of the rows is incomplete:

    create table #Raw (

    ID int identity primary key,

    RawData varchar(100))

    insert into #Raw (rawdata)

    select parsed

    from common.dbo.stringparserxml('"S9000+"

    "UV+...

    - 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: Replace non numeric characters in string

    I don't think he actually posted the code for this one.

    - 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: location of stored procedure code in system tables

    SQL 2000 has it in syscomments, 2005 has it in sys.sql_modules.

    Syscomments breaks it up into 4000 character chunks (if I remember correctly), so it can take more than 1 row.

    Sys.sql_modules...

    - 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: Why are the table name different from 2000 v 2005 for ASPState DB

    I'm not completely clear on what you're asking. But if what you're looking for is something that lists out the system tables in SQL 2000 or SQL 2005, 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: Replace non numeric characters in string

    Now, can that be added into Matt's regex easily, to deal with removing all other non-numeric symbols, but leaving complex numbers intact?

    - 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: Why my function is returning NULL value but actural code can return correct value?

    Missing data but non-null parameter. I didn't think of that and should have. Clever solution, you guys.

    - 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: Report in Visual Studio.. Case statements results on same line

    Try adding an Else statement to each of your cases. See what's in that 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: To Cascade or not To Cascade...that is the question

    Yes, they do have that advantage. It is easier.

    But, since a missing delete will raise an error if you have your foriegn keys set up correctly, adequate testing should...

    - 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: Date to string

    If you use DateName instead of DatePart, for the year part of your calculation, it will be a string already, and you won't need to convert it to varchar.

    - 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: passing parameters to function w/ inner join

    If you're happy with your current function, look up Apply in Books Online. It tells you how to "join" to a UDF with input parameters based on the columns...

    - 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 - 14,026 through 14,040 (of 14,953 total)