Viewing 15 posts - 1 through 15 (of 1,312 total)
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...
March 20, 2020 at 6:25 pm
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...
January 16, 2020 at 11:54 pm
I usually customize SSMS by defining a hotkey for this, like Ctrl-F7.
January 16, 2020 at 11:45 pm
SELECT Category, ItemNumber, ExpectedResult, ExtractedNumberFROM #equipmentCROSS APPLY ( SELECT Item1 = STUFF( REVERSE(ItemNumber), 1, CASE WHEN ItemNumber LIKE '%M' THEN 1 WHEN ItemNumber LIKE '%FT' THEN 2 ELSE...
October 8, 2019 at 1:51 pm
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,...
July 24, 2019 at 3:12 pm
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) /...
July 23, 2019 at 6:06 pm
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.
June 28, 2019 at 6:17 pm
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.
June 27, 2019 at 1:35 pm
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...
June 14, 2019 at 12:58 pm
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...
May 14, 2019 at 7:02 pm
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...
May 9, 2019 at 6:15 pm
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...
April 29, 2019 at 6:18 pm
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...
April 23, 2019 at 8:10 pm
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...
April 23, 2019 at 8:04 pm
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...
April 10, 2019 at 4:34 pm