Viewing 15 posts - 166 through 180 (of 902 total)
One alternative to the unpivot is to use the Cross apply method.
DECLARE @t table (Col1 char(25), col2 char(25),col3 char(25))
INSERT INTO @t (col1, col2, col3) VALUES
('AB' , 'BC' ,'DA')
SELECT
Cav.Value
,CASE Value
WHEN...
_________________________________________________________________________
SSC Guide to Posting and Best Practices
November 14, 2014 at 1:13 am
@Pietlinden, It just shows there are multiple ways of accomplishing the same task, and to be pragmatic, as in some circumstances one solution may perform slightly better than the other....
_________________________________________________________________________
SSC Guide to Posting and Best Practices
November 12, 2014 at 4:22 am
I thought with the additional filter on the correlated sub query it would act as an exclusive filter, for that one row, but I'm happy to be wrong.
_________________________________________________________________________
SSC Guide to Posting and Best Practices
November 11, 2014 at 9:46 am
pietlinden (11/11/2014)
select top 1000 lead_id, activity_type_code, activity_date,
row_number() over(partition by lead_id order by activity_date desc) rownum
from [PartitionExample] pe
WHERE EXISTS (SELECT 1 FROM PartitionExample WHERE activity_type_code =...
_________________________________________________________________________
SSC Guide to Posting and Best Practices
November 11, 2014 at 9:24 am
Right, First question to consider is what is unique about all set that has the row with a value of 'M'
This should work
SELECT
*
FROM PartitionExample OuterPartition
JOIN
(SELECT Lead_ID
FROM PartitionExample InnerPartition
WHERE...
_________________________________________________________________________
SSC Guide to Posting and Best Practices
November 11, 2014 at 9:23 am
SQL DBA-909494 (11/7/2014)
I am looking for the script as there is a security concern of running any tool except TSQL script. Could you please help me getting it.
as I've said...
_________________________________________________________________________
SSC Guide to Posting and Best Practices
November 7, 2014 at 6:00 am
Cadavre (11/7/2014)
I'm not affiliated with RedGate. Have you thought of using SQL Compare[/url]?It's pretty quick and will show you in a very simple UI any differences between the schema.
Unfortunately...
_________________________________________________________________________
SSC Guide to Posting and Best Practices
November 7, 2014 at 2:33 am
Personally I don't see the issue with allowing scripting tools to access a production server, especially if its for validation purposes.
Assuming the database isn't huge why not just back...
_________________________________________________________________________
SSC Guide to Posting and Best Practices
November 7, 2014 at 1:16 am
You might find this article quite interesting as well,http://www.sqlservercentral.com/articles/T-SQL/63681/ as it also shows the performance of the PIVOT and the more traditional Cross Tab method, especially over larger data sets.
_________________________________________________________________________
SSC Guide to Posting and Best Practices
November 6, 2014 at 1:51 am
The Out of Memory Exception is likely to be Client side and the Temporary FILE that SSMS uses hitting the max limits, especially with all the results being returned.
I wouldn't...
_________________________________________________________________________
SSC Guide to Posting and Best Practices
October 31, 2014 at 4:10 am
One minor issue with your code you don't seem to be incrementing the @I counter so it will run indefincately (possibly a cut/paste error)
The problem you will have is that...
_________________________________________________________________________
SSC Guide to Posting and Best Practices
October 31, 2014 at 2:44 am
Very Odd, did you recreate the connection?
The only other thing could be that it was using the wrong driver, Or the connection file had become corrupt.
Knowing SSIS and...
_________________________________________________________________________
SSC Guide to Posting and Best Practices
October 3, 2014 at 4:12 am
Sorry I think I misunderstood, are you running it through an SQL Agent job or in the development Environment?
_________________________________________________________________________
SSC Guide to Posting and Best Practices
October 3, 2014 at 3:25 am
These are always difficult (frustrating and fun at the same time) to find and diagnose, and could be any number of issues, but these tend to be the main ones...
_________________________________________________________________________
SSC Guide to Posting and Best Practices
October 3, 2014 at 2:55 am
lduvall (10/2/2014)
_________________________________________________________________________
SSC Guide to Posting and Best Practices
October 2, 2014 at 9:41 am
Viewing 15 posts - 166 through 180 (of 902 total)