SQLLawman

Family man and SQL Geek

Find the Windows Server Name

By MichaelDeputy, 1 year and 6 months ago

I was working with SQL2000 on a windows cluster.  I needed to write the results of a query to a test file on the local drive.  I was using @@servername to get the server name to write the file.  Unfortunately that appends the instance name and gave me a problem.  So I went looking for how to remove the instance name and I found a pretty neat trick.

Keep reading →

SuperStart

By MichaelDeputy, 1 year and 6 months ago

Today was the end of an excellent conference for 4th, 5th, & 6th graders.  SuperStart is a production of CIY.  If you have a child in that age group and you have the opportunity to go, it is so worth your time.   If your church is hosting the conference it is a total blast to volunteer.  Our day started at 6:30 am at Meijer to pick up 66 dozen donuts, yes, that is 792 donuts to pump into kids to get the day started.   Believe it or not, all the donuts actually made it to the church.  There were over 1300 kids and leaders preregistered for the conference.   Then we helped get the breakfast line setup, then it was off to fun.  My wife and I ran the «arcade» room.  That consisted of 7 Wiis and a Xbox360.  All of these were connected to projectors and projected up on the walls.    Our job was to let the kids have fun.  With that hardware, failure was not an option.  We rotated every 4 to 5 minutes to get everyone a chance to play.  There was also three inflatable obstacle courses.  I snuck in there and raced our middle school pastor through one of the courses.  He won.  But I'm sure I get a re-match in the future.  Then the kids went onto the program.  It had incredible praise and worship by Yancy and a three session program focusing on being friends all wrapped around a competition by two illusionists to see who was best.  The kids voted by means of a decibel meter.  112 db of screaming pre-teens was the winning score.  It was incredible.  The CIY team were awesome people, very organized, very competent, and connected instantly with the kids.  I would never spoil the outcome, but these illusionists were quite good.  I really enjoyed their competition.  One of the parts of the day is called plug and play.  During this time, our church rented out a local skating rink and we all went skating.  We had a great time and my kids are getting better at skating.  In conclusion,  SuperStart was excellent and my kids can't wait for next year.  So if you have kids that age and have the opportunity, it is well worth the small fee (less than $50.00 for the conference)

Keep reading →

Update: Degrees of Parallelism

By MichaelDeputy, 1 year and 6 months ago

Well, it's been 10 days since I started to play with parallelism on this server.  I have gotten the self blocking to stop.  My CPU utilization has stabalized and my phone is not ringing.  So I think that the issues is mitigated.  I finally settled on Max Degrees of Parallelism of 2 and the Cost Threshold for Parallelism of 500.  I also have the developers looking at the code to ensure all their joins are nolock, they tell me they should be, but I am asking nicely to them to verify.  So I'm moving on to other issues unless this one pops back up.

Keep reading →

Things You Know Now

By MichaelDeputy, 1 year and 6 months ago

Denny Cherry tagged me in a blog thread with a question asking «What do you wish you knew when you started?».  So here you go.  As you know I am still relatively new to the SQL profession so I'm still figuring out what I don't know.  I seem to find several every day, so I'm going to step back to my IT career in general.  I think some will continue to ring true.

Keep reading →

Starting up database 'SomeDbName'

By MichaelDeputy, 1 year and 6 months ago

Keep reading →

Degrees of Parallelism

By MichaelDeputy, 1 year and 6 months ago

If you are expecting a deep, well researched, thorough explanation of degrees of parallelism and cost threshold for parallelism you have come to the wrong place.  I'm sorry.  Hit the back button and choose a different link.  O.K., now that I'm alone again, I can get into my issue.  I have a vendor application, which will remain nameless, that is having some problems.  I have noticed by watching activity monitor that this database really chews up CPU.  When this app is quiet, I see CPU in the teens.  When it starts running I see 50% with 70% spikes.  But what has caught my eye, using SSMS 2008, is how much this app self blocks.  I don't know if that is a real term, but I like it.  What I am talking about is one SPID that spawns several threads with the same SPID and those threads start blocking other threads on the same SPID.  As soon as I start seeing this I see CPU start climbing.  I also see waiting process start to grow.  It doesn't take too long until I hear my phone ring.  The vendor has told me I can kill off these processes without harming the application.  So I'll kill a few of them and get CPU back down to 30% - 40% and everyone is happy.  So I start wondering.  If I can decrease the number of threads that run at one time, maybe I can decrease the blocking and resolve this issue.  I read a post of someone who changed max degrees of parallelism from 0 to 1 and his problem went away.  That made perfect since to me: every process can have one CPU at a time.  But that also bothered me.  Microsoft put parallelism into the product because it helps with performance.  Turning it off can't possibly make things faster.  There has to be a balance.  Increase the threshold, lower the number of processors there has to be a sweat spot.  But how to measure it.  That is my problem.  HMMM......  There must be a objective way to measure the application speed and make changes, watch the CPU, and the application speed.

Keep reading →