Forum Replies Created

Viewing 15 posts - 151 through 165 (of 6,036 total)

  • Reply To: DATEDIFF() for times over a day long

    Jeff Moden wrote:

    Thought I'd toss my hat into the ring.  Details are where they should be... in the code. 😀  

    Call me old -fashioned, but I prefer functions to perform a single...

    • This reply was modified 3 years, 8 months ago by  Sergiy.
  • Reply To: DATEDIFF() for times over a day long

    I

    Jeff Moden wrote:

    ScottPletcher wrote:

    Don't worry about ms, just use seconds.  A few ms diff could be caused by almost anything is and not significant for an SSIS package.

    I have to strongly...

  • Reply To: DATEDIFF() for times over a day long

    frederico_fonseca wrote:

    @Sergiy - for sake of consistency can you give your version (condensed) that gives both outputs I gave - and taking in consideration that either today or yesterday could...

  • Reply To: DATEDIFF() for times over a day long

    The script from frederico seems to be too complicated.

    Here is much simpler version.

    For ease of understanding I put it into sequential steps:

    DECLARE
    @today [varchar](12) = '44:10:27.766',
    @yesterday [varchar](12) =...
  • Reply To: filter by WHERE has no effect

    onechipshot wrote:

    SET @whereClause = [dtmDocDate] >= DATEPART(dy, '2020-09-01')

    AND

    SET @whereClause = [dtmDocDate] >= DATEPART(dy, 2020-09-01)

    both receive errors on execution

    You obviously have problems with handling quotes in dynamic SQL.

    Before you try execution...

  • Reply To: filter by WHERE has no effect

    onechipshot wrote:

    Yes, most definitely.

    Since my last post I tried:

    SET @whereClause = '[dtmDocDate] >= DATEPART(dy, 2020-09-01)'

    with the same result.

    However, I think I have discovered the underlying issue.  The script of which...

  • Reply To: filter by WHERE has no effect

    Incorrect syntax?

    SET @whereClause = '[dtmDocDate] >= ''2020-09-01'''
  • Reply To: group parts by row count

    Is it what you're after?

    DECLARE @BatchId int = 10 ;
    with BatchOrders (InvNo, BatchID) as (
    select 1111, 1)

    select count(InvNo) as RecordCount, @BatchId as BatchId
    from BatchOrders
    where BatchId = @BatchId
  • Reply To: Loan Amortization Schedule for SQL Server

    Jeffrey Williams wrote:

    I do the same thing - either way works and probably won't see any differences in performance.

    I found from personal experience that function performs better than CTE.

    Probably, saving on...

  • Reply To: Poor Software Testing

    David.Poole wrote:

    Over my career I've rarely seen anywhere with an "as live" environment that wasn't production.  For that reason I don't particularly think this is a cloud only or even...

  • Reply To: Poor Software Testing

    When it comes to databases the concept of cloud computing eliminates any possibility of proper testing.

    In an ideal world databases must be future proof, so the testing must be performed...

  • Reply To: Are the posted questions getting worse?

    jasona.work wrote:

    Yeah, it's government for the "cloud" provider...

    My team leads' gone over the contract and it's not specified in the contract.  What he's trying to collect, information-wise, is how much...

  • Reply To: Counting Instances in TEXT

    INSERT google_file_store VALUES
    ('alt1.txt','The bullet points of this are:'),
    ('alt2.txt','- sometimes bull trading means selling bulls on the market;')
    ('alt3.txt','- bear in mind that ball bearings might not be relevant...
  • Reply To: Why Doesn't Database Software Help Us?

    I don't understand why you people are complaining about the lack of automated DB tuning.

    You've been given Auto Index Tuning - don't you have enough of it?

    Want more?

  • Reply To: Distributed SQL Databases

    Well, DDL is still code, right?

    then yes, it’s in code. Of some kind.

    🙂

Viewing 15 posts - 151 through 165 (of 6,036 total)