Forum Replies Created

Viewing 15 posts - 2,356 through 2,370 (of 2,458 total)

  • RE: Optimization Techniques

    karthik M (11/26/2012)


    All,

    what are all the new "Optimization Techniques" available in SQL 2012 which is not available in SQL 2008?

    On the new T-SQL optimization I highly recomend Microsoft SQL Server...

    "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 do a full copy of a database onto the same server with a different name

    jarid.lawson (11/26/2012)


    Glad I posted this, because my brilliant idea caused the system to crash.

    I tried the Tasks > Copy Database option. I made it most of the way through, but...

    "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 do a full copy of a database onto the same server with a different name

    Backup/Restore is best.

    You can also do a copy by: right-click your db >> Tasks >> Copy Database then go through the wizard.

    "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: Replication data out of sync

    Guras (11/26/2012)


    It is a transactional replication. It is strange that I cannot find that job in my SQL Agent job list.

    The agent job will be running whereever the job is...

    "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: Replication data out of sync

    Guras (11/26/2012)


    Unfortunately we are in the prod.

    First, I concur with MyDoggieJessie - check for filters, check the agent job to see if it is running without error...

    I don't know...

    "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: Replication data out of sync

    Guras (11/26/2012)


    I re ran the agent but still the rows are mising in the subscriber.

    I going to assume we're not in Prod...

    If the snapshot agent ran correctly your tables should...

    "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: Replication data out of sync

    You can accomplish this by re-running the snapshot agent for that subscription.

    "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: Help in writing a statement

    Based on the info provided:

    -- This table has the name of every department

    DECLARE @dept TABLE (

    deptNbr int primary key,

    department varchar(10) NOT NULL );

    -- This is where department goals are...

    "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: Split a String

    -- place to test the insert

    DECLARE @targetTable TABLE (val1 varchar(30), val2 varchar(30));

    -- the value fed to your query

    DECLARE @splitMe varchar(40) = '9279-1^Respiratory Rate^LOINC';

    ;WITH x(a,b) AS

    (SELECTLEFT(@splitMe, CHARINDEX('^',@splitMe)-1),

    RIGHT(@splitMe, LEN(@splitMe)-CHARINDEX('^',@splitMe))

    )

    INSERT...

    "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: Optimization of stored procedures

    If by "slows down the entire database" you mean that running these reports slows down other, non-reporting activity then my advise would be to do what Eugene was saying: consider...

    "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 Help

    Lokesh Vij (10/10/2012)


    This query would give the best performance from all the queries posted above 🙂

    SELECT dtStartDate,

    (SELECT Max(dtRunDate)

    ...

    "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: Help on Performance issue on Recursive CTE

    haiao2000 (10/10/2012)


    XMLSQLNinja (10/10/2012)


    You should post the actual DDL.

    From what I see you could make this faster using the Local Updateable Variable approach (e.g. the 'Quirky Update')... See http://www.sqlservercentral.com/articles/T-SQL/68467/

    Alen,

    I updated...

    "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: Help on Performance issue on Recursive CTE

    Homersdonut (10/10/2012)


    A co-worker analyzed CTE performance in SQL Server 2005 and determined it begins to degrade after, if I recall, 100,000 records.

    As we encounter performance related issues in production which...

    "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: Re-creating users after database restore

    SQL Guy 1 (10/10/2012)


    Thanks for quick replies.

    Alan: I cannot create a real table, because this db will be restored, and the table will be gone. About SSIS, frankly...

    "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: Help on Performance issue on Recursive CTE

    You should post the actual DDL.

    From what I see you could make this faster using the Local Updateable Variable approach (e.g. the 'Quirky Update')... See http://www.sqlservercentral.com/articles/T-SQL/68467/

    "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 - 2,356 through 2,370 (of 2,458 total)