Viewing 15 posts - 46 through 60 (of 2,893 total)
--Requirement : If i pass 0 then it has to get the rows corresonding to (IsSalaryApproved = 0) else it has to bring all the records.
You can do:
select * ...
January 14, 2015 at 10:15 am
Stephanie Giovannini (1/14/2015)
Even if it's readable, I wouldn't suggest using Stephanie's code. It reads the table 7 times which can become a nightmare on large tables.
Agreed. The other two candidate...
January 14, 2015 at 8:56 am
Why would you want it in function? Whatever reason, it would be highly unrecommened.
However you can use dummy loop:
declare @dtStart datetime=getutcdate()
...
January 14, 2015 at 7:56 am
"CASE WHEN"-less query also possible for ColC of string type:
SELECT [ID]
, ColC
, LEN(ColC)-LEN(ColC)+ROW_NUMBER() OVER(PARTITION BY NULLIF(ISNULL(colC,''), colC) ORDER BY [ID])
FROM #test1
ORDER BY...
January 14, 2015 at 7:42 am
With a given data type of your ColC column, you can do the same without any CASE WHEN:
SELECT [ID]
, ColC
, ColC-ColC+ROW_NUMBER() OVER(...
January 14, 2015 at 7:26 am
I think this list is missing one extremely important "Best Practices" point:
#7 Never connect to SQL SERVER by any means and never try to run any query against it as...
January 14, 2015 at 6:45 am
You should be able to modify the following as per your requirements:
declare @p xml = '<root>
<DOCTOR.SSN>
<OldValue />
<NewValue>111111111</NewValue>
<DisplayName>Social Security Number</DisplayName>
</DOCTOR.SSN>
<DOCTOR.EMAILADDRESS>
<OldValue>abc.com</OldValue>
<NewValue>Julietest@yahoo.com</NewValue>
<DisplayName>Email Address</DisplayName>
</DOCTOR.EMAILADDRESS>
...
January 13, 2015 at 7:27 am
What kind of output do you want?
Your output example doesn't represent recordset...
January 13, 2015 at 7:06 am
Try this first:
http://www.sqlservercentral.com/articles/Best+Practices/61537/
or wait for someone who will do it for you...
January 13, 2015 at 4:38 am
You can generate number on fly without using identity:
SELECT CONVERT(VARCHAR(6), GETDATE(), 12) + 'GP' +
RIGHT('00000' + CAST(ROW_NUMBER() OVER (ORDER BY (SELECT...
January 13, 2015 at 4:35 am
sclayton 889 (1/12/2015)
I will try this. Seems more understandable the multiple case statement one of my colleagues suggested.
The conditions are not really too complicated here and I would recommend...
January 12, 2015 at 10:25 am
1. to ignore(not delete) records that have an enterDate equal to either a conversiondate of '2010-01-01' OR a termDate of '2001-01-01'; If they do, use the processDate to select instead...
January 12, 2015 at 9:35 am
Adam Bean (12/11/2014)
We're now starting to dissect performance between SELECT...
December 11, 2014 at 10:20 am
I would recommend this for reading:
http://www.brentozar.com/archive/2013/09/index-maintenance-sql-server-rebuild-reorganize/
December 11, 2014 at 9:28 am
Viewing 15 posts - 46 through 60 (of 2,893 total)