SSSOLV: Twitter Compliant

Comments: No Comments
Published on: August 24, 2010

This is just a short blast about the Las Vegas User Group called SSSOLV (Web | Twitter).  I am not certain why it took so long for us to do this, but we have finally got the UG on a twitter account.  We plan to use this medium to help blast UG news.

SSSOLV is now @S3OLV

Sp_whoAmI

Comments: No Comments
Published on: August 24, 2010

I was doing a little catching up on some blog reading today and came across a new post from Adam Machanic (Blog | Twitter).  The post is titled Who Are You and is asking for input from the readers.  Quite frankly, I think it is a great idea.  Adam is asking for people to do a little stand up and tell everybody a thing or two about themselves.  He wanted that info left in the comments, but I thought it would be better to write a post on the topic and link back to it.

First things first.  Why is this a good idea?  Well, it helps to know the readers as Adam said.  There truly is a nice bit of satisfaction when somebody leaves a comment on your blog.  It is even better when you feel like you know that person.  Better yet is to know that there are people you know that are reading your blog – whether or not they comment.  There are plenty of people (judging from the comments) that Adam knows and that read his blog but may not leave a lot of comments.  It is also really helpful to know the interests of the readers and try to put out some stuff that may be of interest to them.  I see this being of particular help when there is a little writers block.

What about me?

My name is Jason Brimhall and I have been doing database stuff for a little over 10 years.  My current title at my employer is Database Architect.  I am more than a database architect – I get to wear many hats.  I get to do the Architect stuff, administrator stuff, warehouse stuff, and occasionally I get to write a stored proc or two.  I have been blogging now for just about 9 months.  I have administered 4500+ servers as well as 1TB+ databases.  I have worked on SQL 6.5 – SQL 2008 as well as a spattering of Oracle and MySQL (don’t quiz me on those).  I live in Las Vegas and am the Vice President of the local Users Group (Web | Twitter ) (which reminds me that I need to get that UG twitter account notice out).  Outside of work, I like to spend time with my children as well as play basketball and run.

Edit:  I forgot to tell you what my twitter handle is…@sqlrnnr

Defensive Db Programming Chapter 05

Comments: No Comments
Published on: August 24, 2010

We are here again after another week and ready for another episode in this series.  Today we get to talk about chapter 5 in the book by Alex Kuznetsov (Blog).  You can find more on this series by looking here.

The title of the chapter this week is “Reusing T-SQL Code.”  In this chapter, Alex covers the topics of:

  • copy and paste code
  • proper code reuse
  • View use to encapsulate simple queries
  • UDFs and parameterized queries
  • Performance issues with UDFs
  • Business logic through filtered indexes, triggers and constraints

I am going to skip the discussion on copy and paste of code and the potential problems related to that.  I think that should be highly obvious.  I think code reuse should also bring up some obvious ideas of why to do it and how it can make your code better.  Simple queries in views is also pretty straight forward.  For these first three topics, check out what Alex has to say about them in his book.

UDFs and parameterized queries

When it comes to code reuse, it is typically easier to to reuse parameterized queries through an inline UDF.  That’s not to say that it cannot or should not be done through a stored procedure.  For many scenarios and requirements, it would be easier to do a parameterized query through a function.  Alex gives examples of some of the limitations such as sorting, Insert/Exec, and nesting.  There are of course limitations that should be considered with inline UDFs.  Alex has those listed in his book.

Performance issues with UDFs

Alex makes a very good point in this section.  When trying to reuse code, we have to pay attention to performance.  Poorly written UDFs could have serious impacts on the performance of the code and that should be a great concern.  To demonstrate this, Alex has listed out an example covering the bases.  Check out his code samples and test it.

There is also another great statement in this section.

Blanket statements do not belong in database programming.

Keep that in mind.  It is very difficult to make a blanket statement and have it apply in all cases.

The final section is covering the topic of when to use Filtered Indexes, Constraints, triggers and stored procedures.  Proper use of each of these can help to enforce business logic.  It should be noted that the use of these will depend on requirements and database design.

Having a single source of the code will help to prevent unexpected bugs.  It will also help to save time on development and documentation.

page 1 of 1








Calendar
August 2010
M T W T F S S
« Jul   Sep »
 1
2345678
9101112131415
16171819202122
23242526272829
3031  
Content
SQLHelp

SQLHelp


Welcome , today is Friday, September 22, 2017