Forum Replies Created

Viewing 15 posts - 571 through 585 (of 7,472 total)

  • Reply To: Performance of same query slower for a different user

    Replace the Scalar Value function with a (in-line) Table Value Function and you will have a stable running potentially fast query !

    ...
    outer apply dbo.tvf_GenerateCostCode(CC.Code, SU.Code,...
  • Reply To: explicite alternative to FORMAT() concerning DATE

    Jeff Moden wrote:

    @Johan ... Do you have the code where you created and populated the #TallyDate table so that newbies can run your test?

    Also, your good code doesn't need the DATEADD/DATEDIFF...

  • Reply To: explicite alternative to FORMAT() concerning DATE

    The test is simple and straight forward

    set statistics time , io on
    go

    select FORMAT(datecol, 'yyyy-MM-dd') as Datetext
    from #TallyDate
    --order by DateCol

    /*
    (10000 rows affected)
    Table '#TallyDate__________________________________________________________________________________________________________000000000008'. Scan count 1, logical reads...
  • Reply To: Availability Groups

    just to add to Jeffrey's hints:

    Keep in mind your secondaries will also need the same size available !

    Don't forget your LDF files ! (these do not benefit from IFI !...

  • Reply To: Connecting Cloud Run to cloud sql

    Which cloud(s) are you using?

    how did you configure your connections?

    how does your routing work?

    did you configure the needed firewall rules?

     

  • Reply To: UNION from many linked servers

    If possible, avoid linked servers.

    your code may block others ( local to the linked server ) !

    Maybe your process is even better off doing its stuff using e.g. SSIS (...

  • Reply To: How to put a variable content as attachment file saida.txt ?

    You could put it all in a table ( non-# and non-## ), kind of a key-value pair thing.

    Then have the query selecting your stored row from the table

     

                

    June 15, 2022 at 12:59 pm

    #4049881

  • Reply To: How to put a variable content as attachment file saida.txt ?

    Best is to have sp_send_dbmail execute the query and store the result in a given filename to be added to the email

    e.g:

    declare @subject varchar(1000)
    set @subject = @@servername...
  • Reply To: Can show trigger be granted without the update trigger credential in Aurora or m

    I don't know for Aurora and mysql

     

    In SQLServer you can just use "GRANT view definition TO ..."

  • Reply To: Upgrading SQL Server 2008 R2 to 2017

    I would not rename the new server (to much a hassle ), but have an alias for the name of the old server point to the new server.

  • Reply To: Restore multiple transaction logs from disk

    ashatimjohn wrote:

    I figured out why the exec @cmd wasn't working. I was filtering out the files before it got to the cursor. Now I have one last problem. I am...

  • Viewing 15 posts - 571 through 585 (of 7,472 total)