Forum Replies Created

Viewing 15 posts - 1 through 15 (of 1,314 total)

  • Reply To: Hidden Pitfalls with INNER JOIN and NOT IN Operators

    Guarding against NULLs with WHERE NOT IN should be an ingrained habit.  There certainly are alternatives with JOIN or WHERE NOT EXISTS that may or may not be more efficient,...

  • Reply To: Your Favorite IDE

    SSMS + RedGate SQL Toolbelt.  We use VisualSVN as a backend for RedGate SQL Source Control.  Add in some free tools like RedGate SQL Search and SentryOne Plan Explorer, why...

  • Reply To: Using SQLCMD Variables

    The question was what should replace xxx in " SELECT 'xxx', ... ".

    There are already quotes around the xxx.  Why would I include another set of quotes around the SQLCMD...

  • Reply To: More Delays

    The question is "What happens when I run this code?".  The error I get is

    Msg 148, Level 15, State 1, Line 5

    Incorrect time syntax in time string '2020-01-10 1:13.' used...

  • Reply To: SQLCMD Mode

    I usually customize SSMS by defining a hotkey for this, like Ctrl-F7.

  • Reply To: Extracting certain numbers from a string

    SELECTCategory, ItemNumber, ExpectedResult, ExtractedNumber
    FROM #equipment
    CROSS APPLY ( SELECT Item1 = STUFF( REVERSE(ItemNumber), 1, CASE WHEN ItemNumber LIKE '%M' THEN 1 WHEN ItemNumber LIKE '%FT' THEN 2 ELSE...
  • Reply To: SSIS Derived Columns

    You want IsActive to be true if any of the four other values are TRUE, and FALSE only when they are all FALSE.  If those are truly Boolean data types,...

  • Reply To: Computed Columns Formulas

    The column D is a normal bit column, not computed.  So the definition of column C could be:

    ALTER TABLE dbo.mytable ADD C AS (A + B) /...
  • Reply To: What's the CMK?

    OK, a certificate is an asymmetric key.  But does that make all asymmetric keys certificates?

    I still do not agree with the answer that the CMK can only be a certificate.

  • Reply To: What's the CMK?

    So if you are using an asymmetric key from a Hardware Security Module as the CMK, it somehow can be called a certificate?

    I don't agree with this answer.

  • Reply To: Using temporary tables with OUTPUT clause

    The INSERT produces a "(4 row(s) affected)" message, so does the UPDATE.

    Since nothing produced a "(8 row(s) affected)" message, I assumed the question only applied to the result of the...

  • Reply To: Database Properties

    To begin with, none of the options are new in 2017.  Then the question asks for the option that will "add a certain bit in the header". None of the...

  • Reply To: NOT IN with OpenRowSet

    Can you run just the OPENROWSET query to verify what is being read from the file?

    "NOT IN (subquery)" doesn't work correctly if the subquery includes any NULL values.  Do any...

  • Reply To: Dos and Don'ts of Dynamic SQL

    I prefer the multi-line literal template with replaceable tokens style myself, like that shown in Alin Selicean's comment above.

    But if you must use explicit line breaks, a single line feed...

  • Reply To: Query to Find Mismatches

    If your original query didn't work, you probable have to worry about NULLs.

    An EXCEPT query is simpler to write and will deal with NULLs correctly, but performance depends on rowcounts...

Viewing 15 posts - 1 through 15 (of 1,314 total)