Forum Replies Created

Viewing 15 posts - 361 through 375 (of 13,460 total)

  • RE: coding a trigger to cope with NULL rows

    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


    --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!

  • RE: Report Builder - Where or Having Using Parameters

    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


    --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!

  • RE: sp_fkeys -- Oracle equivalent?

    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!

  • RE: Error w/ Auto_Increment for Creating new PK values

    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


    --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!

  • RE: Blank values in the query_plan column

    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


    --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!

  • RE: One of my Passed Exam of MCSA shows in MCSE, Why?

    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


    --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!

  • RE: Foreign Key Heirarchy

    Hey Lynn!
    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

    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!

  • RE: One of my Passed Exam of MCSA shows in MCSE, Why?

    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


    --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!

  • RE: Full backup size is very high

    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


    --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!

  • RE: QUOTED_IDENTIFIER and XML Problem

    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


    --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!

  • RE: tempdb causing constant Disk IO

    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


    --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!

  • RE: Percentage symbol questions

    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


    --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!

  • RE: Fuzzy Search

    this was really neat Bill, I like it;
    the thing i wanted was to also see a perfect score alongside the actual score, since longer strings would return larger scores

    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!

  • RE: Linked Server

    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


    --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!

  • RE: Getting rid of duplicate records

    ;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


    --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!

Viewing 15 posts - 361 through 375 (of 13,460 total)