Viewing 15 posts - 4,006 through 4,020 (of 8,731 total)
A fact table with 100 million rows is not that large comparing it to the tables I had in my previous company. However, good indexing is important. We can't give...
October 20, 2015 at 6:58 am
Another good reference to understand the code is the article on Table Value Constructors
And here's an example on using APPLY and Table Value Constructors for unpivoting: http://www.sqlservercentral.com/articles/CROSS+APPLY+VALUES+UNPIVOT/91234/
EDIT: I believe that...
October 20, 2015 at 6:42 am
Luis Cazares (10/19/2015)
I'm not making any more shots in the dark if you're not willing to show some effort.
October 19, 2015 at 2:30 pm
ITU_dk2012 (10/19/2015)
October 19, 2015 at 1:05 pm
ITU_dk2012 (10/19/2015)
October 19, 2015 at 11:39 am
Could it be that EF is using 2 different connections? One for the WAITFOR and one for the other code.
Or is it inside a stored procedure that's being called from...
October 19, 2015 at 11:23 am
I'm not sure DISTINCT is the option for this. Since you're using SQL 2012, the LAG function will be of great use.
Here's an example:
DECLARE @Route varchar(8000) = 'ABC-BCD-BCD-DEF'
SELECT STUFF((SELECT ISNULL(...
October 19, 2015 at 9:09 am
This can be done without temp tables as there's a single row returned.
Unless I'm missing something, here's my suggestion.
--Dynamic Pivot
DECLARE @sql NVARCHAR(MAX);
/*
STUFF is used to change...
October 19, 2015 at 8:49 am
djj (10/19/2015)
ericvanburen (10/17/2015)
October 19, 2015 at 8:19 am
You're not exactly following the example by Alan, although, I'm not sure if it's entirely correct.
Here's an option to do it.
CREATE TABLE test_2(
CustomerID int,
...
October 18, 2015 at 9:17 pm
SQLPain (10/16/2015)
Wow Luis, that's a masterpiece. !!!!
Thank you, but it's not really a masterpiece. It's a common technique called crosstabs. You can read more about it in here:
October 16, 2015 at 12:38 pm
You might need something like this:
WITH Set1 AS(
SELECT COUNT (DISTINCT CASE WHEN Collector = '3' THEN LoanID END) DT,
...
October 16, 2015 at 12:20 pm
SQLPain (10/16/2015)
October 16, 2015 at 11:58 am
I altered the test from Chris and run it on my laptop with the following results.
DECLARE @StringToFind CHAR(8), @Dummy CHAR(36)
SELECT TOP 1
@StringToFind = LEFT(CharValue,8)
FROM #TestData ORDER BY NEWID()
CHECKPOINT
DBCC...
October 16, 2015 at 11:55 am
Both queries aren't equivalent. The first is a single value and the second one will show one value per LoanID. In both queries, there's no reason to use a subquery.
And...
October 16, 2015 at 11:38 am
Viewing 15 posts - 4,006 through 4,020 (of 8,731 total)