Forum Replies Created

Viewing 15 posts - 5,476 through 5,490 (of 8,731 total)

  • RE: Assigning multiple rows to a single variable parameter

    That's a lot to process without some sample data. You're doing procedural programming in SQL which is optimized for declarative programming. You seem to have more code than what you...

  • RE: Thanksgiving 2014

    antony-688446 (11/27/2014)


    And I think SQL Server Central has more non-USA subscribers than USA. Asia is quite a big place....

    I'm not sure about that. Forum posts get tend to decrease significantly...

  • RE: Conversion of Date from legacy systems with 7 and 6 digit format to DD/MM/YYYY format

    aaron.reese (11/27/2014)


    All of the suggestions so far with converts and udfs are fine, but I would approach it by building a conversion table

    CREATE TABLE dbo.DateConvert(

    DB2Date AS VARCHAR(10),

    CalendarDate AS DATE

    )

    INSERT INTO...

  • RE: Doubt on Coaleace

    aaron.reese (11/27/2014)


    that is a cool way to concatenate strings, much easier than FORXML and STUFF()

    There are some problems with this method. For example, the order is not guaranteed and you...

  • RE: Thanksgiving 2014

    Koen Verbeeck (11/27/2014)


    kaspencer (11/27/2014)


    When you have an Americo-centric question like this, you should provide an alternative, such as one based on St. Georges Day or similar. (OK, so then you'd...

  • RE: Doubt on Coaleace

    Coalesce returns the first non-null value from a series of values in the same row. These values need to be included as parameters delimited by commas. eg. COALESCE(value1, value2, value3,...

  • RE: Please vote for the "built in Tally Table" function.

    Jeff Moden (11/25/2014)


    Thanks Koen and Eirikur!

    How about it folks? There a 1.7 million of you out there. Can we get a few more votes on this important subject?...

  • RE: Shrinking Database for Dev Environment

    Those articles refer mainly to production dbs which need to be in excellent shape. I'm not recommending it but you might use it to generate light copies for development/testing environments....

  • RE: Please vote for the "built in Tally Table" function.

    Jeff Moden (11/26/2014)


    Jeff Moden (11/26/2014)


    SQLRNNR (11/26/2014)


    I decided to down vote this one. Everybody should just go to Oracle where they already have the functionality. (devil)

    😛

    BWAAAA-HAAAAA-HAAAA!!!! I thought...

  • RE: IF EXISTS vs @@ROWCOUNT

    I really don't like this question because it could create wrong assumptions.

    As Hugo said, option 1 could be faster if there are large possibilities of a fifth row existing....

  • RE: way to generate some random unique sequences

    Jampandu (11/26/2014)


    we are planning to use above series as primary key instead of identity column.

    I didn't read this part. Using this as a primary key won't give you any benefits....

  • RE: way to generate some random unique sequences

    I would keep an identity with seed and increment of 5. Based on that identity column, you could calculate the needed sequence. Note that with this formula, you can only...

  • RE: Conversion of Date from legacy systems with 7 and 6 digit format to DD/MM/YYYY format

    I would still use an arithmetic formula instead of string manipulation.

    CREATE FUNCTION ConvertLegacyIntToDate

    (

    @LegacyDate int

    )

    RETURNS TABLE WITH SCHEMABINDING AS

    RETURN

    SELECT CAST( CAST( 19000000 + oldDate AS CHAR(8)) AS date) as NewDate

    Or I...

  • RE: Foramatting a date column in table creation.

    Date columns should use one of the available date data types (date, datetime, datetime2, etc). Those data types don't care about format. Different formats for input and display can be...

  • RE: Compare Rows in sample Table - T-SQL help

    Here's one possible solution. It creates a way to make a self join with the previous reportrundate for each invoiceno and invoicepart. Feel free to ask any questions that you...

Viewing 15 posts - 5,476 through 5,490 (of 8,731 total)