Viewing 15 posts - 91 through 105 (of 683 total)
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.
May 16, 2008 at 10:36 am
; 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.
May 14, 2008 at 11:31 am
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.
May 14, 2008 at 10:14 am
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.
May 14, 2008 at 10:06 am
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.
May 14, 2008 at 9:56 am
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.
May 14, 2008 at 9:37 am
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.
May 14, 2008 at 8:13 am
Where did you put it?
Ryan Randall
Solutions are easy. Understanding the problem, now, that's the hard part.
May 14, 2008 at 6:45 am
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.
May 14, 2008 at 6:28 am
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.
May 14, 2008 at 6:23 am
Use varchar rather than text?
Ryan Randall
Solutions are easy. Understanding the problem, now, that's the hard part.
May 13, 2008 at 5:07 am
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.
May 12, 2008 at 6:31 am
rhandloff (5/12/2008)
Ryan Randall
Solutions are easy. Understanding the problem, now, that's the hard part.
May 12, 2008 at 6:22 am
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.
May 12, 2008 at 5:27 am
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.
May 12, 2008 at 4:56 am
Viewing 15 posts - 91 through 105 (of 683 total)