Forum Replies Created

Viewing 15 posts - 2,506 through 2,520 (of 6,036 total)

  • RE: change where clause

    smknox (5/17/2009)


    It seems like my simplest option might be to pull lots of records over the network (one sp without a where clause) and then filter out what I want...

  • RE: change where clause

    smknox, you have 2 options here.

    1. Proceed with multiple stored procedures. But you need to make the application to choose which one to call basing on what's selected in the...

  • RE: Eliminating Cursors

    praveenvelumula (5/15/2009)


    Here is the Code .. Please Advise ...

    I guess it would be easier if you'd provide the requirements to this code. Describe what this code actually should...

  • RE: Datepart Function ate egg

    karthikeyan (5/15/2009)


    Hi All,

    I have one scenario.

    declare @mm char(2)

    declare @gdate datetime

    select @gdate = '03/31/2009'

    select @mm = convert(char(2),datepart(month,@gdate))

    select @mm

    It is showing 3. But i need the output as 03.

    I modified the...

  • RE: How do you compare two big tables in same database on the same server?

    CHECKSUM is not good enough.

    Different records may have the same CHECKSUM.

  • RE: DECIMAL,calculation,truncation

    karthikeyan (5/11/2009)


    I'd even bet money on it.

    Just kidding...how much you bet? 😛

    I am not expecting too much.:-P

    When 2 are betting one of them is a fool, another one is a...

  • RE: Selecting from a table where any column is named like 'ServiceNumber%'

    John (5/8/2009)


    Normalization is awesome! But considering this is a 'flattened' out table for a 'reporting' data mart it was deemed necessary for 'denormalize' the information for performance reasons. Thanks for...

  • RE: DECIMAL,calculation,truncation

    karthikeyan (5/7/2009)


    Sorry! I am not getting you...

    Try again.

    Here is a shorter version of your code, easier to get:

    DECLARE @Fixed2 decimal(8,4)

    SET @Fixed2 = 12121.03

  • RE: DECIMAL,calculation,truncation

    jbraunstein (5/7/2009)


    1. Extra zeros to the right of a decimal point are ignored so 100.0 and 10.000 are the same. If the variable is cast as a float or decimal,...

  • RE: Pull data from multiple rows and output it as a string, along with other data, in a view

    That's how the function should look like:

    CREATE FUNCTION AdversePartiesForRequest

    (@RequestID int)

    RETURNS nvarchar(4000)

    AS

    BEGIN

    declare @AdverseParties nvarchar(4000)

    SELECT @AdverseParties = ISNULL(@AdverseParties+ ', ', '') + AdverseParty

    FROM dbo.AdverseParty

    WHERE @RequestID = RequestID

    ORDER BY ??? -- if you...

  • RE: Pull data from multiple rows and output it as a string, along with other data, in a view

    Search this forum for "Concatenation Function".

    Create scalar function to accept RequestID and return all corresponding "AdverseParty" values concatenated in one string.

    Then you may call it like this:

    SELECT R.RequestID. R.Name, dbo.AdversPartForRequest(R.RequestID)...

  • RE: DECIMAL,calculation,truncation

    Always use FLOAT data type for complex calculations.

    DECLARE @Hundred float

    SET @Hundred = 100

    Update #temp

    set gross = (((1.0+(week1/@Hundred))*

    (1.0+(week2/@Hundred))*

    (1.0+(week3/@Hundred)))-1)*@Hundred

  • RE: List all tables for a datasbase with row counts AND owner name

    Just make sure you have updates statistics before you query for RowCnt from sysindexes.

    It does not reflect real number of records all the time.

  • RE: Dynamic database name

    Another way to go would be creating system procedure in master database.

    Then you just call that procedure from any of databases and get results relevant to that particular database.

    Here is...

  • RE: Please help me..

    viswa (4/30/2009)


    But my exact input length of parameter is numeric(18,7)

    and output is numeric(18,7)

    that time your condition will not work so make me exact..

    Then you need to make some effort in...

Viewing 15 posts - 2,506 through 2,520 (of 6,036 total)