Viewing 15 posts - 751 through 765 (of 902 total)
You are doing a Cross join so what will happen is that you will get T1 rowcount * t2 Count
Eg if you had 2 rows in T1 and 4...
September 17, 2012 at 12:43 am
:-D.
looking at the supplied image it implied you also needed to calculate the root node value as well. 😉
I do like the code especially the nested Table function call,...
September 14, 2012 at 4:40 am
Sol, Just looking at your solution It works well except that it doesnt return the Root node value, so I would suggest a Left Outer join on the Insert into...
September 14, 2012 at 1:50 am
hi sol,
You can put the data into an alternate temp table or table variable to do the calcs, but thought it was a bit messy so revisited it before submitting...
September 14, 2012 at 1:38 am
As Dwain.c mentions DDL and sample data would help a lot, however this may be what you are looking for as you need to select based on the PatienId AND...
September 14, 2012 at 1:19 am
A better way to write that query is
Select
Col1
,Col2
From
@tab1 t1
INNER JOIN (Select Col2,Min(Col3) Col3
FROM @tab1
group by Col2) sc1
on t1.Col2=sc1.Col2
...
September 14, 2012 at 1:07 am
aaron.reese (9/13/2012)
I prefer the PK to be called ID.
TABLE.ID refers to this tables PK
TABLE.SOMETABLE_ID refers to the related tables PK and infers a single field...
September 13, 2012 at 9:13 am
This seems like a piece of course work or a test thats been set internally by a senior.
However this code will work for any number of levels required though technically...
September 12, 2012 at 8:28 am
Jeff Moden (9/3/2012)
rka (9/2/2012)
DateKey has to be in the format YYYYMMDD
In SQL Server, that's a pretty insane requirement because that would make a character based date. Since you're using...
September 4, 2012 at 9:35 am
this might not be the best section of SSC as its tends to be mainly for Tsql, however you might get a better/faster response on theis part of the SSC...
August 31, 2012 at 6:22 am
I didnt fully understand the requirements. VSDBCMD wont help in that case, but its a useful tool to know.
I take it the third party tool thats doing the...
August 31, 2012 at 4:32 am
Which tool are you using to generate the script?
Why cant you use a command line SQLCMD to run this into the target server?
One other option is that...
August 31, 2012 at 2:00 am
Have you tried turning the problem around and doing a select of the Dataset & RowNumbers that are missing between the Staging and source tables
As this should then produce the...
August 15, 2012 at 8:30 am
Sergiy,
I ran the test with a little modification
DECLARE @Z int
DECLARE @StartTime datetime
SET @Z = 1
SET @StartTime = GETDATE();
SELECT @Z = ((@Z * 2) + 1)%50000
FROM #Tally AS X
Cross JOIN...
August 15, 2012 at 4:55 am
Viewing 15 posts - 751 through 765 (of 902 total)