Forum Replies Created

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

  • Reply To: ORDER BY alias

    The correct answer is "none of them".

    The query below generates an error: "Ambiguous column name", because "val" is both an alias and a column name:

    SELECT id, ISNULL(val, id) + 1...

  • Reply To: Backing Up a DMK

    I think that the DMK should be open before the backup.

    If it's encrypted by SMK, sql server open it automatically else you must execute OPEN KEY.

  • Reply To: The Service Name

    The usual typo! @@servicename()

    How am I supposed to know whether it's an accidental mistake or intentional?

  • Reply To: Detecting Characters

    The answer is correct:

    "3 out of 10 rows affected"

    Case sensitivity strikes again. ??

  • Reply To: Detecting Characters

    Does it return two result set? 🙂

  • Reply To: Running SQLCMD I

    In this case "GO" is the name of the column:

    select @@version go

    is the same as

    select @@version AS go

    or

    select go = @@version

    Maybe an error is generated if I use semicolon ";"

    select...

  • Reply To: QUOTENAME Behavior

    Classic XSS "<asdasd>"!

  • Reply To: Using OPENJSON

    Another interesting question with a wrong answer!

  • Reply To: Identities and Sequences II

    The correct answer is 'Neither' because the identity column can be reseeded; therefore, a continuous sequence is not guaranteed.

  • 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...

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