Forum Replies Created

Viewing 15 posts - 151 through 165 (of 1,243 total)

  • Reply To: PATINDEX question

    The regular expression here '%[^0]%' starts by looking for the first non zero in the string (col+'.')

    120. --> 120

    0150. --> 150

    The ^ is a negation operator (meaning NOT) when inside...

    ----------------------------------------------------

  • Reply To: Left Join with reference data.

    Thank you Scott. I now know the naming of this type of scheme. I've seen it where the pk object has different properties based on the value in another column...

    ----------------------------------------------------

  • Reply To: How to pass a variable in a folder path using TSQL

    I might as well add, if this is supposed to be  routing you could create a JOB that runs powershell to do the move. With powershell you can actually go...

    ----------------------------------------------------

  • Reply To: How to pass a variable in a folder path using TSQL

    Something like the following  ?

    declare @cmdStr as varchar(100);
    declare @today AS CHAR(8)

    set @today = '20220805'; /* Or however you want to set this */
    set @cmdStr = 'copy...

    • This reply was modified 3 years, 11 months ago by MMartin1.

    ----------------------------------------------------

  • Reply To: How to pass a variable in a folder path using TSQL

    In your server you can enable xp_cmdShell

    exec sp_configure 'xp_cmdShell'

    To view the current setting for this option. You can run CMD commands within your script with this (be...

    ----------------------------------------------------

  • Reply To: The Case for Patching

    We do fail overs when patching. The only gotcha is to make sure there are no "Jobs" running at the time that could be interrupted.

    If there are tons of servers...

    ----------------------------------------------------

  • Reply To: INSERT EXEC statement cannot be nested, the Simple Solution

    A very nice and handy article. I learned about assemblies built with C# long ago but never got around to using them. This is an example of a good time...

    ----------------------------------------------------

  • Reply To: Automatic Plan Correction

    I realise this is an older post, but I was wondering if anyone has experienced any downsides with automatic tuning being on. It seems it is all positive from the...

    ----------------------------------------------------

  • Reply To: Getting an error when I try to shrink transaction log file

    Once  transactions are moved over to the replica log get cleared. Problems arise if there is ever a connection issue.

    ----------------------------------------------------

  • Reply To: What queries to tune first?

    Just to add my bit:

    In the Query Store you my want to look at regressed quries. In fact look at your Query Store overall from many views,... I/O, cpu, running...

    ----------------------------------------------------

  • Reply To: Database Log File

    Set the size manually after restorng and see if it does not get shrunk after wards.

    ----------------------------------------------------

  • Reply To: Updating data

    Are you connecting to the correct database and not a test server ?

    ----------------------------------------------------

  • Reply To: High cpu of 90-95% on SQL Box

    You can try to check the Query Store for "regressed queries". These are ones that have chosen less optimal plans. There could be a few procedures this is afflicting but...

    ----------------------------------------------------

  • Reply To: Getting an error when I try to shrink transaction log file

    Sounds like your transaction log being full is putting a stop to replication. There is no need to "shrink" the log file if it is just going to grow again....

    ----------------------------------------------------

  • Reply To: Always on Failover

    Secondary replicas as I understand have read intent off by default. Did you make this change in the application or the database ?

    ----------------------------------------------------

Viewing 15 posts - 151 through 165 (of 1,243 total)