Forum Replies Created

Viewing 15 posts - 811 through 825 (of 897 total)

  • RE: How to use identity?

    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...

  • RE: PIVOT FOR 2 or more Columns

    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...

  • RE: Error while Rounding

    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.

  • RE: Error while Rounding

    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...

  • RE: Error while Rounding

    Thanks Quatrei, that worked. Good work around to solve the problem.

  • RE: How to get last 10 characters in all rows of a single(same) column?

    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...

  • RE: Can this CTE based query be written more efficiently?

    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...

  • RE: Query help

    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?

  • RE: Can this CTE based query be written more efficiently?

    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(...

  • RE: Can this CTE based query be written more efficiently?

    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(...

  • RE: Query help

    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.

  • RE: Can this CTE based query be written more efficiently?

    You can use a PIVOT or a Cross-Tab. But only testing will tell which is the better option amongst all.

  • RE: T-SQL CASE Problem

    Try this as your Where Clause

    WHERE 1 = CASE

    WHEN @CompanyLetter = 'ALL'

    THEN 1

    ...

  • RE: need help in writing query

    You can write your own User Defined Functions for the same. Take four parameters and return the maximum and minimum among them.

  • RE: Replace

    You are right:-)

Viewing 15 posts - 811 through 825 (of 897 total)