Forum Replies Created

Viewing 15 posts - 5,881 through 5,895 (of 6,036 total)

  • RE: Lowest cost in a record

    If Cost1 is null, @ReturnValue becomes null in first statement, and all conditions will not be be true, so no further statements to execute. @ReturnValue will stay NULL till the...

  • RE: Lowest cost in a record

    Remi, if Cost1 is NULL you function will always return NULL.

    IF @Cost2 < @ReturnValue OR @ReturnValue IS NULL

    will fix it.

     

  • RE: Output of a stored procedure to a .csv file??

    SET @cmdString = 'bcp "EXECUTE ' + DB_Name() + '.dbo.YourSP ''' + @Param1Value + ''', ''' + ...  ''', ''' +  @ParamNvalue + '' ' " queryout

  • RE: search between tow dates Problem

    1st.

    DO NOT CONVERT DATETIME TO VARCHAR!

    2nd. If after serious consideration you'll decide you neet to convert to varchar,

    DO NOT CONVERT DATETIME TO VARCHAR!

    3rd. If anyway you must to convert it to...

  • RE: Get Min code where there''''s more than one

    SELECT MIN(NEIGHBORHOOD_CODE)

    FROM (SELECT NEIGHBORHOOD_CODE

                     COUNT(NEIGHBORHOOD_CODE) AS TOTAL_RECORDS, 

              FROM SFCVB_NEIGHBORHOODS

              GROUP BY NEIGHBORHOOD_CODE)

    WHERE TOTAL_RECORDS > 1

  • RE: Finding MetaData of table using anything other than sp_help

    Query system tables.

  • RE: How to find all dates in a range

    Select t2.Date from Table2 t2

       inner join Table1 t1 on t2.date between t1.DateFrom and t1.DateTo

    GROUP BY t2.Date

    ORDER BY t2.Date DESC

     

  • RE: Another VARCHAR Size limitation Problem :(

    What do you mean "precise"?

    There is no such thing in math. There is only number of precise figures.

    Float has 53 precise figures, decimal precision depends on it's value. 25 as...

  • RE: Index Creation Guidelines

    No, it does not.

    But in composite index it's better to have strongest restriction first.

    In your case index (address_id, address_type) will be used much more likely then (address_type, address_id).

    Of course, it...

  • RE: Another VARCHAR Size limitation Problem :(

    What you are trying to store in DECIMAL(38,6) what cannot be stored in FLOAT?

    Precision of FLOAT is 53 digits and size 8 bytes.

    If you nees fixed comma you can covert...

  • RE: Query Dates

    And better create index on this computed column. Clustered, if possible.

    Clustered index is the best option for selecting range of data.

  • RE: NULLS

    > If we do not know his middlename then he does not have one.

    If we do not know his middlename then it DOES NOT MEAN he does not have...

  • RE: Old style Join conversion

    Originally t1.Data was expected NULL in some returned rows.

    But in the last query t1.Data cannot be NULL, t2.Data takes its place.

    This changes direction of the join.

  • RE: Old style Join conversion

    Author just did not follow his own logic.

    On the first page he wrote:

    I expect to see the following when I filter the data such that T2.Data=2 and T1.Data=5

    T2.Data,T2.ID,T1.Data

    2,1,5

    2,2,5

    2,3,NULL

    And on this...

  • RE: Merge rows, how?

    How many topics about this matter we must have?

Viewing 15 posts - 5,881 through 5,895 (of 6,036 total)