Forum Replies Created

Viewing 15 posts - 1,591 through 1,605 (of 5,841 total)

  • RE: T-SQL Load Log file to Secondary DB

    Just get out books online and review the RESTORE LOG section.

    Or you can use SSMS GUI to fully script out your options and then click the Script button...

    Best,
    Kevin G. Boles
    SQL Server Consultant
    SQL MVP 2007-2012
    TheSQLGuru on googles mail service

  • RE: Never Shrink a Database?

    dan-572483 (3/10/2015)


    I've read several times in different places that one should NEVER shrink a database data file except as a last resort due to the effect on index fragmentation. One...

    Best,
    Kevin G. Boles
    SQL Server Consultant
    SQL MVP 2007-2012
    TheSQLGuru on googles mail service

  • RE: High Availability - only run on primary

    krypto69 (3/9/2015)


    Hi,

    We have H/A setup on SQL2012. Seems to work fine.

    I thought there was code I could add that would check to see if it was running on the primary...

    Best,
    Kevin G. Boles
    SQL Server Consultant
    SQL MVP 2007-2012
    TheSQLGuru on googles mail service

  • RE: Slow Table Performance

    So you did 600K reads, with 80K being physical, and you are upset it takes 5 mins?? 😀

    Best,
    Kevin G. Boles
    SQL Server Consultant
    SQL MVP 2007-2012
    TheSQLGuru on googles mail service

  • RE: can anyone provide me real time scenarios where you build stored procedures, triggers, cursors?

    I sit with and work closely with the developers, they work with me, and we all work together on the common goal. More companies should do such a thing because...

    Best,
    Kevin G. Boles
    SQL Server Consultant
    SQL MVP 2007-2012
    TheSQLGuru on googles mail service

  • RE: can anyone provide me real time scenarios where you build stored procedures, triggers, cursors?

    t.mounika01 (3/6/2015)


    Actually, what i meant was that I just have thereotical knowledge and I have been practicing queries on ssms installed in my laptop. I want to know how...

    Best,
    Kevin G. Boles
    SQL Server Consultant
    SQL MVP 2007-2012
    TheSQLGuru on googles mail service

  • RE: Slow Table Performance

    Scott Coleman (3/6/2015)


    Hopefully the CRM app rarely does "SELECT * FROM dbo.notes" on the whole table, so doing that in Management Studio is not a useful test. You're just...

    Best,
    Kevin G. Boles
    SQL Server Consultant
    SQL MVP 2007-2012
    TheSQLGuru on googles mail service

  • RE: can anyone provide me real time scenarios where you build stored procedures, triggers, cursors?

    Your "real time" doesn't make any sense to me. Real time happens in SQL Server all the time. You INSERT data - it goes in in "real time". ...

    Best,
    Kevin G. Boles
    SQL Server Consultant
    SQL MVP 2007-2012
    TheSQLGuru on googles mail service

  • RE: Slow Table Performance

    Oh, I should also ask WHY do you want to bring back the entire table to SSMS?

    Best,
    Kevin G. Boles
    SQL Server Consultant
    SQL MVP 2007-2012
    TheSQLGuru on googles mail service

  • RE: Slow Table Performance

    So you are spooling 1M+ rows (fat or otherwise) back to the client, in this case SSMS?!? That isn't going to work out well for you!!

    Declare variables...

    Best,
    Kevin G. Boles
    SQL Server Consultant
    SQL MVP 2007-2012
    TheSQLGuru on googles mail service

  • RE: SQL 2012 Query not efficient

    Nevyn (3/4/2015)


    Thanks!

    Started doing it with a CTE for the max(case) and then it just occurred to me that I really didn't need it to be in a CTE just to...

    Best,
    Kevin G. Boles
    SQL Server Consultant
    SQL MVP 2007-2012
    TheSQLGuru on googles mail service

  • RE: SQL 2012 Query not efficient

    Nevyn (3/4/2015)


    For starters:

    SELECT PERSID,

    CASE MAX(CASE DUESTATUS

    WHEN 'Overdue' THEN 2

    WHEN 'DUE' THEN 1

    ELSE 0

    END)

    WHEN 2 THEN 'Overdue'

    WHEN 1 THEN 'Due'

    ELSE 'Unknown'

    END DUESTATUS,

    CASE MAX(CASE COMPSTATUS...

    Best,
    Kevin G. Boles
    SQL Server Consultant
    SQL MVP 2007-2012
    TheSQLGuru on googles mail service

  • RE: Always On Secondary falling behind

    There are DMVs that expose Always On metadata and status information. If you aren't familiar with them and can't find a blog post just set up Profiler and open...

    Best,
    Kevin G. Boles
    SQL Server Consultant
    SQL MVP 2007-2012
    TheSQLGuru on googles mail service

  • RE: DOES CASE STATEMENT WORKS ON THIS CONDITION

    Sangeeth878787 (3/3/2015)


    hi,

    I want to check if column 1 = 'ab' then I need all the other columns (column2, column3 ) values need to be zero

    I tried doing this

    select case when...

    Best,
    Kevin G. Boles
    SQL Server Consultant
    SQL MVP 2007-2012
    TheSQLGuru on googles mail service

  • RE: Why does SQL Server not pull expected results when using strings with comparison operators?

    What's wrong with this?

    USE AdventureWorks2012 ;

    GO

    --Returns 5 records

    SELECT pp.Name

    FROM Production.Product AS pp

    WHERE pp.Name LIKE N'Short%'

    Best,
    Kevin G. Boles
    SQL Server Consultant
    SQL MVP 2007-2012
    TheSQLGuru on googles mail service

Viewing 15 posts - 1,591 through 1,605 (of 5,841 total)