Code-first vs database-first, any new developments?

  • Steve Jones - SSC Editor - Friday, September 29, 2017 9:47 AM

    To be fair, plenty of people use tools (ErWin, Er/Studio, Visio, SSMS, etc.) to design:

    create table customer
    ( CustomerId int
    , Customername  varchar(1000)
    , Address varchar(1000)
    , City varchar(1000)
    , State varchar(1000)
    , Country varchar(1000)
    , NonUSProvince varchar(1000)
    , PrimaryContact varchar(1000)
    , PrimaryContactEmail varchar(1000)
    , SecondaryContact varchar(1000)
    ...
    )

    It's not the tools, it's not the framework, it's not the job description. It's the knowledge.

    What kind of fool would design this? We should clearly use varchar(max) to avoid truncation. :hehe:

    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
  • Luis Cazares - Friday, September 29, 2017 11:18 AM

    Steve Jones - SSC Editor - Friday, September 29, 2017 9:47 AM

    To be fair, plenty of people use tools (ErWin, Er/Studio, Visio, SSMS, etc.) to design:

    create table customer
    ( CustomerId int
    , Customername  varchar(1000)
    , Address varchar(1000)
    , City varchar(1000)
    , State varchar(1000)
    , Country varchar(1000)
    , NonUSProvince varchar(1000)
    , PrimaryContact varchar(1000)
    , PrimaryContactEmail varchar(1000)
    , SecondaryContact varchar(1000)
    ...
    )

    It's not the tools, it's not the framework, it's not the job description. It's the knowledge.

    What kind of fool would design this? We should clearly use varchar(max) to avoid truncation. :hehe:

    Wouldn't it be varchar(255) instead?!? I still see a lot of that believe it or not, usually when the developer is in his 60s or older. 😀

    Best,
    Kevin G. Boles
    SQL Server Consultant
    SQL MVP 2007-2012
    TheSQLGuru on googles mail service

  • I've seen both. Max, a "magic" number, and 255 from some frameworks.

  • TheSQLGuru - Friday, September 29, 2017 12:57 PM

    Luis Cazares - Friday, September 29, 2017 11:18 AM

    Steve Jones - SSC Editor - Friday, September 29, 2017 9:47 AM

    To be fair, plenty of people use tools (ErWin, Er/Studio, Visio, SSMS, etc.) to design:

    create table customer
    ( CustomerId int
    , Customername  varchar(1000)
    , Address varchar(1000)
    , City varchar(1000)
    , State varchar(1000)
    , Country varchar(1000)
    , NonUSProvince varchar(1000)
    , PrimaryContact varchar(1000)
    , PrimaryContactEmail varchar(1000)
    , SecondaryContact varchar(1000)
    ...
    )

    It's not the tools, it's not the framework, it's not the job description. It's the knowledge.

    What kind of fool would design this? We should clearly use varchar(max) to avoid truncation. :hehe:

    Wouldn't it be varchar(255) instead?!? I still see a lot of that believe it or not, usually when the developer is in his 60s or older. 😀

    I saw one example where EF had created everything with NVARCHAR(MAX)...

  • Steve Jones - SSC Editor - Friday, September 29, 2017 9:47 AM

    To be fair, plenty of people use tools (ErWin, Er/Studio, Visio, SSMS, etc.) to design:

    create table customer
    ( CustomerId int
    , Customername  varchar(1000)
    , Address varchar(1000)
    , City varchar(1000)
    , State varchar(1000)
    , Country varchar(1000)
    , NonUSProvince varchar(1000)
    , PrimaryContact varchar(1000)
    , PrimaryContactEmail varchar(1000)
    , SecondaryContact varchar(1000)
    ...
    )

    It's not the tools, it's not the framework, it's not the job description. It's the knowledge.

    + 1 Billion to that!

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

Viewing 5 posts - 31 through 36 (of 36 total)

You must be logged in to reply to this topic. Login to reply