Viewing 15 posts - 76 through 90 (of 760 total)
GilaMonster (2/27/2013)
Selection has to do with which index can filter the largest number of the...
February 27, 2013 at 1:41 am
dwain.c (2/8/2013)
vinu512 (2/7/2013)
--Creating Table
Create Table Ex1
(
Id Int Identity(1,1),
AllLevels Varchar(MAX)
)
--Inserting...
February 8, 2013 at 10:18 pm
hi Chris, it definitely runs like a Rocket. It would be really nice if you could explain the following code :
SELECT df = LEFT(b.AllLevels, CHARINDEX('»',b.AllLevels,1)-1)
UNION ALL
SELECT df = SUBSTRING(b.AllLevels,N+1,...
February 7, 2013 at 9:31 pm
demonfox (2/7/2013)
Abu Dina (2/7/2013)
February 7, 2013 at 9:12 pm
anthony.green (2/7/2013)
Your sample data doesnt match the output, we need the output to be based on your sample data, so either change the data or change the output to match.
+1
February 7, 2013 at 5:16 am
Please post the result set that is expected from the above data.
February 7, 2013 at 4:57 am
I hope this is what you require from the above data:
Declare @sql As Varchar(MAX)
Select @sql = 'Select paymentID, ' + STUFF((Select Distinct ',SUM(Case When...
February 7, 2013 at 4:35 am
So if the incoming data doesn't have a forename then what do you insert into the table??..Do you Insert NULL??....
I think you should read upon Coalesce.
If you still cant...
February 7, 2013 at 3:52 am
Even Better.......if you create a Non Clustered index On the Tally table then you get the results even fatser.
Create NonClustered Index NCLIX_Tally On Tally(n)
Select Id,
...
February 7, 2013 at 3:44 am
You can switch the Cross Apply in the query with an Outer Apply, that would reduce the time by more than 70%, as follows :
Select Id,
...
February 7, 2013 at 3:30 am
I worked it out. This is the query that would get you the results you want:
--Creating Table
Create Table Ex1
(
Id Int Identity(1,1),
AllLevels Varchar(MAX)
)
--Inserting Sample Data...
February 7, 2013 at 2:59 am
m.rajesh.uk (2/6/2013)
cleans all the tables in a database
What do you mean by cleaning tables??
February 6, 2013 at 11:46 pm
You can't do that using the case.....The case would perform the Update operation. To avoid the Update as a whole you need to wrap the Update statement in an If...Then....
February 6, 2013 at 11:43 pm
All the above methods would get you the required data. This is just an extension to them.
Incase you have more than three attribute Types which may change, then you can...
January 28, 2013 at 1:35 am
I tried the query on random sample data consisting of 1164000 rows.
Dwain, your query is the clear winner. Here are the results for all the three queries :
Dwain's...
January 25, 2013 at 2:17 am
Viewing 15 posts - 76 through 90 (of 760 total)