Forum Replies Created

Viewing 15 posts - 1 through 15 (of 819 total)

  • Reply To: Detecting Multiple Changes

    If I want to check that ONLY the CustomerContactFirstName and CustomerContactLastName are update, then the right command is

    IF COLUMNS_UPDATED ()= 0x0C0000

    If I want to check that the CustomerContactFirstName and CustomerContactLastName...

  • Reply To: Adding Defaults

    The answer is correct, but the explanation is wrong. The error in the second statement occurs because, after the keyword DEFAULT, you must specify an expression, not the name of...

  • Reply To: Generating a Series I

    Thanks!

    Hallelujah!

  • Reply To: SQL Server Collations

    What do you mean by "individual join"?

  • Reply To: The Long String

    The truly correct answer is "Each full beer name and the first 20 characters of the beer description".

    If "beerdescription" is NVARCHAR(MAX), than the "select" returns only 10 characters.

  • Reply To: The Table Backup

    uhm, what about "Temporal tables"?

    "Temporal tables" do not need to be backed up and restored, you can see values in the "past" and restore them with a query.

    "SQL Server 2016...

  • Reply To: The Paradox of NOLOCK: How Dirty Reads Can Sometimes Be Cleaner

    UPDATE myTable WITH(NOLOCK) is not permitted by SQL SERVER, so, it's impossible to try.

    In any case, I prefer the option "SET TRANSACTION ISOLATION LEVEL SNAPSHOT", so, I can read committed...

  • Reply To: Am I on Synapse?

    The correct answer is "ServerProperty with the EngineEdition". It returns 6 for "Azure Synapse Analytics".

  • Reply To: NOT IN Confusion

    Not Exists vs Not In:

    SELECT *

    FROM dbo.Candidates AS c

    WHERE

    NOT exists

    ( SELECT PersonName FROM dbo.Person WHERE Person.PersonName = c.PersonName);

  • Reply To: Which is a table?

    The correct answer is "Customers_b only", because the definition of primary key is that all column should be "NOT NULLABLE".

    In this way you can JOIN tables by the PK without...

  • Reply To: Multi-Database Marked Transactions

    From BOL: "If a marked transaction spans multiple databases on the same database server or on different servers, the marks must be recorded in the logs of all the affected...

  • Reply To: Unlocking Power with Updatable Views in SQL Server

    Instead of views, I use a lot TVF and CTE, the limits are the same as for views.

    Here an example:

    create table a (i int)
    GO
    create function myfn_a(@i int)
    returns...
  • Reply To: Join Hint Limitations

    From BOL:

    REMOTE cannot be used when one of the values being compared in the join predicate is cast to a different collation using the COLLATE clause.

    The query fails only if...

  • Reply To: Parameter Defaults

    DesNorton wrote:

    The default values for parameters are not stored anywhere in the DMVs.

    This statement is incorrect

    SELECT ProcName = pr.name
    , ParamName = p.name
    ...
  • Reply To: Parameter Defaults

    Typo in answers: sys.modules is wrong, as it stated in the explanation: sys.sql_modules.

     

Viewing 15 posts - 1 through 15 (of 819 total)