Forum Replies Created

Viewing 15 posts - 8,866 through 8,880 (of 49,571 total)

  • RE: Just curious, what are your SQL pet peeves ?

    SQLRNNR (5/29/2014)


    Here's one more - Devs with SA access

    Fixed that for you.

  • RE: Logical Consistency Error

    Restore the database from a clean backup, before the corruption occurred. You have some corruption more sever than just that table or checkDB wouldn't have aborted with an error

  • RE: tempDB data file

    Gangadhara MS (5/29/2014)


    Microsoft recommends For the TEMPDB database, create 1 data file per CPU.

    That recommendation belongs in the garbage.

  • RE: Drop table not working

    I said different scopes, not different batches. The batch is the unit of parsing (hence causing the OP's problem)

    CREATE PROCEDURE T1 AS

    CREATE TABLE #Temp1 (Col1 int)

    IF @@NESTLEVEL <= 10

    EXEC T1

    IF...

  • RE: Just curious, what are your SQL pet peeves ?

    Nolock

    Nested views

    Scalar UDFs

    Queries that try to handle too many possible cases

    Developers who think they know more than I do. 😉 :hehe:

  • RE: Logical Consistency Error

    Dave Mason (5/29/2014)


    It seems that I have some corruption within a user database. Running DBCC CHECKDB results in the following error:

    Msg 8921, Level 16, State 1, Line 1

    Check terminated....

  • RE: Drop table not working

    Eirikur Eiriksson (5/29/2014)


    Just to clarify and please correct me if I'm wrong here, but the temporary table would be in a scope of a session, not of a batch, regardless...

  • RE: T-Sql Query

    TheSQLGuru (5/27/2014)


    GilaMonster (5/27/2014)


    TheSQLGuru (5/27/2014)


    You also have the dreaded IS NULL OR construct

    How did I miss that....

    Because you have seen it so much you just don't see it any more?!? :hehe:

    Pretty...

  • RE: using select Max with insert

    Indeed. There are far more ways to get this wrong than get it right, and even when right it often slows things down.

  • RE: T-Sql Query

    ramana3327 (5/29/2014)


    They want to me create the a temptable or table variable for the main query output and then try to avoid the left outer join.

    They want you to add...

  • RE: T-Sql Query

    ramana3327 (5/29/2014)


    The dev is saying that we can still implement that query by avoiding that joins.

    So go to that dev and ask him to please show you the magic...

  • RE: Drop table not working

    It's because batches are parsed as a whole, then executed. When the parser hits the second create for that table it fails. It works with the debug break because that...

  • RE: table with zero rows showing data size

    Does the table have a clustered index?

  • RE: Unable to restore backup file to different database

    Aside, you don't need to create a dummy database to restore over. Just restore the backup and specify the name you want the DB to have in the restore statement.

  • RE: Drop table not working

    tshad (5/28/2014)


    I have a store procedure that creates a temp table #NewEmployees.

    I then drop the table and recreate it in a Select/Into clause but I get the error:

    There is already...

Viewing 15 posts - 8,866 through 8,880 (of 49,571 total)