Forum Replies Created

Viewing 15 posts - 31 through 45 (of 14,953 total)

  • RE: Dynamically passing values to IN clause.

    You already have a temp table with the values you want. Why not use that and do:

    IN (

    SELECT RoleName FROM #Role WHERE @Role = 'ProjectManager'

    UNION ALL

    SELECT @Role)

    Wouldn't that be...

    - 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 3 parameters as delimited list - Goal 500 milliseconds

    Instead of the complex OR construct in your Where clause, you might try splitting it up into three queries, one for each parameter, and then using Union All to put...

    - 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: Trying to compare parts of a single string in change log record to exclude zip +4 changes

    It looks to me like you'll need to extract a sub-string of the Full Address that excludes any Zip+4 value.

    You can do that with PatIndex and SubString functions.

    - 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: RESEED identity with no gaps has existing data

    Take a look at using a Sequence object instead of an Identity property. You can control Sequence values very easily.

    - 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: Data archival method - viable?

    Any reason to not just back up the database and then clean out the old data from the live copy?

    A backup has the advantage of maintaining point-in-time consistency between tables,...

    - 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 me to convert Image data type as html content

    Image is a binary datatype. HTML is text.

    Do you mean you have an image (a jpg, png, bmp, or similar) file stored as "image" datatype (binary), and you want...

    - 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: Have You Designed a Database from Scratch?

    I've designed lots of databases from scratch.

    The most important part of the process is to remember that it has to be maintainable and extensible. "Clever" solutions are almost 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: Moving Large Table to Different File Group

    The usual way to do that is to rebuild the clustered index into the new filegroup ("CREATE INDEX WITH DROP_EXISTING" is one way to do that, if I remember correctly).

    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: filter out not numeric values

    The performance on that might not be great, but it should work.

    Better would be to have a typed column with Int data in it, but if you can't get that,...

    - 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: ssrs 2008 report link back to original ssrs 2008 report

    Are you just talking about drilldown reports?

    - 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: filter out not numeric values

    If you're on SQL 2012 or later (as per the forum the question is in), you can add Try_Cast or Try_Convert to the code.

    Select CASE WHEN (TRY_CAST(ABS.VALUE AS INT)<90 AND...

    - 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: Average of text field in SSRS report

    Depends on what you mean by "average" with regard to a text field. Does that mean if one value is "A" and another is "C", it averages to "B"?

    - 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: Interview Questions

    Jeff Moden (6/15/2016)


    GSquared (6/15/2016)


    Jeff Moden (6/14/2016)


    GSquared (6/14/2016)


    Jeff Moden (6/10/2016)


    Eric M Russell (6/10/2016)


    Eric M Russell (6/7/2016)


    They're asking the wrong type of questions for a job interview.

    I'm not saying that string manipulation...

    - 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: Function to convert a datetime value into a harvest season year

    Jeff Moden (6/15/2016)


    GSquared (6/14/2016)


    I just tested a Calendar table version against the UDFs defined here.

    Calendar table was consistently about 10X faster.

    Can you post your test code?

    Nope. The Post function...

    - 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 delete part of the history from the log file?

    There really isn't a way to go back in time and truncate everything older than 30 days from the tran log.

    And, yes, for companies using passive-audit techniques, there are times...

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