Forum Replies Created

Viewing 15 posts - 16 through 30 (of 211 total)

  • RE: SQLServerCentral apologizes and you can win a book

    Most SQL people I've come across are more than happy to share their knowledge and more often than not their code but be courteous and ask first and ALWAYS give...

    _____________________________________________________________________
    - Nate

    @nate_hughes
  • RE: Compare Tables

    I might be missing something but it seems like you're over complicating things.

    Your query with an OUTER JOIN and an EXISTS returns the same results set as an INNER JOIN...

    _____________________________________________________________________
    - Nate

    @nate_hughes
  • RE: Need Scripts

    If you're looking for "finished" scripts, I've found these to be useful.

    Kimberly Tripp's sp_helpindex: http://www.sqlskills.com/blogs/kimberly/category/sp_helpindex-rewrites/

    Michelle Ufford's Index Defrag script: http://sqlfool.com/2011/06/index-defrag-script-v4-1/

    Hope this helps.

    _____________________________________________________________________
    - Nate

    @nate_hughes
  • RE: The Vacation Dilemma

    The only extra work I do before going on vacation is to review and possible update any documentation for routine tasks that may need to get done while I'm out....

    _____________________________________________________________________
    - Nate

    @nate_hughes
  • RE: Is SAN admin correct? Windows 500 GB limitation on cluster failover?

    It's been a while but I think we had a similar issue. Might look into this:

    from dbforums.com: SQL Service starts before your SAN is available.

    We had this problem, too....

    _____________________________________________________________________
    - Nate

    @nate_hughes
  • RE: SQL concatenate

    Don't know that I completely understood the table/data setup but hopefully this at least points you in the right direction

    DECLARE @TblA TABLE (

    Col1 INT

    , Col2 INT

    );

    DECLARE @TblB TABLE (

    Col1 INT

    ,...

    _____________________________________________________________________
    - Nate

    @nate_hughes
  • RE: Gauging slackerness via code samples

    Evil Kraig F (3/8/2013)


    ...the DBAs know their name and groan because of the lack of effort...

    Funny, this is what prompted the discussion.

    Sean Lange (3/8/2013)


    I would say that "it depends". I...

    _____________________________________________________________________
    - Nate

    @nate_hughes
  • RE: Duties of a DBA

    Jeff Moden (3/6/2013)


    sunny.tjk (3/6/2013)


    Please see my assistant DBA...His name is "GOOGLE"

    I like that, think I'm going to start using it.

    In addition to the recommendations above, I'd say documentation is pretty...

    _____________________________________________________________________
    - Nate

    @nate_hughes
  • RE: Find the max(VisitID)

    Think you have to convert it to a number first...

    DECLARE @t_tbl TABLE (VisitId VARCHAR(50));

    INSERT INTO @t_tbl (VisitId) VALUES ('1'), ('2'), ('5'), ('7'), ('11');

    SELECT MAX(VisitId) FROM @t_tbl;

    -- returns 7

    SELECT MAX(CONVERT(INT,VisitId)) FROM...

    _____________________________________________________________________
    - Nate

    @nate_hughes
  • RE: Joins

    FWIW I was curious why my code didn't work so I snagged and slightly modified Lynn's code plugging in my select statement.

    use tempdb

    go

    CREATE TABLE Table_1 (

    ...

    _____________________________________________________________________
    - Nate

    @nate_hughes
  • RE: Joins

    beb9021 (3/1/2013)


    I ran this query:

    Select Date, Analyst_EID, Journey_EID, Accountant_EID

    From Table_2

    join Table_1

    on Table_2.Analyst_EID = Table_1.EID

    and Table_2.Journey_EID = Table_1.EID

    and Table_2.Accountant_EID = Table_1.EID

    Order by Date ASC

    What you are asking for here is any...

    _____________________________________________________________________
    - Nate

    @nate_hughes
  • RE: Find dependencies on a Login

    I've been tinkering with a reverse engineering script that might help.

    SET NOCOUNT ON;

    DECLARE @login NVARCHAR(128)

    , @sql VARCHAR(MAX);

    SET @login = 'applogin';

    -- GRANT SERVER LEVEL PERMISSIONS --

    SELECT[Login] = pri.name

    , [GrantServerPermissionSQL] = per.state_desc...

    _____________________________________________________________________
    - Nate

    @nate_hughes
  • RE: Security Change Snapshot

    Doh! Brackets.

    I've also added an orphaned users section at the end.

    SET NOCOUNT ON;

    DECLARE @login NVARCHAR(128)

    , @ModDate DATETIME

    , @Database NVARCHAR(128)

    , @sql NVARCHAR(MAX);

    --SET @login = 'applogin';

    --SET @ModDate = '12/12/2012';

    SET @Database = 'SharePoint_AdminContent_3a1c2e47-b402-4304-b38d-c036ebea9f6b';

    -----...

    _____________________________________________________________________
    - Nate

    @nate_hughes
  • RE: Compare the data in two tables, If Different, Update

    A MERGE statement might get you where you need to be or at least closer to a solution.

    http://technet.microsoft.com/en-us/library/bb510625(v=sql.105).aspx

    MERGE #UpdatedData AS target_tbl

    USING #OriginalData AS source_tbl

    ON target_tbl.MemberID = source_tbl.MemberID

    WHEN MATCHED AND target_tbl.FirstName...

    _____________________________________________________________________
    - Nate

    @nate_hughes
  • RE: Migrating from SQL 2008 to SQL 2008 R2

    I found the SQL Server Upgrade Advisor to be helpful in identifying potential issues.

    http://msdn.microsoft.com/en-us/library/ms144256(v=sql.105).aspx

    _____________________________________________________________________
    - Nate

    @nate_hughes

Viewing 15 posts - 16 through 30 (of 211 total)