Forum Replies Created

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

  • 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

    SELECT	Category, 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...

  • Reply To: XML data load to sqlserver.

    The fact that AddressLine has a sequence attribute leads me to believe that multiple address lines are possible.

    So I added a sequence="2" node to the XML, before sequence="1".  So you...

  • Reply To: SSIS Error: "Please Specify Server Password"

    DontSaveSensitive is what I use.  All passwords should be provided through configurations.

    Preferable some kind of configuration that doesn't leave it sitting there in plain text, such as command-line configuration in...

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