Forum Replies Created

Viewing 15 posts - 1,186 through 1,200 (of 2,917 total)

  • Reply To: Can Case be used to assign filter with =, =

    I would recommend looking into Truth Tables.  But basically, what the approach is doing is if condition1 AND condition2 are both TRUE, then use the first option.  If EITHER condition...

    The above is all just my opinion on what you should do. 
    As with all advice you find on a random internet forum - you shouldn't blindly follow it.  Always test on a test server to see if there is negative side effects before making changes to live!
    I recommend you NEVER run "random code" you found online on any system you care about UNLESS you understand and can verify the code OR you don't care if the code trashes your system.

  • Reply To: Can Case be used to assign filter with =, =

    I think that is possible, but not QUITE the way you wrote it.  What I think you would need to do (I don't have your data or any DDL to...

    The above is all just my opinion on what you should do. 
    As with all advice you find on a random internet forum - you shouldn't blindly follow it.  Always test on a test server to see if there is negative side effects before making changes to live!
    I recommend you NEVER run "random code" you found online on any system you care about UNLESS you understand and can verify the code OR you don't care if the code trashes your system.

  • Reply To: Account the SQL service is Locked

    Kind of.  Anything that needs to authenticate as that account will fail.  Anything that has previously authenticated will work fine.  SO, the SQL instance will continue to run without problems,...

    The above is all just my opinion on what you should do. 
    As with all advice you find on a random internet forum - you shouldn't blindly follow it.  Always test on a test server to see if there is negative side effects before making changes to live!
    I recommend you NEVER run "random code" you found online on any system you care about UNLESS you understand and can verify the code OR you don't care if the code trashes your system.

  • Reply To: Joining 3 tables

    I sometimes do use the table name as the alias.  The reason I do this is that SQL Prompt SQL Format will automatically add the alias onto my columns IF...

    The above is all just my opinion on what you should do. 
    As with all advice you find on a random internet forum - you shouldn't blindly follow it.  Always test on a test server to see if there is negative side effects before making changes to live!
    I recommend you NEVER run "random code" you found online on any system you care about UNLESS you understand and can verify the code OR you don't care if the code trashes your system.

  • Reply To: How to find a user and a spid that holds database in single_user mode?

    Two thoughts.  First, does:

    EXEC SP_who2

    give you any results for a user connected to the database test1?  If there are a lot of connections, it can be a...

    The above is all just my opinion on what you should do. 
    As with all advice you find on a random internet forum - you shouldn't blindly follow it.  Always test on a test server to see if there is negative side effects before making changes to live!
    I recommend you NEVER run "random code" you found online on any system you care about UNLESS you understand and can verify the code OR you don't care if the code trashes your system.

  • Reply To: Azure SQL Database and SQL Managed Instance Security Best Practices

    Happy to help.

    I didn't cover EVERY scenario, I just covered some.  For example, if you have an IP allowed list and ONLY a small set of IP addresses are allowed...

    The above is all just my opinion on what you should do. 
    As with all advice you find on a random internet forum - you shouldn't blindly follow it.  Always test on a test server to see if there is negative side effects before making changes to live!
    I recommend you NEVER run "random code" you found online on any system you care about UNLESS you understand and can verify the code OR you don't care if the code trashes your system.

  • Reply To: Joining 3 tables

    The actual rule we have in place isn't specific to single character aliases though.  Our rule is that aliases and variable names must be specific enough to identify the object....

    The above is all just my opinion on what you should do. 
    As with all advice you find on a random internet forum - you shouldn't blindly follow it.  Always test on a test server to see if there is negative side effects before making changes to live!
    I recommend you NEVER run "random code" you found online on any system you care about UNLESS you understand and can verify the code OR you don't care if the code trashes your system.

  • Reply To: Joining 3 tables

    Since you have all the hard work done, all that's left is to put the table names in and define how you want to join them.  Since you have a...

    The above is all just my opinion on what you should do. 
    As with all advice you find on a random internet forum - you shouldn't blindly follow it.  Always test on a test server to see if there is negative side effects before making changes to live!
    I recommend you NEVER run "random code" you found online on any system you care about UNLESS you understand and can verify the code OR you don't care if the code trashes your system.

  • Reply To: How to find a user and a spid that holds database in single_user mode?

    I think this post will tell you how to do it:

    https://stackoverflow.com/questions/49741600/database-stuck-in-a-single-user-mode-in-sql-server

    To paraphrase, run

    SELECT spid
    FROM master..sysprocesses
    WHERE spid > 50 AND dbid = DB_ID('<Your_DB_Name>')

    and kill that SPID.

    The above is all just my opinion on what you should do. 
    As with all advice you find on a random internet forum - you shouldn't blindly follow it.  Always test on a test server to see if there is negative side effects before making changes to live!
    I recommend you NEVER run "random code" you found online on any system you care about UNLESS you understand and can verify the code OR you don't care if the code trashes your system.

  • Reply To: Query Recommendations

    To add to what Pietlinden said, we also have no visibility into that function.  You MAY be able to tune the function.

    As far as I know, using a table valued...

    The above is all just my opinion on what you should do. 
    As with all advice you find on a random internet forum - you shouldn't blindly follow it.  Always test on a test server to see if there is negative side effects before making changes to live!
    I recommend you NEVER run "random code" you found online on any system you care about UNLESS you understand and can verify the code OR you don't care if the code trashes your system.

  • Reply To: How can I tell where my Database encryption keys are kept

    I am not sure why you marked the previous answer as spam when it (as you said) answered your "initial question" but was not what you were expecting.

    If you followed...

    The above is all just my opinion on what you should do. 
    As with all advice you find on a random internet forum - you shouldn't blindly follow it.  Always test on a test server to see if there is negative side effects before making changes to live!
    I recommend you NEVER run "random code" you found online on any system you care about UNLESS you understand and can verify the code OR you don't care if the code trashes your system.

  • Reply To: How to rewrite sql query after where condition with another query more arranged

    I'd probably start by writing it in a manner that is easier to see and read (my preference, not required).  So something like:

      WHERE 
    ...

    The above is all just my opinion on what you should do. 
    As with all advice you find on a random internet forum - you shouldn't blindly follow it.  Always test on a test server to see if there is negative side effects before making changes to live!
    I recommend you NEVER run "random code" you found online on any system you care about UNLESS you understand and can verify the code OR you don't care if the code trashes your system.

  • Reply To: sql help querying across databases

    If the database names and table names are static and not going to change (ie no new ones coming in and none going away), then I'd recommend hard-coding it all...

    The above is all just my opinion on what you should do. 
    As with all advice you find on a random internet forum - you shouldn't blindly follow it.  Always test on a test server to see if there is negative side effects before making changes to live!
    I recommend you NEVER run "random code" you found online on any system you care about UNLESS you understand and can verify the code OR you don't care if the code trashes your system.

  • Reply To: SSRS Report Subscription Fails (Failure sending mail) due to column contents

    Happy to help.

    Also, thanks for the follow-up!  It is always nice to hear if a solution helped or not and what the final solution ended up being.

    The above is all just my opinion on what you should do. 
    As with all advice you find on a random internet forum - you shouldn't blindly follow it.  Always test on a test server to see if there is negative side effects before making changes to live!
    I recommend you NEVER run "random code" you found online on any system you care about UNLESS you understand and can verify the code OR you don't care if the code trashes your system.

  • Reply To: Partition by used to count records (to find dupes)

    First step would be to tell us the error as the error likely says how to fix it.

    My GUESS is that you are getting a "invalid column name" error which...

    The above is all just my opinion on what you should do. 
    As with all advice you find on a random internet forum - you shouldn't blindly follow it.  Always test on a test server to see if there is negative side effects before making changes to live!
    I recommend you NEVER run "random code" you found online on any system you care about UNLESS you understand and can verify the code OR you don't care if the code trashes your system.

Viewing 15 posts - 1,186 through 1,200 (of 2,917 total)