Viewing 14 posts - 61 through 74 (of 74 total)
This solution will work, but will loop the update statement if there are any group of three (or more) teams with the same RANKING. I guess that is a rather...
February 16, 2010 at 5:51 am
Jakke (2/12/2010)
The "Quirky Update" did the trick 🙂
I tested it against about 20000 records and the outcome was satisfying and quite fast as well.
Next, i will put it on...
February 16, 2010 at 1:38 am
Hi John,
It´s allways a good rule of thumb to use TOP 1 together with EXISTS, because it prevents the database engine from doing unneccesary work.
I you write:
select *
from OneTable
where EXISTS...
February 16, 2010 at 1:28 am
John Paul-702936 (2/11/2010)
But .. The Script i am looking for is ..
I want to delete the records from table2 which are in table1 ..mean matching all the columns
So...
February 12, 2010 at 1:44 am
Jakke (2/11/2010)
Thanks for the reply. 🙂
I will certainly test your solution.
You stated that it would work on not to big tables. Is a table with about 550000 records per...
February 12, 2010 at 12:31 am
Hi again,
just thought i should give the cursor solution aswell, since this is the more usual way to solve this kind of problem. It works fine if the table isn´t...
February 11, 2010 at 8:54 am
Dear Jakke,
this is actually a kind of "Running Total" problem, where you want one row to depend on the row before.
Depending on the size of the tables, you can solve...
February 11, 2010 at 7:53 am
Hi,
since @mydate is of type DATETIME you get an implicit conversion of your neatly formatted string back to datetime.
Declare @mydate as a CHAR(14), or what you find suitable, and everything...
February 10, 2010 at 8:38 am
SLLRDK (2/3/2010)
INSERT INTO dbo.Bell_Invoice
VALUES (1,'01/01/2010', '06/01/2010', 500)
INSERT INTO dbo.Bell_Invoice
VALUES (2,'11/23/2010', '06/01/2010', 100)
...
select SUM(price) from dbo.Bell_Invoice
WHEN StartDate <= @EndDate and EndDate >=@StartDate
Which gives me results like:
Price
4750
...
What I need is to be...
February 4, 2010 at 8:17 am
Hi Tom,
I would use a CTE to do the recursion. In your case you want to recurse both up and down in the hierarcy, so you would need two CTE:s...
February 4, 2010 at 7:40 am
Hi,
I'm used to the dateformat YYYY-MM-DD, you can use your dateformat instead to fill the table...
create table #a
(
idint IDENTITY(1,1),
date datetime,
price money
)
insert into #a VALUES ('2010-01-12', 10)
insert into #a VALUES...
February 3, 2010 at 8:46 am
Hi Knockyo,
There is no good way to build dynamic queries the way you suggest. There is no way to dynamicaly change what columns to present in the result. You have...
January 19, 2010 at 3:49 am
If you need to do it by dynamic code you are boulding the parameters for sp_executesql incorrectly.
Short example:
DECLARE @SQLString nvarchar(500);
DECLARE @ParmDefinition nvarchar(500);
DECLARE @CountSQLQuery varchar(30);
SET @SQLString = N'SELECT @result = COUNT(*)...
November 12, 2009 at 7:17 am
There are (of course) several ways to do this. One is to make sure that the lower node-number of the two always get in the first column. Then the grouping...
November 12, 2009 at 5:09 am
Viewing 14 posts - 61 through 74 (of 74 total)