Viewing 15 posts - 241 through 255 (of 425 total)
don't take my response as the gospel truth. it's just a guess/possibility. :unsure:
April 3, 2008 at 12:39 pm
I don't think there's a direct equivalent for LEAD()/LAG(). However, you can perform the same type of processing with ROW_NUMBER() and a self-join.
Look at the...
April 3, 2008 at 10:54 am
SQLCMD supports $xxx variables that are somewhat like macros and can exist across batches. With it you can write statements like:
UPDATE $table SET ...
or
SELECT ..., $col, ... FROM ...
Perhaps...
April 3, 2008 at 10:32 am
unfortunately, this alternative requires a temp table since it doesn't seem CTEs can be nested. it works with the #prod_desc table in the original post.
select pid, pdesc,
...
April 3, 2008 at 9:35 am
hi cees,
can you edit your previous post and break 'INSERT INTO mcmain.volcdet (vd_volcnmr, vd_upnmr, vd...' onto multiple lines? that will make your post narrower and easier to read.
multiple columns...
April 3, 2008 at 6:48 am
Jeff Moden (4/2/2008)
Antonio,Your solution doesn't work with the test data I created. Please post your test data generator and the result times you got.
Sorry. The Parameters column became...
April 3, 2008 at 6:14 am
declare @xml XML
-- convert all row data to an XML element
set @xml = (
select cast('<parm ReportKey="'+ cast(ReportKey as varchar(12))
+'" TimeStart="'+ cast(TimeStart as varchar(32))+ '"...
April 2, 2008 at 8:42 pm
Matt Miller (4/2/2008)
April 2, 2008 at 9:32 am
Jeff Moden (4/1/2008)
Ok... here's my entry for the virtual beer...Looking forward to your entry 😉
No fair working at night... my wife won't let me get geeky at night.
April 2, 2008 at 6:18 am
sounds like a challenge to me! winner buys a round of beer for everyone?
April 1, 2008 at 7:15 pm
Jeff Moden (4/1/2008)
Just checking to be sure... do all the rows have exactly the same number of "fields" and all the rows are always in the same basic format?
since that...
April 1, 2008 at 6:47 pm
eliminating some of the nested derivations might help:
with Skipper( item, rowNum)
as
(
SELECT item, ROW_NUMBER() OVER (ORDER BY item)
...
April 1, 2008 at 6:44 pm
performance is slow because your query with row_number() will number ever row regardless of whether or not you retrieve it.
are you looking for random/sample data? if so, you can...
April 1, 2008 at 6:18 pm
Enbee: look at the topic titled "Recursive Queries Using Common..." in SQL Server 2005 Books Online and take better notes in class. 😀
April 1, 2008 at 11:48 am
Btw, BCP's err files (-e) filter all rows for a failed batch, not just the offending row(s). And using too large a batch size can cause issues with the...
April 1, 2008 at 11:32 am
Viewing 15 posts - 241 through 255 (of 425 total)