Viewing 15 posts - 811 through 825 (of 897 total)
You cannot use an IDENTITY column for this. You will have to use a Computed Column.
DECLARE @tblTable TABLE
(
Col1 TINYINT IDENTITY(1,1) NOT NULL,
Col2...
March 27, 2010 at 2:43 am
It would help if you can give us some sample data and the table structure. It would be difficult to help you with the given information.
From whatever i understood, I...
March 27, 2010 at 1:04 am
Thats what i was looking for. But sadly i don't have SQL Server 2008. I can use your other methods till then. Thanks once again Paul.
March 26, 2010 at 4:02 am
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...
March 26, 2010 at 3:07 am
Thanks Quatrei, that worked. Good work around to solve the problem.
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...
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...
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?
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(...
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(...
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.
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.
March 25, 2010 at 4:58 am
Try this as your Where Clause
WHERE 1 = CASE
WHEN @CompanyLetter = 'ALL'
THEN 1
...
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.
March 23, 2010 at 12:43 pm
Viewing 15 posts - 811 through 825 (of 897 total)