Forum Replies Created

Viewing 15 posts - 1,381 through 1,395 (of 1,419 total)

  • Reply To: Is It Worth Writing Unit Tests?

    [

    The same reason you unit test anything?  It's either the new development or it's something you're modifying.

    New development and modifications should be tested over and over until they work as...

    Aus dem Paradies, das Cantor uns geschaffen, soll uns niemand vertreiben können

  • Reply To: Is It Worth Writing Unit Tests?

    ZZartin wrote:

    Yes I would 100% disagree with that, every object in the database does not interact with every other object in the DB in some exponentially spirally level of complexity. ...

    Aus dem Paradies, das Cantor uns geschaffen, soll uns niemand vertreiben können

  • Reply To: More performant way to write this where clause

    Jonathan AC Roberts wrote:

    Sometimes

    They're distinct.  Is because performance?

    Aus dem Paradies, das Cantor uns geschaffen, soll uns niemand vertreiben können

  • Reply To: Is It Worth Writing Unit Tests?

    Ah, ok. So the reason you may want to keep unit tests is if anything needs to change with your data model, you've already documented how things should work and...

    Aus dem Paradies, das Cantor uns geschaffen, soll uns niemand vertreiben können

  • Reply To: Is It Worth Writing Unit Tests?

    chris geswein wrote:

    In my opinion unit testing in a relational database is basically fruitless.  The whole idea is the data model is schema bound.  So what are you testing but only...

    Aus dem Paradies, das Cantor uns geschaffen, soll uns niemand vertreiben können

  • Reply To: Is It Worth Writing Unit Tests?

    coolman02 wrote:

    David

    the non-SQL parts of our C# app are tested with a few unit tests and a lot of manual tests.

    We plan to reverse the quantity (unit testing first and...

    Aus dem Paradies, das Cantor uns geschaffen, soll uns niemand vertreiben können

  • Reply To: Is It Worth Writing Unit Tests?

    In my opinion unit testing in a relational database is basically fruitless.  The whole idea is the data model is schema bound.  So what are you testing but only to...

    Aus dem Paradies, das Cantor uns geschaffen, soll uns niemand vertreiben können

  • Reply To: More performant way to write this where clause

    It's possible to get rid of "or" in where clause using DeMorgan's Law.  If the goal is readable code tho... sometimes that pretty much goes out the window.

    Some test data:

    Aus dem Paradies, das Cantor uns geschaffen, soll uns niemand vertreiben können

  • Reply To: using variables in for openrowset bulk update

    Last year I had to do something similar with a csv file.  Openrowset can't contain sql expressions, only literal strings.  So dynamic sql is the way to go.  Something like:

  • This reply was modified 7 years ago by Steve Collins. Reason: Pasted incomplete code by accident

Aus dem Paradies, das Cantor uns geschaffen, soll uns niemand vertreiben können

  • Reply To: Generate a string format based on fixed length and numeric units on increment

    Step 1: generate some dummy data

    /* create a table to hold the country and province values  */
    /* as well as a column to store the cntry_prov_code...

    Aus dem Paradies, das Cantor uns geschaffen, soll uns niemand vertreiben können

  • Reply To: SQL Collation different in tables and columns

    Chris Wooding wrote:

    If your database originally resided on a different server (with a different collation), columns created would have used that default. Columns created after the migration would default to the...

    Aus dem Paradies, das Cantor uns geschaffen, soll uns niemand vertreiben können

  • Reply To: Generate a string format based on fixed length and numeric units on increment

    Why do you declare province to be char(2) and then assign it left(col_name, 1) which is only 1 character?

    Does the sequence reset for each country?

    What is the needed sort order...

    Aus dem Paradies, das Cantor uns geschaffen, soll uns niemand vertreiben können

  • Reply To: Generate a string format based on fixed length and numeric units on increment

    Suppose the code you need to calculate is called the "Country Province Number" CPN.  The issue here is the example you provided only declares variables for a single record and...

    Aus dem Paradies, das Cantor uns geschaffen, soll uns niemand vertreiben können

  • Reply To: Generate sequence of stations

    You have 2 tables?

    1. Dates  -- contains the master list of dates.  Table has 1 column.
    2. Stations -- contains the date and # of stations.  Table has 2 columns

    The output...

    Aus dem Paradies, das Cantor uns geschaffen, soll uns niemand vertreiben können

  • Reply To: Insert multiple columns into one column sql

    The "or" we were looking for.  The second example, the one with "coalesce", consolidates the 3 columns (Employed, Not employed, Retired) into 1 column (Employed status) by selecting the first...

    Aus dem Paradies, das Cantor uns geschaffen, soll uns niemand vertreiben können

  • Viewing 15 posts - 1,381 through 1,395 (of 1,419 total)