Viewing 7 posts - 46 through 53 (of 53 total)
I think you want something like this (you'll need to complete the list of tables, I only included the first few for the sake of brevity):
exec sp_MSForEachTable
@command1 = 'update...
June 7, 2010 at 7:27 am
Thanks Jeff, I'll fix that in the production code too!
darn flies!
declare @rangeTable table (start int, [end] int)
insert @rangeTable
(Start, [End])
select 1, 2...
June 7, 2010 at 6:08 am
Here's a quick-and-dirty scalar function to generate a pseudo-random string of UpperCase letters, LowerCase letters and Numbers.
There's no error checking, and it will give arithmetic overflow errors if...
June 7, 2010 at 5:45 am
This looks very much like a recent problem posed by Joe Celko.
I suggest that you will find much of interest in this link: http://www.simple-talk.com/sql/t-sql-programming/celkos-sql-stumper-eggs-in-one-basket/
June 7, 2010 at 4:41 am
I'm not a fan of the "quirky update", so I had a think about this, and dug out some old code that I wrote at work for a very similar...
June 7, 2010 at 4:06 am
Agreed, it's a strange request that I've never come across.
That said, of the solutions posted, Ashish Gilhotra's is the fastest, but does not (for me at least) return the "correct"...
September 15, 2009 at 2:51 am
And if you're using SQLServer2000, then you'll need to use a "TOP n" correlated subquery, since ROW_NUMBER() is not available.. eg:
select RecentVersion.*
from(select distinct ProductId from dbo.ProductVersion) ProductList
inner join dbo.ProductVersion RecentVersion
on...
May 12, 2009 at 2:19 am
Viewing 7 posts - 46 through 53 (of 53 total)