Forum Replies Created

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

  • RE: way to generate some random unique sequences

    Jampandu,

    Adding 2 letters means that I'll have to do additional testing and I have some urgent work to do. Try understanding the code and the solution should become evident.

    Aaron,

    I've never...

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • 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...

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • 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...

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • 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...

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • 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...

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • 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...

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • 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,...

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • 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?...

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • 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....

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • 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...

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • 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....

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • 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....

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • 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...

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • 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...

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • 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...

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2

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