Viewing 15 posts - 811 through 825 (of 895 total)
I had actually googled some information about the error but i was of the impression that the number -0.6401 was of type DECIMAL(5,4). I didn't know SQL Server was considering...
How to post data/code on a forum to get the best help - Jeff Moden
http://www.sqlservercentral.com/articles/Best+Practices/61537/
March 26, 2010 at 3:07 am
Thanks Quatrei, that worked. Good work around to solve the problem.
How to post data/code on a forum to get the best help - Jeff Moden
http://www.sqlservercentral.com/articles/Best+Practices/61537/
March 26, 2010 at 1:26 am
The Dixie Flatline (3/25/2010)
No, no, Wayne.... that's just what they'll be expecting him to try!!I might have said the following because it's more performant than a RIGHT() function.
REVERSE(LEFT(REVERSE(LTRIM(RTRIM(colname)),10))
Poor guy would...
How to post data/code on a forum to get the best help - Jeff Moden
http://www.sqlservercentral.com/articles/Best+Practices/61537/
March 25, 2010 at 10:54 pm
Bhuvnesh (3/25/2010)
after seeing Execution plan, i should say CTE query working better the PIVOT one.
Yes. And it is also faster than the Cross Tab. But as i said it may...
How to post data/code on a forum to get the best help - Jeff Moden
http://www.sqlservercentral.com/articles/Best+Practices/61537/
March 25, 2010 at 6:38 am
No idea what's wrong then. It does give the desired result in my system.:unsure: Are you sure you are using DENSE_RANK and not ROW_NUMBER?
How to post data/code on a forum to get the best help - Jeff Moden
http://www.sqlservercentral.com/articles/Best+Practices/61537/
March 25, 2010 at 6:24 am
Oh, I didn't see that.
SELECTP.pkTransactionID, [TOT],
ISNULL( [TOT], 0 ) + ISNULL( [GBX], 0 ) + ISNULL( [IEX], 0 ) + ISNULL( [UNK], 0 ) UniqueEnvS,
[GBX], [IEX], [UNK], MAX(DateTimeReceived) DateTimeReceived
FROM(
SELECTpkTransactionID, LEFT(...
How to post data/code on a forum to get the best help - Jeff Moden
http://www.sqlservercentral.com/articles/Best+Practices/61537/
March 25, 2010 at 5:51 am
SELECTpkTransactionID, [TOT],
ISNULL( [TOT], 0 ) + ISNULL( [GBX], 0 ) + ISNULL( [IEX], 0 ) + ISNULL( [UNK], 0 ) UniqueEnvS,
[GBX], [IEX], [UNK]
FROM(
SELECTpkTransactionID, LEFT( ComponentText, 3 ) ColName,
CONVERT( INT, REPLACE(...
How to post data/code on a forum to get the best help - Jeff Moden
http://www.sqlservercentral.com/articles/Best+Practices/61537/
March 25, 2010 at 5:27 am
This will do it for you..
SELECT*, DENSE_RANK() OVER ( PARTITION BY PatID ORDER BY DisID ) myCol
FROMmyTable
Please make sure you post in the appropriate forums to get faster response.
How to post data/code on a forum to get the best help - Jeff Moden
http://www.sqlservercentral.com/articles/Best+Practices/61537/
March 25, 2010 at 5:13 am
You can use a PIVOT or a Cross-Tab. But only testing will tell which is the better option amongst all.
How to post data/code on a forum to get the best help - Jeff Moden
http://www.sqlservercentral.com/articles/Best+Practices/61537/
March 25, 2010 at 4:58 am
Try this as your Where Clause
WHERE 1 = CASE
WHEN @CompanyLetter = 'ALL'
THEN 1
...
How to post data/code on a forum to get the best help - Jeff Moden
http://www.sqlservercentral.com/articles/Best+Practices/61537/
March 25, 2010 at 3:59 am
You can write your own User Defined Functions for the same. Take four parameters and return the maximum and minimum among them.
How to post data/code on a forum to get the best help - Jeff Moden
http://www.sqlservercentral.com/articles/Best+Practices/61537/
March 23, 2010 at 12:43 pm
You are right:-)
How to post data/code on a forum to get the best help - Jeff Moden
http://www.sqlservercentral.com/articles/Best+Practices/61537/
March 23, 2010 at 6:52 am
; WITH cteTableName AS
(
SELECTROW_NUMBER() OVER( PARTITION BY Man_name ORDER BY Model ) RowNum, *
FROMTableName
)
SELECTCASE WHEN RowNum > 1 THEN '' ELSE Man_name END Man_name, Model
FROMcteTableName
This should do it for you..
How to post data/code on a forum to get the best help - Jeff Moden
http://www.sqlservercentral.com/articles/Best+Practices/61537/
March 23, 2010 at 6:17 am
Why such a strange requirement? What is the problem if the trigger gets called 10 times? But still if you want the trigger to be called only once try converting...
How to post data/code on a forum to get the best help - Jeff Moden
http://www.sqlservercentral.com/articles/Best+Practices/61537/
March 23, 2010 at 4:47 am
SELECTE.*
FROMTRANSACTION T
INNER JOIN EMPLOYEE E ON T.RegisteredBYEmpID = E.EmpID
WHERET.RegisteredBYEmpID = T.ApprovedByEmpID
I hope this will give you the desired result. It would have been better if you had provided some sample...
How to post data/code on a forum to get the best help - Jeff Moden
http://www.sqlservercentral.com/articles/Best+Practices/61537/
March 23, 2010 at 2:53 am
Viewing 15 posts - 811 through 825 (of 895 total)