Viewing 15 posts - 6,886 through 6,900 (of 8,731 total)
I found 2 options that might help. Test them to find out if they work fine with your real data.
--Using CTE and ROW_NUMBER()
WITH CTE AS(
SELECT *, ROW_NUMBER() OVER( PARTITION BY...
February 18, 2014 at 1:45 pm
Steve Jones - SSC Editor (2/18/2014)
Ed Wagner (2/17/2014)
EL Jerry (2/17/2014)
Have you noticed the community has grown over 1.7M members?
Congratulations to Steve et al who founded it, keep...
February 18, 2014 at 1:05 pm
You could also create a view with all the schemas.
I can't imagine why would you have all those schemas.
February 18, 2014 at 11:39 am
In the last test I did, pivot and cross tabs perform the same with a single aggregate. For multiple aggregates, cross tabs will be quite faster.
I still prefer the flexibility...
February 18, 2014 at 9:42 am
The only difference I can find is in the join between SalesOrderDetail and SalesOrderHeader. The problem is that I would believe that the first option is correct and the second...
February 18, 2014 at 9:39 am
Jim P. (2/18/2014)
Markus (2/18/2014)
February 18, 2014 at 9:32 am
Your query is quite complex (or at least long). I have no idea why do you have all those UNION ALL if you're always querying the same tables (maybe you...
February 18, 2014 at 8:55 am
This might work for an iTVF. But I'm not sure is the best option with real data.
Note that it uses the DelimitedSplit8K that you can find here along with the...
February 18, 2014 at 8:30 am
Colonel_Derp (2/17/2014)
Luis Cazares (2/17/2014)
Could you try something like this: http://www.sqlservercentral.com/articles/comma+separated+list/71700/ ?If you post DDL and sample data, we should be able to help you.
DDL? Do you mean direct download link,...
February 17, 2014 at 3:39 pm
This should give you a similar output to what you have now. As Sean said, more information could help us help you.
CREATE FUNCTION [dbo].[FoldersOfFile](@theFileID int)
RETURNS TABLE AS
RETURN
...
February 17, 2014 at 2:32 pm
You can't use a stored procedure like that.
You have several options and you need to choose what's best for you.
To use the SP you can use INSERT INTO:
CREATE TABLE #TempTableForThis(...
February 17, 2014 at 12:56 pm
Could you try something like this: http://www.sqlservercentral.com/articles/comma+separated+list/71700/ ?
If you post DDL and sample data, we should be able to help you.
February 17, 2014 at 10:34 am
Nadrek (2/17/2014)
Luis Cazares (2/17/2014)
Nadrek (2/17/2014)
Luis Cazares (2/17/2014)
February 17, 2014 at 9:42 am
Something like this?
SELECT currency, AVG( xr.xchange_rate)
FROM cur_range cr
JOIN xchange_rate xr ON cr.currency = xr.currency_code
AND xr.xchange_date BETWEEN cr.from_date AND cr.to_date
GROUP BY currency
February 17, 2014 at 9:12 am
Viewing 15 posts - 6,886 through 6,900 (of 8,731 total)