Viewing 15 posts - 211 through 225 (of 761 total)
dwain.c (8/6/2012)
SomewhereSomehow (8/3/2012)
August 6, 2012 at 10:21 pm
Using Pivot/unpivot could be more than just a matter of choice. You can definitely avoid the Pivot with Case+Group but then you come across situations where you can't use Case+Group....
August 4, 2012 at 4:13 am
How about this Cadavre???.....
Declare @num bigint
Set @num = 12345678
Select @num As Number, Stuff((select Left(Right(Cast(@num As Varchar(10)), n), 1) From Tally
Where n <= Len(Cast(@num As Varchar(10))) For XML Path('')), 1,...
August 4, 2012 at 3:11 am
GilaMonster (7/30/2012)
vinu512 (7/30/2012)
GilaMonster (7/30/2012)
ROW_NUMBER() OVER (ORDER BY...
July 30, 2012 at 5:33 am
GilaMonster (7/30/2012)
ROW_NUMBER() OVER (ORDER BY (SELECT 1))...
July 30, 2012 at 4:59 am
danielfountain (7/30/2012)
July 30, 2012 at 3:58 am
Jeff Moden (7/25/2012)
vinu512 (7/25/2012)
I think this is the simplest way.
Look at the execution plan for that, Vinu. There are 9 rows in one table and 4 in the other....
July 25, 2012 at 10:23 pm
Michael Tocik (7/25/2012)
Hi,Thank you Vinu ! That is excatly what I was looking for:-)
You're Welcome Micheal.
I'm glad it worked for you. 🙂
July 25, 2012 at 2:52 am
This should work for you:
Select b.* From #Version As a JOIN #TransactionDetail As b ON a.VersionName = b.VersionID And IsActive = 1
Where (PARSENAME(b.PERIOD, 1) >= PARSENAME(a.StartMonth, 1) )
And (PARSENAME(b.PERIOD, 1)...
July 24, 2012 at 5:01 am
So...how if every restore will cause this problem then how can this be handled....like is there a hint or something which can be specified with the restore statement to avoid...
July 20, 2012 at 5:42 am
There...that would do it...Clayman beat me to it again. 🙂
July 20, 2012 at 5:24 am
You need to Group the data. You need to change the Dynamic Pivot Query as follows:
DECLARE @info-2 nvarchar(max)
DECLARE @sql nvarchar(max)
--Added Variable
DECLARE @Info1 nvarchar(max)
select @info-2 = STUFF(
( select ','+TempSymbol from #TempSymbolList...
July 20, 2012 at 4:53 am
Stuff is good. 🙂
This is just another alternative:
Declare @string varchar(10) = 'B9876543'
Select (LEFT(@string, 3) + '.' + RIGHT(@string, (Len(@String) - 3)))
July 19, 2012 at 6:17 am
You can avoid the CTE and use a Derived table as well as follows:
Select branch, Sum(Case When rn <= 1 Then 1 Else 0 End) As Count From
(Select *, (Case...
July 19, 2012 at 6:07 am
Viewing 15 posts - 211 through 225 (of 761 total)