Forum Replies Created

Viewing 15 posts - 2,821 through 2,835 (of 49,571 total)

  • RE: Clustered index on non-primary key columns

    Assuming that's the real table design, stop worrying about the clustered index and start worrying about how very badly that EAV design performs in general, and consider either a relational...

  • RE: Find top 10 expensive queries in the past 10 minutes

    yujinagata72 (7/8/2016)


    TheSQLGuru (7/5/2016)


    Download a copy of Glenn Berry's SQL Server Diagnostic Scripts for your version of SQL Server. An AMAZING collection of free stuff there!

    From Glenn's script, I can find...

  • RE: Clustered index on non-primary key columns

    Phil Parkin (7/8/2016)


    GilaMonster (7/8/2016)


    Phil Parkin (7/8/2016)


    SQL!$@w$0ME (7/8/2016)


    Does the clustered key column(s) has to be NOT NULL/UNIQUE as best practice?

    Yes. Otherwise SQL Server has to create its own 'uniquifier', to make...

  • RE: Clustered index on non-primary key columns

    Phil Parkin (7/8/2016)


    SQL!$@w$0ME (7/8/2016)


    Does the clustered key column(s) has to be NOT NULL/UNIQUE as best practice?

    Yes. Otherwise SQL Server has to create its own 'uniquifier', to make the rows unique....

  • RE: Not a DBA admin - How do i optimize/tune my queries, check on missing index?

    Yes, but that's only if queries contain such sensitive information as passwords. If no queries ever filter on plain text passwords (which they damn well shouldn't), then those can't expose...

  • RE: Backup is larger than DB

    Are you appending multiple backups to the same file?

    With the options there (NOINIT), if that backup file already exists, SQL appends the backup to the existing file, resulting in a...

  • RE: Inserting Where values don't Exist

    patrickmcginnis59 10839 (7/7/2016)


    I'm just wondering if your code might also contain the same sort of race condition pointed out by Gilamonster?

    Yes it can.

    Two sessions start, one runs the update,...

  • RE: # of tables in TempDB

    sunita2912 (7/7/2016)


    select name, object_name(object_id) As ObjName,*

    from tempdb.sys.objects

    where name like '#%'

    Is going to give temp table, table variables, cached temp table shells and internal work tables, not just the...

  • RE: Change recovery model

    Step 1 is completely unnecessary. Recovery model changes are online operations. You don't need to disconnect users and if you set the DB to read_Only, you won't be able to...

  • RE: About Adhoc Optimitation on real scenario

    Well, like any changes, you don't want to make it slap in the middle of the business day. Same as any changes, do them at the quietest time.

  • RE: Database "Generate Script" is failing

    DO NOT script the data!

    First because you'll get exactly these errors on larger tables. Second because the resultant script will probably crash Management Studio when you go to run...

  • RE: About Adhoc Optimitation on real scenario

    Definitely enable Optimise for Ad-hoc workloads with figures like that. It's a safe setting to turn on in general.

    Are those queries parameterised? If not, it may be a good idea...

  • RE: Force Corruption with WRITEPAGE in master database, demo purpose

    Shut down SQL, open master.mdf in my hex editor. Scribble zeros over places in the first ~100k of the file. Save. Start SQL, watch SQL fail to start.

  • RE: Inserting Where values don't Exist

    sunita2912 (7/6/2016)


    IF NOT EXISTS (

    SELECT 1

    FROM u_apppreferences

    WHERE NAME = @name

    AND val = @val

    )

    BEGIN

    INSERT INTO u_apppreferences (NAME,Val)

    VALUES (@name,@VAL)

    END

    ELSE

    PRINT 'Name and Val exists';

    As with the OP's original code, that is prone to...

  • RE: Sql script not working properly

    If the column is a varchar, which you said it is, then what you compare against it should be a string, hence in quotes. If you compare a string and...

Viewing 15 posts - 2,821 through 2,835 (of 49,571 total)