SQL Server May Let You Do It, But it Doesn’t Mean You Should

Slides:



Advertisements
Similar presentations
Burt King We will cover: Essentials --No command line needed here (mott) What is SQL Server How does it come to life What are the.
Advertisements

Big Data Working with Terabytes in SQL Server Andrew Novick
Common Mistakes Developers Make By Bryan Oliver SQL Server Mentor at SolidQ.
10 Things Not To Do With SQL SQLBits 7. Some things you shouldn’t do.
SQL Server Best Practices Keep Your Database In Top Performance Shape and Maintain Effective Backups September, 2007 Richard Kokoski.
Database Optimization & Maintenance Tim Richard ECM Training Conference#dbwestECM Agenda SQL Configuration OnBase DB Planning Backups Integrity.
SharePoint and SQL Server integration Demo: SQL Server Optimizing Configurations SQL Server 2014 for SharePoint 2013 Avoiding ginormous transaction.
Virtual techdays INDIA │ September 2011 Tips for Successful SQL Server Deployment in Enterprise Environment Balmukund Lakhani │ Technical Lead –
131 Agenda Overview Review Roles Lists Libraries Columns.
Stephan Hurni Consultant Trivadis AG, SQL Server notes from the field.
How a little code can help with support.. Chris Barba – Developer at Cimarex Energy Blog:
Architecture Rajesh. Components of Database Engine.
Learningcomputer.com SQL Server Working with Databases.
Learningcomputer.com SQL Server 2008 – Backup and Restore Database.
MISSION CRITICAL COMPUTING Siebel Database Considerations.
IMS 4212: Database Implementation 1 Dr. Lawrence West, Management Dept., University of Central Florida Physical Database Implementation—Topics.
Best Practices in Loading Large Datasets Asanka Padmakumara (BSc,MCTS) SQL Server Sri Lanka User Group Meeting Oct 2013.
October 1-2 Ølensvåg. Hardcore SQL Session Code: SQL-401-Hardcore Speaker(s): Vidar Nordnes.
How to kill SQL Server Performance Håkan Winther.
Scott Fallen Sales Engineer, SQL Sentry Blog: scottfallen.blogspot.com.
SQL Basics Review Reviewing what we’ve learned so far…….
You Inherited a Database Now What? What you should immediately check and start monitoring for. Tim Radney, Senior DBA for a top 40 US Bank President of.
New Instance… Now What? Presented by: James Donahoe Senior Solutions Engineer – TeleTracking Technologies MCSA: SQL Server 2012.
Database Administration for the Non-DBA Denny Cherry twitter.com/mrdenny.
Hitting the SQL Server “Go Faster” Button Rob Douglas #509 | Brisbane 2016.
ProgressBook Suite Maintenance
You Inherited a Database Now What?
Tips for SQL Server Performance and Resiliency
Hitting the SQL Server “Go Faster” Button
Intro to SQL Server for non-techs
Dynamic SQL: Writing Efficient Queries on the Fly
Building Effective Backups
Summit Nashville /28/2018 8:42 PM
Chapter Overview Understanding the Database Architecture
Introduction to SQL Server Management for the Non-DBA
The Top 5 SQL Server Mistakes
Database Administration for the Non-DBA
Tips for SQL Server Performance and Resiliency
Marcos Freccia Stop everything! Top T-SQL tricks to a developer
Dynamics AX Performance
The Vocabulary of Performance Tuning
The Ins and Outs of Indexes
Hitting the SQL Server “Go Faster” Button
The Vocabulary of Performance Tuning
What Is a Latch? …and Why Do I Care? Eddie Wuerch, mcm
Re-Indexing - The quest of ultimate automation
Making Your Emergency Toolkit
Example of a page header
Peter Shore SQL Saturday Cleveland 2016
Turbo-Charged Transaction Logs
The Ins and Outs of Indexes
Dynamic SQL: Writing Efficient Queries on the Fly
TEMPDB – INTERNALS AND USAGE
The PROCESS of Queries John Deardurff
I Learnded SQL And So Can You!
The 5 Hidden Performance Gems
In Memory OLTP Not Just for OLTP.
The PROCESS of Queries John Deardurff Website: ThatAwesomeTrainer.com
The PROCESS of Queries John Deardurff
AlwaysOn Availability Groups
It’s TEMPDB Why Should You Care?
The Vocabulary of Performance Tuning
Database hidden disasters…
Transaction Log Internals and Performance David M Maxwell
You Inherited a Database Now What?
The Ins and Outs of Indexes
The Vocabulary of Performance Tuning
CS222/CS122C: Principles of Data Management UCI, Fall 2018 Notes #03 Row/Column Stores, Heap Files, Buffer Manager, Catalogs Instructor: Chen Li.
The Ins and Outs of Indexes
Presentation transcript:

SQL Server May Let You Do It, But it Doesn’t Mean You Should Samantha Fahrmann s_2004fahrmann@hotmail.com Caliber Public Safety

About Me Application Developer – 7 years @slfahrmann on Twitter Working with SQL in a development role for 7 years Working with SQL in an Accidental DBA role for 4 years First Time Presenter

Agenda T-SQL Bad Habits Management Studio Bad Habits Database layout and design Maintenance, Configuration and Defaults The “I can’t believe you just did that” list

T-SQL Bad Habits Select * Cursors Where IntField = ‘1’ Coding in SQL – code reuse Functions in views Inline select Select * because It’s easy – I don’t know what I want. Just starting out – not looking forward. Cursors – there’s a time and place for it. But usually a better option – Search collection. Scalar value functions in column definitions in views – script Demo Inline select script demo

Management Studio Bad Habits Edit top 200 for small one field change Select top 1000 for 1 record Select top 1000 for getting what the table looks like – “What’s my column name?” Developers coming from Access – Go to Accidental Data modification – multi-tasking Do you really need to select all that data to make a change in one or two columns for a record? Select top 1000 – cause I’m not quite sure what record I need or the identity column to sort or filter on.

Database Layout and Design Column Based Settings Tables Not looking forward Data type abuse Normalization or lack there of… Indexing UniqueIdentifier as PK and Clustered Index Add a setting to application – add a column Did you consider design, how the data will change over time, what could be added later. Don’t know exactly what they want – default nvarchar(50), nvarchar(200), ntext – do you even need Unicode? SQL does have a max width for a table row – remember that. Violation SQL server does have max on column count and index count per table. Doesn’t mean you should ever get there. Developers adding indexes without understanding – Bit field indexes – Index on a single column every time one is added.

Maintenance, Configuration and Defaults Optimize For Ad-Hoc Workloads (Good Habit) Max Server Memory Database Creation Initial Size Growth Rate Auto Shrink Location on Disk TempDB Backups and Recovery Model Built in setting in configurations- Ad-Hoc not many reasons why not to use this – Database creation – using defaults- will not play nice down the road. Rubber band log files. You only have a C:\ Drive? Are you sure you know what you are doing? Sometimes I wonder about people. Backups – not having one – setting them and never checking them – where are they going? Database set to Full – we’ll just shrink regularly to maintain (Say What?!) Database set to Full – Single transaction log backup at same time every day with full backup – someone please explain the benefit of this to me? Log File growing out of control – we can fix this – just set it to simple right? That fixes everything! NO NO NO

I Can’t Believe You Just Did That! Shrink Database – “OH NO, there’s a little free space in there” NTEXT – “We’re just not sure what data will go there yet” Server uptime – 200+ days – “Are you sure you know what you’re doing?”

Questions?