Your SlideShare is downloading. ×
0
Coding T-SQL in a Team Environment
Coding T-SQL in a Team Environment
Coding T-SQL in a Team Environment
Coding T-SQL in a Team Environment
Coding T-SQL in a Team Environment
Coding T-SQL in a Team Environment
Coding T-SQL in a Team Environment
Coding T-SQL in a Team Environment
Coding T-SQL in a Team Environment
Coding T-SQL in a Team Environment
Coding T-SQL in a Team Environment
Coding T-SQL in a Team Environment
Coding T-SQL in a Team Environment
Coding T-SQL in a Team Environment
Coding T-SQL in a Team Environment
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×
Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Text the download link to your phone
Standard text messaging rates apply

Coding T-SQL in a Team Environment

870

Published on

Coding in a Team Environment: Best Practices and More …

Coding in a Team Environment: Best Practices and More

Presented by Garth Honhart to the Silicon Valley SQL Server User Group in November 2009.

Garth’s presentation is inspired by Aaron Bertrand’s Bad Habits to Kick series.

You'll learn about:
• New tools that can make T-SQL code easier maintain
• The latest thinking on generally accepted best practices
• How to keep in mind that coding long term doesn’t have to be hard
• Useful new features in SQL 2008 Management Studio
• Some new and useful T-SQL Functions in SQL 2008

Garth Honhart is a Microsoft Certified Technology Specialist for SQL Server 2005 & SQL 2008 Business Intelligence. He has worked in IT for FedEx, Kaiser Permanente, Wells Fargo and Align Technology.

Published in: Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
870
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
24
Comments
0
Likes
0
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide

Transcript

  1. Coding T-SQL in a Team T- Environment Garth Honhart Silicon Valley SQL Server User Group November 17, 2009 Mark Ginnebaugh, User Group Leader
  2. Before I Get Started…News Released Today SQL Server 2008 Cumulative Update #8 SQL Server 2008 Cumulative Update #5 Recently Released SQL Server 2008 R2 November CTP Office 2010 Beta (64-bit Client & PowerPivot!) From PDC Microsoft Pinpoint: Codename “Dallas” Cloud based datasets, such as demographic and sales information. Think of it as the un-federated portion of the data that would be used when performing a PowerPivot.
  3. Garth Honhart • RF-4C (1960’s era Reconnaissance Aircraft) • A-10 (Desert Storm Scud Hunters) • Airmail Terminal Frankfurt (Yes, I know how to go postal) USAF • U-2 (1950’s era Reconnaissance Aircraft…and they’re still flying) • Global Metrology Reporting via Access & ASP 1.0 • Tandem Reporting Via FrontPage based Intranet (CGI) • Learning Management Deferred Revenue Reporting (SQL 2000/ASP Web 3.0) • Data Quality and Business Rule Validation (HRIS:IDM:LMS) using SSIS • Web Portal Reporting system Internal and Commercial sites based on Web Logic / Tea Leaf using SSIS & SSRS BI • Soup to Nuts BI infrastructure implementation. Full Microsoft BI Stack.
  4. Agenda Challenges of developing T-SQL in a team environment. A Scenario Commonly used tools and their benefits Point out development short cuts that can lead to bad habits Open discussion on how different organizations approach the challenge.
  5. Please Mind the Gap Gap or Chasm? Depends on where the T-SQL you’re coding resides. If it is going into production, you are going to make it a stored procedure, aren’t you? What about development that happens before code is folded into a larger project?
  6. Scenario Company initiates a BI effort, albeit with a very limited budget. “Team” consists of one FTE and one contractor. Initial Focus is formalizing reports using SQL Server Reporting Services. No source control. No collaborative development. Approach? Single threaded development.
  7. (Code Examples Two Man Crew) select a.title, a.type, a.price, c.au_fname, c.au_lname from titles a, titleauthor b, authors c where a.title_id = b.title_id and c.au_id=b.au_id order by 3,2,1,5,4 Contractor 1 select t.title, t.type, t.price, a.au_fname, a.au_lname from titles t, titleauthor ta, authors a where t.title_id = ta.title_id and a.au_id=ta.au_id order by t.price, t.type, t.title, a.au_lname, a.au_fname FTE 1
  8. Phase Two Company adds funding for additional full time positions. Company also switches preferred contractors. New team is three FTE and three contractors, one on site, two off shore. Primary development focus is still SSRS, but will also include ETL via Integration Services.
  9. (Coding Styles 2) select select t.title, t.type, t.title as BookTitle t.price, ,t.type as TitleType a.au_fname, ,t.price as TitlePrice a.au_lname ,a.au_lname + ', ' + a.au_fname as from AuthorName titles t from titles as t inner join titleauthor ta on t.title_id = ta.title_id inner join inner join authors a (titleauthor as ta on ta.au_id=a.au_id inner join order by authors as a on ta.au_id=a.au_id t.price, ) on t.title_id = ta.title_id t.type, order by t.price, t.type, t.title, a.au_lname, t.title, a.au_fname a.au_lname, a.au_fname Contractor 2 FTE 2
  10. Common (Bad) Shortcuts ANSI-89 Style Joins Table Aliases (a, b, c or t1,t2,t3) Order by ordinal select a.title, a.type, a.price, c.au_fname, c.au_lname from titles a, titleauthor b, authors c where a.title_id = b.title_id and c.au_id=b.au_id order by 3,2,1,5,4
  11. Tips and Tools Settle on common table aliases, publish and keep them up to date. Decide what format works best for your team. Use a formatting tool.
  12. Demo
  13. Other Tools that Format Toad for SQL Server (Quest). Does a whole lot more than just formatting. http://www.quest.com/toad-for-sql-server/ SQL Pretty Printer. Integrates with SSMS, just does formatting. Desktop version (free trial) or browser based. http://www.dpriver.com/index.php
  14. Links T-SQL Formatting Standards (Coding Standards) – Robert Sheldon Simple Talk http://www.simple-talk.com/sql/t-sql- programming/transact-sql-formatting-standards- (coding-styles)/ Deprecated Database Engine Features in SQL Server 2008 http://msdn.microsoft.com/en- us/library/ms143729.aspx Aaron Bertrand’s Bad Habits to Kick http://sqlblog.com/blogs/aaron_bertrand/archive/tag s/best+practices/default.aspx
  15. www.bayareasql.org To learn more or to inquire about speaking opportunities, please contact: Mark Ginnebaugh, User Group Leader mark@designmind.com

×