Viewing 15 posts - 361 through 375 (of 13,460 total)
that trigger is extremely dangerous, as data will get lost when multiple rows are inserted, and does not handle the INSTEAD OF logic that is required.
SQL triggers must be designed to handle...
Lowell
August 10, 2017 at 8:35 am
can you use a case statement to evaluate two different values based on your parameter? assuming the sum > 0 like this?
declare @param varchar(3) = 'Y'
SELECT Salesperson,...
Lowell
August 9, 2017 at 4:24 pm
I don't have access to an Oracle anymore, but this document over at Oracle says that the table ALL_CONS_COLUMNS is the equivalent of sp_pkeys and sp_fkeys results, does that help? Lowell
--help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!
August 9, 2017 at 2:03 pm
in SQL, you don't reference the table to generate a new column value, there is an identity property that does it for you instead.
your structure and command should look...
Lowell
August 9, 2017 at 10:13 am
I found this article that nicely explains why we sometimes get null query_plan columns
https://blogs.msdn.microsoft.com/psssql/2016/07/13/why-am-i-getting-null-values-for-query_plan-from-sys-dm_exec_query_plan/
does that help?
i see the same behaviour when I run sp_whoisactive; I can get...
Lowell
August 9, 2017 at 10:07 am
Yeah, that is really confusing.
When I last looked, there were five specific exams for me to take to get the MCSE on that same track;they all seemed to be...
Lowell
August 7, 2017 at 1:05 pm
Hey Lynn! Lowell
two versions for you:
there is a built in microsoft procedure that does this, my code is just a wrapper around that, really:
EXEC sp_msdependencies @intrans = 1
--help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!
August 7, 2017 at 11:04 am
Congratulations!
details, I think, are in order. what exam did you take? go straight to your transcript, you should see it there.
did you take your SECOND exam to...
Lowell
August 7, 2017 at 10:49 am
and the specifics:
if you scripted the backup command, you'll see NO INIT which means append to the previous backup file; changing it to INIT will replace the file, effectively...
Lowell
August 6, 2017 at 3:04 pm
i think it is the query that is passed to the send mail task...that query gets executed in a different context.
change this:SET @alert_query = ';WITH event_data AS...
Lowell
August 4, 2017 at 11:21 am
tempdb is used internally to handle things that require sorts...ORDER BY in a select that is not satisfied by an existing index, or sorting the data first, in order to do...
Lowell
August 4, 2017 at 6:02 am
it's the Modulus operator
0 / 3 = 3 (integer returned, as 3 goes into ten three times, with one left over
10 % 3 returns 1(the remainder)
in...
Lowell
August 3, 2017 at 12:35 pm
this was really neat Bill, I like it; Lowell
the thing i wanted was to also see a perfect score alongside the actual score, since longer strings would return larger scores
--help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!
August 3, 2017 at 11:24 am
If there were no known changes, I would assume that the Primary Domain Controller was not available for a moment, and just rerun the job.
if it fails again, that's...
Lowell
August 3, 2017 at 8:32 am
;WITH MySampleData([ScheduleID],[Location],[StartDate],[EndDate],[Site])
AS
(
SELECT '1','LocationA',CONVERT(date,'8/3/2017'),CONVERT(date,'8/4/2017'),'Site1' UNION ALL
SELECT '2','LocationA','8/3/2017','8/4/2017','Site2' UNION ALL
SELECT '3','LocationA','8/5/2017','8/6/2017','Site1' UNION ALL
SELECT '4','LocationA','8/5/2017','8/6/2017','Site2'
)
select Location, StartDate, EndDate, MIN(Site) AS Site
Lowell
August 3, 2017 at 8:08 am
Viewing 15 posts - 361 through 375 (of 13,460 total)