Viewing 15 posts - 1,276 through 1,290 (of 1,957 total)
SQLkiwi (7/18/2011)
CTEs generally don't help - the expression is evaluated twice.I included the TOP trick as the only way I know to force the query processor to evaluate just once.
Here...
July 19, 2011 at 5:17 pm
Forgetting about the table issues, here is a way to convert minutes to hh:mm format:
declare @time numeric(10,2)
set @time = 97.10
select convert(char(5),dateadd(minute,@time,0),8)
Of course, dateadd takes an integer for the increment, so...
July 19, 2011 at 5:03 pm
Is this what you are looking for?
You may need to tweak the EXISTS statement to handle InventoryIDs that have more than 1 digit...
;with data(DrugID, InventoryID)
as
(
select 'MAGN2IVPB','FLR-4N' union all
select 'MAGN2IVPB','FLR-5N' union...
July 18, 2011 at 4:36 pm
My latest submission is based on the string manipulation, but simplified... on my QUAD core PC I like the results, but let's see how it does on yours.
I borrowed the...
July 8, 2011 at 5:36 pm
Bulk logged with select into will make a difference, yes - don't use insert into.
You have to remember though that with that setup, you are going to thrash the disk...
July 7, 2011 at 5:55 pm
Does the target database have pre-allocated storage large enough to store the data?
Are the databases stored on different hardware or the same?
What is the maximum throughput of the storage system?
Have...
July 7, 2011 at 5:31 pm
Where are you transferring the data to? Same database, different database, same server, different server?
What is the table definition?
July 7, 2011 at 5:12 pm
mikes84 (7/6/2011)
July 7, 2011 at 5:10 pm
pbyrum (7/7/2011)
I am looking for is taking the data in the XML file...
July 7, 2011 at 4:54 pm
SQLkiwi (7/7/2011)
mister.magoo (7/7/2011)
July 7, 2011 at 7:35 am
I don't know if anyone has actually answered the question about why the two results are different...
With the PRIMARY KEY defined, the query plan shows a SORT DISTINCT which results...
July 7, 2011 at 6:31 am
tommyh (7/7/2011)
select
SubString(s, 1, 20),
SubString(s, 21, 20),
SubString(s, 41, 20),
SubString(s, 61, 20)
from...
July 7, 2011 at 12:53 am
Is this what you are after?
SELECT AA.AgencyName,AA.AgencyID
FROM (
SELECT CA.AgencyName, CA.AgencyID, COUNT(*) OVER(PARTITION BY CA.AgencyName) AS AgencyIDCount
FROM ContactAction AS CA
GROUP BY CA.AgencyName, CA.AgencyID
) AS AA
WHERE AA.AgencyIDCount>1
ORDER BY AA.AgencyName
July 6, 2011 at 6:39 pm
Viewing 15 posts - 1,276 through 1,290 (of 1,957 total)