Viewing 15 posts - 121 through 135 (of 443 total)
Try this one
;WITH mas as(
select Max(mas.Time) as [Time]
from RealtimeData mas
GROUP BY convert(nvarchar,mas.Time,103)
)
select * from mas
CROSS APPLY
(
SELECT Value from RealtimeData sub
where sub.Time = mas.Time
) as sub
This question was not originally...
April 29, 2010 at 11:24 pm
You changed rather more than that!
"Forgot" must remember that one. Funny.
Not much. Basically, concept was of tally table. I implemented with the memory table, which was supposed to...
April 29, 2010 at 11:03 pm
For 2000 rows a day? 1 row every 43 seconds?????
How's that ever gonna slow down a server and require an elaborate solution.
You are right. But it is always to have...
April 29, 2010 at 10:48 pm
if you are going for mirroring, this article might help you;
April 29, 2010 at 10:33 pm
Solution according to me is...
;With wcte as (
Select vTime,vValue,Row_Number() over (partition by Convert(DateTime,Convert(varchar(10),vTime,110)) order by vTime Desc) rno
from @vTable
)Select vTime,vValue from wcte where rno = 1
April 29, 2010 at 10:24 pm
The question was;
I need to write a SQL-Server query but I don't know how to solve. I have a table RealtimeData with data:
Time ...
April 29, 2010 at 10:13 pm
In SSMS, expand table B and go to keys. Right-Click FK and select modify. Under Table Designer, expand INSERT And UPDATE Specific, Unde Delete Rule Select Cascade. Then Save. Repeat...
April 29, 2010 at 10:10 pm
While defining relationships, there is an option of "Delete Rule". You can set from there.
Considering Table A as Parent and Table B and Table C are chile tables with Foreign...
April 29, 2010 at 7:01 am
Why not to use cascade?
By using Cascade, If you delete from Table A, Record(s) from Table B and Table C will bve automatically deleted.
April 29, 2010 at 5:35 am
No question, No answer. I think that was OP's first post.
April 29, 2010 at 5:31 am
How are you recording the data on which you will generate the invoice. For example, an inventory invoice will definitely be based upon the Order and Order detail table. What...
April 29, 2010 at 5:19 am
It is better to go for Mirroring if you intend for the the same database structure to be used as of OLTP database.
I would suggest that if you are thinking...
April 29, 2010 at 5:12 am
You can also use Triggers for parallel insertion but it can slow down the Insert / update process. Using Service Broker can be helpful in this regard. Just initialize Service...
April 29, 2010 at 3:27 am
My suggestion is that it will be better to keep the Month End tables in De-Normalized manner.
I assume that you will be producing reports from this data or use...
April 29, 2010 at 3:25 am
Sorry. forgot to replace the table names in the cte.
DECLARE @MissingNumbers TABLE (N INT)
Declare @vMax int
INSERT INTO @MissingNumbers
VALUES (19),(20)
Set @vMax = (Select MAX(N) from @MissingNumbers)
;with wcte as (
Select Top(@vMax) ROW_NUMBER()...
April 29, 2010 at 3:12 am
Viewing 15 posts - 121 through 135 (of 443 total)