When I first installed SQL Server 2008 in my environment one of the first things I did was open up VS.NET 2005 and start messing around with connectivity to the instance. That failed miserably. Errors were abound! All hope is not lost though… The last thing I want to do is install side by side versions of VS.NET. The IDE is heavy and sucks the life out of any developer machine. I’m sure I’m not the only one that does not want to think about what version I’m clicking
This is an archive of the posts published to LessThanDot from 2008 to 2018, over a decade of useful content. While we're no longer adding new content, we still receive a lot of visitors and wanted to make sure the content didn't disappear forever.
Yesterday I wrote the SQL Server Quiz, Can You Answer All These? post and asked 10 question. Today I will give you the answes 1) Name three differences between primary keys and unique constraints A primary key cannot have any null values and a unique constraint can have one null value A primary key is by default clustered and a unique constraint is not A table can only have one primary key but can have more than one unique constraint
Altering SQL Agent jobs during job runtime can give you some options as to how you can force other jobs to react based on events. There are a listing of system procedures in the MSDB database available for you to use so you can literally alter your entire timelines and schedules based on a failure, success or even OS or network related issues. Here is a basic example of disabling and enabling a job
The help desk manager I often work with on high level issues were talking the other day about a problem she had with a user. The problem the user was having had been her laptop was turning on briefly and then shutting down for no apparent reason. The reason the topic even came up was due to the user throwing a childish tantrum at the help desk manager’s desk about how IT had purposely done something to her laptop. Of course the second it happened everyone was IM’d and we all walked over to hide and listen to the display of unprofessionalism. I have to add the user was another manager. This is how we handle things like that. Basically laugh about it collectively or we all know the stress would be overwhelming. So the problem turned out to be the user had been plugging a space heater into a power strip under her desk. This is the same power strip she plugged her laptop power supply into. The space heater literally fried the power strip thus causing the laptop to not charge. *sigh* Luckily my “in case of complete disaster” planning didn’t have to go into affect due to this moron burning down the building.
Here is a quick SQL Server quiz. Do you know the answer to all of these question? I will give the answers in a blog post tomorrow Name three differences between primary keys and unique constraints If your database is in simple recovery model and you run code that looks like this BULK INSERT Northwind.dbo.[Order Details] FROM 'f:orderslineitem.tbl' WITH ( FIELDTERMINATOR = '|', ROWTERMINATOR = '|n' ) Will this be minimally logged?
Surprisingly not many people know but there is an actual internet archive. Yes they have snapshots through history of the internet. Not many sites get by without having snapshots done when alterations to the sites core structure is found. If you’ve been in web development for awhile or did web development years back I would check it out. It’s fun to remember just how bad some of the sites you built were 🙂
How many times have you done something like this testing speed Declare @cnt_test bigint Declare @st datetime Set @st = getdate() Set @cnt_test = (Select count(*) From dbo.test_scan) Select DateDiff(ms,@st,getdate()) Specifically the DateDiff() in milliseconds to see how long the execution took. There is a nice little option in SSMS that I leave on when working on a query over time. It’s called Client Statistics. When set on you can get the same results and much more that can help you measure your performance while altering your code. The results will show the same as having the show execution plan on in SSMS as a tab in the results window. The results from client statistics will accumulate over the time you alter your query also. This is a very nice option and valuable when measuring your changes without adding code you will only have to remove. It will even give you an arrow showing in red if your execution time has gone up or green pointing down for improving
This is a quick and probably extremely basic trick to get rid of a scan when optimizing your code. Getting a index scan to a index seek can be a great increase in speed. Several places in normal day-to-day coding you will use Count(*), Max(col) etc.. to get data in order to return the required data set. Although this tip will be based on the data you are working on and the tables structure, it can be used several times to remove scans where you possibly were overlooking them.
I decided that I wanted to provide a “live chat” link on my website so I had a look around for what software I could use to do it. There were quite a few good options, but none that were good enough for me and free. So, I had a look into using my MSN account which turned out to be quite easy. First off, you will need to sign in and go to:
Anybody want to make a guess which one of these is internet options? Perhaps it has something to do with Windowblinds I was running. And it was. Such a shame. But pretty funny none the less. Which also seems to solve the last problem I had. Bad, bad windowsblinds.