Forum Replies Created

Viewing 15 posts - 91 through 105 (of 683 total)

  • RE: upper and lower case pattern detection?

    Here's another option...

    declare @t table (name varchar(20))

    insert @t

    select 'DeBeers'

    union all select 'Smith'

    union all select 'debeers'

    union all select 'McTavish'

    union all select...

    Ryan Randall

    Solutions are easy. Understanding the problem, now, that's the hard part.

  • RE: DISTINCT command but with extra details

    ; with a as (select *, row_number() over (partition by Location order by ScanDate desc) as Row from YourTable)

    select * from a where Row = 1

    Ryan Randall

    Solutions are easy. Understanding the problem, now, that's the hard part.

  • RE: Obtaining year and week numbers from a date in SQL

    If you want a whole bunch of them, you should consider making use of this date function...

    http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=61519

    select DATE, ISO_YEAR_WEEK_NO from dbo.F_TABLE_DATE('1/1/2008', '1/1/2009')

    Better still, use that function to create a permanent,...

    Ryan Randall

    Solutions are easy. Understanding the problem, now, that's the hard part.

  • RE: Obtaining year and week numbers from a date in SQL

    select ltrim(year('01/01/2008')) + right('0' + ltrim(datepart(week, '01/01/2008')), 2)

    Ryan Randall

    Solutions are easy. Understanding the problem, now, that's the hard part.

  • RE: dynamic variable?

    is250sp (5/14/2008)


    now i get this error.....

    Msg 170, Level 15, State 1, Line 1

    Line 1: Incorrect syntax near ';'.

    What version of SQL Server are you using? What's the compatibility level on...

    Ryan Randall

    Solutions are easy. Understanding the problem, now, that's the hard part.

  • RE: walking up the tree - interesting scenario

    I can only suggest things to try. You'll then have to test them (if they are feasible) to see if they improve the performance on your system and on the...

    Ryan Randall

    Solutions are easy. Understanding the problem, now, that's the hard part.

  • RE: Propercase Function Assistance!

    Yep - you're spot on! 🙂

    The square brackets help you look for "any single character within the specified range ([a-f]) or set ([abcdef])"

    http://msdn.microsoft.com/en-us/library/ms179859.aspx

    Ryan Randall

    Solutions are easy. Understanding the problem, now, that's the hard part.

  • RE: Propercase Function Assistance!

    Where did you put it?

    Ryan Randall

    Solutions are easy. Understanding the problem, now, that's the hard part.

  • RE: Propercase Function Assistance!

    I think it will work if you add a dot to the separator list - i.e. change all instances of '%[-( '']%' to '%[-( ''.]%' 🙂

    Ryan Randall

    Solutions are easy. Understanding the problem, now, that's the hard part.

  • RE: Regarding pro* c select statement

    This is a common beginners' request. You should get to grips with the following article to give you an idea of what you might be getting into...

    http://www.sommarskog.se/dynamic_sql.html

    Ryan Randall

    Solutions are easy. Understanding the problem, now, that's the hard part.

  • RE: Converting Integer to Text

    Use varchar rather than text?

    Ryan Randall

    Solutions are easy. Understanding the problem, now, that's the hard part.

  • RE: How do I get rid of this correlated sub-query and avoid the RBAR?

    Jeff Moden (5/12/2008)


    Heh... not my blog, Ryan. I think that's Jeff Smith's, but I'm not sure.

    LOL - yes I know it's not your blog. I guess you missed the...

    Ryan Randall

    Solutions are easy. Understanding the problem, now, that's the hard part.

  • RE: How do I get rid of this correlated sub-query and avoid the RBAR?

    rhandloff (5/12/2008)


    Thanks for all the solutions! I don't know if I will have time to adequately test them all as I'm under a pretty intensive deadline but just from a...

    Ryan Randall

    Solutions are easy. Understanding the problem, now, that's the hard part.

  • RE: How do I get rid of this correlated sub-query and avoid the RBAR?

    Jeff Moden (5/12/2008)


    Isn't CROSS APPLY just another name for "correlated sub-query"?

    😛

    It sure is, but if it's the fastest method, who cares? 🙂

    It's something else to try, anyway, and I'm interested...

    Ryan Randall

    Solutions are easy. Understanding the problem, now, that's the hard part.

  • RE: Convert ASCII to time format

    I don't understand how the values are derived in your example, but perhaps you want something like this?

    declare @t table (TimCol varchar(3), Col2 varchar(10))

    insert @t

    ...

    Ryan Randall

    Solutions are easy. Understanding the problem, now, that's the hard part.

Viewing 15 posts - 91 through 105 (of 683 total)