Viewing 15 posts - 856 through 870 (of 1,229 total)
Jeff, please please please write a book, without changing your style. Give us all an opportunity to repay you for what you've done for us.
May 3, 2011 at 8:06 am
Here's another version using APPLY without any sneaky tricks.
DROP table #orders
create table #orders(
oid int,
itemid int
)
insert into #orders (oid, itemid)
values (1,1111)
insert into #orders (oid, itemid)
values (1,2222)
insert into #orders (oid, itemid)
values (1,3333)
insert...
May 3, 2011 at 7:59 am
IF / ELSE is conditional processing of statements, so CASE would better match your requirements.
You will need to provide a more complete explanation of conditions and outcomes for a...
May 2, 2011 at 3:35 pm
virgilrucsandescu (5/2/2011)
Thank you, tt works just perfect!Excuse my ignorance, but what's a "Quirky Update" ?
Hi Virgil
This link[/url] will show you an alternative set-based method of calculating running totals and introduce...
May 2, 2011 at 9:32 am
Koen Verbeeck (5/1/2011)
ChrisM@home (4/30/2011)
LutzM (4/30/2011)
May 2, 2011 at 1:57 am
virgilrucsandescu (5/1/2011)
Performance is not an issue in this case, I am just curious if just a set based solution is possible for this
This is probably the simplest set-based solution. It's...
May 2, 2011 at 1:51 am
ColdCoffee (5/1/2011)
Got it; Now, as Dixie says, either Quirky Update or Cursor can save you. I am still pondering if it will be possible by a Recursive-CTE..Got to think..
A recursive...
May 2, 2011 at 1:26 am
Here's a solution right now. Never use code from a website without checking it first and fully understanding how it works - this article [/url]will explain the method used in...
May 1, 2011 at 12:37 pm
Dave Ballantyne (4/30/2011)
Yes indeed. Then Monday is a bank holiday. Nice long weekend for them
Combined with the Easter Holiday last weekend as well, April is not going to be...
April 30, 2011 at 11:12 am
LutzM (4/30/2011)
April 30, 2011 at 11:10 am
OP appears to have lost interest :ermm:
There's a solution to this without using TOP or any aggregate functions: variable assignment.
This query
DECLARE @curr tinyint, @ddate smalldatetime, @rate decimal(15, 4)
SELECT @curr =...
April 30, 2011 at 2:43 am
In addition to the questions which Craig has asked, can you confirm which version of SQL Server you are using? This is the SQL Server 7, 2000 section.
Cheers.
April 28, 2011 at 1:59 pm
richard-674310 (4/28/2011)
... Is there some standard approach I am missing?
This has been discussed on the forum before, I'll try to find the thread.
April 28, 2011 at 3:37 am
If you have a sequential integer PK, then this is fast.
SELECT *
FROM TransactionDetail
WHERE TransactionDetailID = (SELECT ABS(CHECKSUM(NEWID()))%100000+1)
Replace 1000000 with the max ID in your table.
April 28, 2011 at 3:31 am
kuppurajm (4/27/2011)
Hi,How can I round the number and remove decimal palces in sql server in simple way?
EX:134.678
I need result like this 135
What result do you expect from 134.478?
April 28, 2011 at 12:04 am
Viewing 15 posts - 856 through 870 (of 1,229 total)