Forum Replies Created

Viewing 15 posts - 481 through 495 (of 2,462 total)

  • RE: how to Import XML data into one single table in SQL server using SSIS

    hegdesuchi (9/9/2016)


    Hi,

    OPENXML works fine if all have single parent node.

    But I might want columns for different nodes. Do we have any option?

    Thanks

    Post a sample of the XML you're working...

    "I cant stress enough the importance of switching from a sequential files mindset to set-based thinking. After you make the switch, you can spend your time tuning and optimizing your queries instead of maintaining lengthy, poor-performing code."

    -- Itzik Ben-Gan 2001

  • RE: How do I assign the correct date ?

    Ed Wagner (9/9/2016)


    chris.evans 94907 (9/9/2016)


    Hi Alan/Mike,

    Following on from this, I'm looking to add a DATEDIFF calculation between today's date 'GETDATE()' and each individual date but only where the Working Day...

    "I cant stress enough the importance of switching from a sequential files mindset to set-based thinking. After you make the switch, you can spend your time tuning and optimizing your queries instead of maintaining lengthy, poor-performing code."

    -- Itzik Ben-Gan 2001

  • RE: how to Import XML data into one single table in SQL server using SSIS

    OPENXML should work just fine for this task.

    "I cant stress enough the importance of switching from a sequential files mindset to set-based thinking. After you make the switch, you can spend your time tuning and optimizing your queries instead of maintaining lengthy, poor-performing code."

    -- Itzik Ben-Gan 2001

  • RE: Query to find missing data

    Here's some sample data and an example of how to use LAG to get you started.

    DECLARE @sometable table (ID int, DeviceID int, Value decimal(8,1), DT datetime);

    INSERT @sometable

    VALUES

    (22, 4, 23.6,...

    "I cant stress enough the importance of switching from a sequential files mindset to set-based thinking. After you make the switch, you can spend your time tuning and optimizing your queries instead of maintaining lengthy, poor-performing code."

    -- Itzik Ben-Gan 2001

  • RE: How do we get the DEF of a view ?

    Alternatively, you can bypass sys.sql_modules all together and use OBJECT_DEFINITION.

    CREATE VIEW MyView

    AS

    SELECT 1 AS Col1;

    GO

    SELECT OBJECT_DEFINITION(OBJECT_ID('MyView'))

    "I cant stress enough the importance of switching from a sequential files mindset to set-based thinking. After you make the switch, you can spend your time tuning and optimizing your queries instead of maintaining lengthy, poor-performing code."

    -- Itzik Ben-Gan 2001

  • RE: Splitting Strings in SQL Server 2016

    corey lawson (9/8/2016)


    Hmm... I kind of like the XML-based splitter method, if only because part of the process is it can throw out the data in the output tableset as...

    "I cant stress enough the importance of switching from a sequential files mindset to set-based thinking. After you make the switch, you can spend your time tuning and optimizing your queries instead of maintaining lengthy, poor-performing code."

    -- Itzik Ben-Gan 2001

  • RE: SQL 2016 Replication

    Budd (9/8/2016)


    Thank you Alan.

    "Not Replicating Triggers" the trigger itself, or the results after a triggered event?

    I was talking about the triggers themselves. I had a situation a few years back...

    "I cant stress enough the importance of switching from a sequential files mindset to set-based thinking. After you make the switch, you can spend your time tuning and optimizing your queries instead of maintaining lengthy, poor-performing code."

    -- Itzik Ben-Gan 2001

  • RE: SQL 2016 Replication

    Budd (9/8/2016)


    What are the pros and cons that you see for each type of replication in a situation like this?

    Thanks

    The pros are that SQL Server Replication is stable and reliable...

    "I cant stress enough the importance of switching from a sequential files mindset to set-based thinking. After you make the switch, you can spend your time tuning and optimizing your queries instead of maintaining lengthy, poor-performing code."

    -- Itzik Ben-Gan 2001

  • RE: SQL query permutations using 3 tables without repetition

    Ditto everything Drew said. We'll need more info to help you.

    Perhaps something like this (I did a few permutations based on my best guess of what you need).

    SELECT...

    "I cant stress enough the importance of switching from a sequential files mindset to set-based thinking. After you make the switch, you can spend your time tuning and optimizing your queries instead of maintaining lengthy, poor-performing code."

    -- Itzik Ben-Gan 2001

  • RE: How do I assign the correct date ?

    turlteman.mike (9/1/2016)


    This looks useful but whrere you have this line

    SELECT TOP (1) calDate MIN(caldate)

    Is the strikethrough deliberate?

    Sorry I almost missed this.

    Yes, I was saying that using MIN seemed...

    "I cant stress enough the importance of switching from a sequential files mindset to set-based thinking. After you make the switch, you can spend your time tuning and optimizing your queries instead of maintaining lengthy, poor-performing code."

    -- Itzik Ben-Gan 2001

  • RE: Get notified when sql server agent isn't running?

    That means the service is either failing to start and crashing. That's something a DBA or Server Admin would have to look into. A service failing to start or crashing...

    "I cant stress enough the importance of switching from a sequential files mindset to set-based thinking. After you make the switch, you can spend your time tuning and optimizing your queries instead of maintaining lengthy, poor-performing code."

    -- Itzik Ben-Gan 2001

  • RE: Get notified when sql server agent isn't running?

    Adam Sandler (9/1/2016)


    Thanks Alan - I suppose this is something I should get the local network / support people to set up for me?

    Any settings I can apply to make...

    "I cant stress enough the importance of switching from a sequential files mindset to set-based thinking. After you make the switch, you can spend your time tuning and optimizing your queries instead of maintaining lengthy, poor-performing code."

    -- Itzik Ben-Gan 2001

  • RE: Data gets truncated and breaked

    Can you provide an example of what you are getting as well as what you should be getting?

    "I cant stress enough the importance of switching from a sequential files mindset to set-based thinking. After you make the switch, you can spend your time tuning and optimizing your queries instead of maintaining lengthy, poor-performing code."

    -- Itzik Ben-Gan 2001

  • RE: Get notified when sql server agent isn't running?

    Adam Sandler (9/1/2016)


    Basically I have jobs on a server, which I dont control or the hardware its on. I have jobs like backups running. If agent isnt running, the jobs...

    "I cant stress enough the importance of switching from a sequential files mindset to set-based thinking. After you make the switch, you can spend your time tuning and optimizing your queries instead of maintaining lengthy, poor-performing code."

    -- Itzik Ben-Gan 2001

  • RE: Difference between ROW_NUMBER() and ORDER BY...DESC

    Everyone has touched on this but the most important thing to understand is: the only way to guarantee that results are returned in a specific order is with an ORDER...

    "I cant stress enough the importance of switching from a sequential files mindset to set-based thinking. After you make the switch, you can spend your time tuning and optimizing your queries instead of maintaining lengthy, poor-performing code."

    -- Itzik Ben-Gan 2001

Viewing 15 posts - 481 through 495 (of 2,462 total)