Forum Replies Created

Viewing 15 posts - 466 through 480 (of 1,413 total)

  • Reply To: Blank space being imported during stored procedure

    The thread is a duplicate.  Regarding just the first 4 lines of the procedure

    Begin
    -- these 2 should always be set in ALL sp's
    -- set nocount on;...

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

  • Reply To: Are the posted questions getting worse?

    It happened to be an article (which I vote yes also to keeping open) but idk it could've been a regular forum post.  Those come up in searches.  A new...

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

  • Reply To: Are the posted questions getting worse?

    Jeff Moden wrote:

    So a lot of folks have written articles where no one has posted to the discussions in well over a year.  If someone reads and article and has a...

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

  • Reply To: Are the posted questions getting worse?

    duplicate

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

  • Reply To: Help SP Logic and performance

    After following Ken and Jeff's advice first maybe have a look at the error handling and flow of control.  You've got TRY/CATCH all over the place and GOTO and it's...

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

  • Reply To: Compare 2 rows in the same table and output result when conditions are met

    The explanation seems somewhat open to interpretation.  Maybe you could explain why Brazil's ItemCount is 300 and not 500?  If 500 is the correct number for Brazil then maybe something...

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

  • Reply To: Is there any better optimised way for insert in multiple tables using JSON

    ScottPletcher wrote:

    Steve Collins wrote:

    You have an explicit transaction called from within BEGIN TRY/END TRY yet the ROLLBACK (which presumably corresponds to the transaction) is in the CATCH block.  Checking XACT_STATE in...

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

  • Reply To: Comparing nvarchar with string has started generating weird conversion error

    shaunos wrote:

    ... has failed throwing:

    'Error converting data type varchar to numeric.'

    The where clause is comparing a nvarchar  field with a simple three character text string, no numerics to be seen...

    Shaunos 

    Cheers...

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

  • Reply To: Is there any better optimised way for insert in multiple tables using JSON

    gaurav wrote:

    Hello Everyone,

    I just started a developing a new application for hospitals (for maintaining hospital staff, patient, appointments etc.). I started with the database part first.

    I will use APIs as...

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

  • Reply To: Model Good Behavior

    Bruce W Cassidy wrote:

    I totally agree, Grant.

    I'm looking at introducing "software engineering" as a topic to discuss at work with the data engineers, and introduce them to all of those concepts like...

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

  • Reply To: sql query help

    Oops, I edited the code above and posted instead grr.  Preemptively, imo concatenation is preferable to replacement when the strings are not complicated (such as this one here) because it...

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

  • Reply To: Optimize Query

    This seems to return the correct results and could be "more optimized" (depending on cardinalities, indexes, etc.)

    select C1
    from #Base
    group by C1
    having sum(iif(C2='122', 1, 0))>nullif(sum(iif(C2='123', 1, 0)), 0);

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

  • Reply To: sql query help

    ScottPletcher wrote:

    STRING_AGG is not available in SQL Server 2016.

    Something like this maybe

    with
    unq_itemno_cte(itemno) as (
    select distinct itemno
    from #data),
    pvt_cte(itemno, string) as...

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

  • Reply To: sql query help

    ScottPletcher wrote:

    STRING_AGG is not available in SQL Server 2016.

    Maybe try starting here for examples of the old way

    One modern element I would add would be to use CONCAT_WS ("concat...

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

  • Reply To: sql query help

    Obviously there's no need for nullable columns or a cursor

    drop table if exists #data;
    go
    create table #data (
    businessday ...

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

Viewing 15 posts - 466 through 480 (of 1,413 total)