CREATE PROCEDURE dbo.exec_example ( @parameter VARCHAR(10) = 'employee', @ID INT = 10 ) AS SET NOCOUNT ON; DECLARE @sp_name NVARCHAR(100); IF @parameter = 'employee' BEGIN SET @sp_name = 'dbo.uspGetEmployeeManagers' END ELSE BEGIN SET @sp_name = 'dbo.uspGetManagerEmployees' END; EXEC @sp_name @id; RETURN;
@ module_name_var Is the name of a locally defined variable that represents a module name.
E. Using EXECUTE with a stored procedure variableThe following example creates a variable that represents a stored procedure name. DECLARE @proc_name varchar(30); SET @proc_name = 'sys.sp_who'; EXEC @proc_name;
DECLARE @proc_name varchar(30); SET @proc_name = 'sys.sp_who'; EXEC @proc_name;
I had the privilege to attend and speak at SQLSaturday 32 – Tampa this past weekend. As I said in my event announcement, SQLSaturday is always a good time, and this one was no different. My wife (yes, I brought my wife and she enjoyed herself, too) and I left Sanford about 1:30 Friday afternoon so we could beat the traffic and arrived in Tampa a little before 4:00 pm. Our biggest problem on the way was that there was construction near the hotel so we had to drive around a little to find the hotel parking garage.
Friday
Once we got checked in we enjoyed a nice stroll around the historic Ybor City area where we ran into Aaron Nelson (@SQLVariant) and his dad, and the Pragmatic Works crew, Adam Jorgensen (@adam_jorgensen), Brian Knight (@brianknight), Patrick Leblanc (@patrickdba), and Jeremy from Boston (can’t remember his last name). Then we made our way to The Spaghetti Warehouse for dinner and the speaker/volunteer get together. This was our second mistake as all the other SQLSaturday’s I’ve spoken at have provided only appetizers so that’s what I thought would be provided so we ate dinner BEFORE the party and then found out that dinner WAS provided. We still had a good time as I got to know Kevin Boles better and then met Troy Gallant (@GratefulDBA) and David Taylor (@dyfhid) for the first time. The speaker/volunteer party is ALWAYS a good time as you meet new people and get back together with all the regular gang.
Saturday
My wife and I arrived at the event location on Saturday morning about 8:15, assuming that would give us time to check-in and then I could find my room and get set-up for my 9:00 session. Well, it didn’t quite work out that way. There was a glitch that slowed check-in so I skipped check-in and went right to my room to get set-up. My biggest fear when speaking is that something technical is going to go wrong like not getting the projector to work, so I always get into the room as soon as I can. I was glad that I did as I did have trouble getting the projector working, but I finally found a “cheat sheet” in the podium drawer and go everything working.
The check-in problems delayed the start of the first session, so I didn’t get started until between 9:10 and 9:15. That little delay gave me some time to socialize with the early arrivers and find out that most were at their first SQLSaturday and did not attend a user group. So I was able to encourage them to make an effort to attend their local user group and extol the virtues of user groups. During the presentation I was also able to promote PASS and the PASS Summit.
The Presentation
My presentation was titles, “Why I Use Stored Procedures”, and I billed it a an open discussion, but, unfortunately, I still ended up doing most of the talking as I didn’t have anyone in the room who strongly held the opposite opinion. My main points were that stored procedures offer benefits in the areas of:
I ended the session by demoing some of the different ways to access a database using .NET. I had a simple windows form application with a textbox and 5 buttons, each of which used a different method to to query the database. I used:
During the demo I had Profiler running to show the SQL that was submitted using each method. I traced the following events:
I wanted the attendees to see the following things:
Turnout for the session was good as the room was basically full which was nice considering the other sessions going on and the delay at the check-in table.
Overall the session went well and the attendees seemed to have enjoyed the session and learned something. The biggest mistake I made was that I forgot to put my contact information in my slide deck. The positive side of that is that several people came to get my business cards and I think that was partly due to my forgetting to put the contact information in the deck.
All materials are available on the SQLSaturday site here.
Day Summary
I then attended a three sessions, Dmitri Korotkevitch’s “Getting familiar with SQL Server Storage Engine”, Geoff Hiten's “Clustering for Mere Mortals” (a great session since I don't have clustering experience), and Jonathan Kehayias’ “Real Time Problem Identification with Event Notifications” (another great session). Then it was time to head out as we needed to get home to Sanford to pick up our kids.
As usual Pam Shaw (@pamshaw), Jorge Segarra (@sqlchicken), and volunteers deserve kudos for putting on a great event. There are always a few glitches like at check-in, but those really don’t put a damper on the event at all.
Just a reminder that SQLSaturday #32 – Tampa is taking place this weekend (January 23rd). This will be my 5th SQLSaturday and 4th as a speaker and every one has been a great event. As a matter of fact, I enjoy SQLSaturday’s so much that I’m bringing my non-technical wife to this one with me. You can still register here and see the schedule here.
I’ll be speaking at my 3rd SQLSaturday and my session is:
With the proliferation of ORM Tools like Linq To SQL, NHibernate, there has been a move to no longer use stored procedures for Data Access, I personally disagree. This will be a professional and polite open discussion starting with why I believe stored procedures are the best way to access data in SQL Server. Alternate view points welcome.
I’ll be sharing my views on why I believe stored procedures are better for security, performance, and maintenance. I really do hope that there will be attendees who will share their views and experiences in a professional manner. I have to agree with Paul Randal(@PaulRandal) who said on twitter the other day:
Credibility = being happy to admit it when you're wrong or don't know
Which reminds me of this verse:
A good reputation and respect are worth much more than silver and gold. (Proverbs 22:1 CEV)
So far I’ve done okay in maintaining my credibility and, I think, respect and I plan on continuing that at this event as well.
Paul Randal started the latest community chain blog, What three events brought you here?, and I was tagged by Steve Jones (@way0utwest), his post, and Brian Kelley (@kbriankelley), his post.
I could go a couple of different directions with this:
I think for this post I’ll go with #2 because I sort of covered #1 in this post which I wrote just before Paul started the chain.
I got started in tech because my best friend (Greg Corrigan) from high school and through college was (still is) as programmer and was also the software development manager at the local pulp & paper company. He did some consulting work on the side that I helped out with as mainly a hardware grunt, but I also did some network setup and a bit of Microsoft Access programming with him. During this time he had 2 Software Developer positions open and, for about 6 months, he kept asking me to apply, but I kept refusing because I didn’t feel qualified and I didn’t want to take advantage of our friendship. This was in 1999 before the dot com bubble burst so to get experienced developers or even computer science graduates to move to northern NH (here’s where it is) was pretty much impossible. My friend believed in me and I finally had (another) blow up with my boss and decided I’d apply. I interviewed with Greg and the other developer on staff (Ernie Miner) and then with the Greg’s boss, the Controller. I was hired, basically as an apprentice and I started out writing reports using Access as a front end and rather quickly moved to SQL Server development and I found I had an aptitude for working with data and that I could “think in sets” so I stayed with SQL Server, while still doing some VB and then VB.NET development. My friend, Greg, was and still is a great teacher and he really provided a good foundation. I still wish I had a better grasp of theory, but I’ve been getting the job done for 10 years.
The pulp and paper industry in the United States is, sadly, a dying industry. While I was in the industry it seemed another mill was closing every month, and it finally happened to us. About 20 months, late summer 2001, after I was hired the facility I worked at closed it’s doors as the parent company filed for bankruptcy. It turns out I worked for crooks, I call that company a mini-Enron. They were borrowing against inventory that, in some cases, we didn’t even have. The owner of that company is now in prison. Anyway, this was AFTER the bubble burst so I spent 9 months looking in vain for work as a developer (didn’t know I was or wanted to be a DBA), when our facility was purchased out of bankruptcy and I was one of the lucky few to be brought back, the only problem was that in that company’s opinion, “I.T. is a necessary evil that brings no value to the company.” so we were a bit hamstrung in what we could do, but I was happy to have a job. About a year later I arrived at work one Monday to find out that there was a round of unexpected layoffs (the expected ones had happened a few months earlier). At that point every salaried employee decided it was time to look for another job, including me.
My wife and I had discussed becoming missionaries with New Tribes right after we had married, but decided to wait a year or two which turned into ten. Based on that early discussion I decided to check out the New Tribe web site as part of my “job” search. I clicked on “Go” and “Careers” and saw a posting for 2 Database developers in Sanford. FL. I applied on-line and then called my wife to tell her what I had done. This was in February 2004 and we were “hired” in May that year. After about 2 1/2 years of travelling around New England visiting churches doing what New Tribes calls Partnership Development (we had to go out and fund raise our salary. People of like faith pledge to donate money to the NTM for us so we can help spread the Gospel of Christ), other missions call it deputation. We finally made the move in June 2007. I started out with NTM learning the existing system in Visual FoxPro and doing some work with that, then I began working with one of the other developers on re-writing our personnel system using SQL Server and ASP.NET (C#). I also eventually inherited a financial system that was running on a SQL Server in the Finance office on a PC AFTER it had crashed and needed to be recovered. That recovery has been by biggest success to date with NTM.
The move to Florida also got me involved in the SQL Server community. Prior to the move the most involved I had been was lurking and occasionally posting to the SQLServerCentral forums. Now I have written articles, done videos, blogged, presented at user groups and SQLSaturday’s, and, recently, become a leader in my local user group (OPASS).
So that’s how I got where I am in 3 parts, even though there are a lot of other things that happened along the way.
I’m going to tag:
Well, on January 12th OPASS moved into the present by broadcasting our meeting over the internet using Live Meeting. Our main speaker, the incomparable Andy Leonard (@AndyLeonard), was presenting to us from somewhere outside Richmond, Virginia and we had attendees from the Europe to California.
Since OPASS was started by Andy Warren (@sqlandy) we have been meeting six times a year, basically every other month, which makes finding speakers easier and means we don’t need to raise as much money, but, it also means that we have had trouble becoming a “habit” for attendees. We did a survey and the majority said that they would like to meet monthly and that it would make them more likely to attend regularly, so we decided we’d move to monthly meetings for 2010. Another part of the survey asked about bringing in speakers via Live Meeting so we could expand the reach of our speakers, to which we had a very positive response. Live Meeting was the technology chosen because the chapter can get a free account through PASS. As I type this I’m also watching/listening to Oregon SQL Developers Group over UStream, so there are other methods as well.
Our, really Andy’s, main concern was that having a remote presenter would make it feel like a webinar instead of a social user group meeting. Our other concern was that people would join on-line instead of coming to the meeting in-person.
OPASS is fortunate that we meet at the SQLShare offices so we have good internet access and plenty of PC’s to work with. Our setup took three PC’s, although I think we can get it down to two.
We wanted to combine PC’s 1 and 2, but we had trouble getting the mic to work on PC 1 and also the webcam would not share over Live Meeting from PC 1. We wanted to broadcast video of the group to the speaker so that the speaker could get visual feedback while presenting. The lack of live feedback was one of the most difficult things for me when I did a SQLLunch, so we hope that this will help the speaker.
Well, I mentioned out technical problems with the local mic and the webcam. I forgot to click record as I was involved in trying to solve the minor video and audio issues right up until we started, along with trying to greet people. We forgot to turn off the screen saver on the PC connected to the projector so we lost the presentation a couple of times.
As with anything else, the more we do it the better we will get.
All the local attendees thought it went well and that it worked great. Our concern about reduced physical attendance was unfounded as we had our usual attendance of about 20 plus about 10 on-line attendees. The physical attendees all said that being there in person was a much better experience than attending on-line so that was encouraging. I felt like having 2-way audio really made the meeting better as the only Live Meeting’s I have attended have only had 1-way audio and that isn’t ideal. The 2-way audio was another of Andy’s ideas. We haven’t gotten any negative feedback from our on-line attendees so that seems to have gone well also.
Definitely! We are planning on broadcasting all our meetings using Live Meeting and we are looking for our a remote speaker for our April 13th meeting. So if you are a interested and available let me know and we’ll see if we can work something out.
So, all you folks who have been doing Live Meeting, how have you been doing it? Have you done 2-way audio and video and how has it worked? Any comments or suggestions? We are always looking for ways to do things better.
In the the couple of years I have been involved in the SQL Server community I have noticed that there is an issue with third-party product driven sessions or sponsor sessions at events. The argument I usually hear against these sessions is that organizers are concerned about the event becoming viewed as a marketing event. I’ve even had a short email discussion with Grant Fritchey (@GFritchey) about how it would be nice if he did a session on database source and version control based on a post he made in this SQLServerCentral thread. His response to my suggestion was:
…but I need to do it without using any particular vendor’s products… not easy…
and
…lots of organizations and people won’t accept presentations when they include third party products. It’s too much like a sales pitch…
Steve Jones (@way0utwest), also, had an editorial poll last Friday (1/8/2010), Balancing the Message, that dovetails nicely with this post, where he asks:
Think about the value that you've gotten from third party products. Think about the problems you've solved, or the help you've gotten from a backup tool, an editor, or a performance product. How would you like to learn about enhancements. What's a high impact, low interruption way of communicating with you?
I’d like to present 2 reasons why I think third-party product driven and/or vendor sessions should be acceptable at events:
I have to admit that reason 1 carries more weight with me as an attendee/organizer than reason 2. I’d especially be interested in sessions submitted and presented by users of a third-party product than by the vendor as it would be less likely to be a sales session. I have to admit, that, as a member of OPASS leadership, I’d be unlikely to have a vendor session at a user group meeting, but at a SQLSaturday, I’d happily have a 2 or 3 vendor sessions, as I believe any marketing backlash would easily be offset by the 20 or more non-vendor session.
So what do you think? Would you be turned off to SQLSaturday or other community event if there were vendor sessions or sessions based on third-party products?
I didn’t have a chance to blog this yesterday (January 11, 2010), but my most recent video, Dynamic SQL Using sp_executesql, was featured on SQLShare yesterday.
It was great as it generated several comments and I was able to take the time to answer them this morning. I love it when there is feedback on something I’ve done.
Tonight is the January meeting for OPASS and we have a great schedule for the evening.
Robert Hurwitz a developer for the Florida K-12 online public schools will be doing a mini-presentation on Automating Index Maintenance from 6:15 to 6:30 and out main presentation will be by Andy Leonard (@AndyLeonard) via Live Meeting on Incremental Loads in SSIS from 6:45-8:00.
Both presentations will be part of the Live Meeting broadcast, but we hope that you local people will come in person to support Robert and to take advantage of the networking opportunities. You can attend the Live Meeting using this link the event id and password are included in the link so you should have no problems getting in.
Pleas visit the OPASS web site for directions and more details.
See you tonight!
My gauge of an amazing book is simple: if I’ve got a question, and I reach for the book BEFORE I search the web, then it’s an amazing book. Several times in the last two weeks, I reached for this book first.