Tuesday, October 04, 2011

Javascript Fiddling

I found a neat web development tool this morning. It's called jsFiddle. It allows you to play with HTML, javascript, and CSS on the fly. It also lets you save your "fiddles" for later. They also give each of your fiddles a unique URL so you can share them. Great for posting on forums and blogs. I'm very excited for this. Check out my very cool and complex fiddle:

http://jsfiddle.net/codyschouten/gSp8M/

Tuesday, September 06, 2011

Linked Server "String data, length mismatch"

So I have a TSQL problem that has been bothering me for a few months now. I have a stored procedure that runs nightly via a SQL scheduled job. It has failed almost everynight since April. The stored procedure is still in test and has been in low priority so I have dabbled with figuring it out. Our DBAs really didn't have a clue what the problem was and I couldn't find an answer through search engines. The annoying part is that I could run it development just fine and it would only sporadically fail in the test environment for me. I finally got tired of it and started pulling the 2900+ lines of SQL. Here's the error that I got:

 OLE DB provider "SQLNCLI" for linked server "MySQLServer01" returned message "String data, length mismatch". 
Msg 7421, Level 16, State 2, Line 1
Cannot fetch the rowset from OLE DB provider "SQLNCLI" for linked server "MySQLServer01". .
So part of problem had to do with the fact that I was trying to join two bits of data from different servers. I had a join that tried to join a VARCHAR(30) field from one SQL Server to a NVARCHAR(MAX) field on another SQL Server. I know that this isn't going to be the fastest of JOINS but it was a requirement. Seems that there is a problem with joining the MAX to something in another server. Once I did a CONVERT(VARCHAR(30) to the VARCHAR(MAX) field, my query completed beautifully.

I'm not sure how I would resolve this issue if I had to really join VARCHAR(MAX) to VARCHAR(MAX), but I guess I'll handle that in the future if that day comes.

Thursday, August 18, 2011

Configuration Error System.Web.Extensions

Keep in mind that it has been a year or two since I've really played with creating and configuring websites via IIS. This is something I've done before but for some reason didn't recognize the error. I created a new website the other day and got a Configuration Error page that indicated that there was a problem with my setup that was not allowing the System.Web.Extensions namespace to load. A quick Google search revealed that I just needed to point the website's ASP.NET version should be 2.0.50727 instead of 1.1.4322.

Found the reminder here:

http://codeproject.wordpress.com/2008/01/17/configuration-error-systemwebconfigurationsystemwebextensionssectiongroup/


Thursday, July 28, 2011

Samsung Galaxy S2

This is the phone I really want:

CNET
PhoneArena

It really makes me happy thinking about it. It's been available since April but not in the U.S. Supposedly it will come out this August just ahead of the next iPhone announcement. A buddy at work bought the European version without contract for a lot of $$$. I can't justify doing that so I have until AT&T releases an American version with contract. I really should get over my tech porn problem.

Does anybody have this phone or seen others with it? Any impressions?

Fall 2011 Utah Code Camp

I'm planning on attending this fall's Utah Code Camp. It will be my first time attending but I have heard great things about it. Best part is that it's free.


http://utahcodecamp.com/

Wednesday, July 13, 2011

Query Trigger

I had a need recently to programattically query the triggers for a set of tables in my database. Here's the code that I used:

 SELECT DISTINCT
Tables.Name TableName
, Triggers.name TriggerName
, Triggers.crdate TriggerCreatedDate
, [Type] = CASE WHEN Triggers.xtype = 'TR' THEN 'SQL Trigger'
ELSE 'CLR Trigger'
END
, [Disabled] = OBJECTPROPERTY(OBJECT_ID(Triggers.name), 'ExecIsTriggerDisabled')
FROM
sysobjects Triggers
INNER JOIN sysobjects Tables
ON Triggers.parent_obj = Tables.id
AND Tables.xtype = 'U'
AND Tables.name = 'eperson'
LEFT JOIN syscomments Comments
ON Triggers.id = Comments.id
WHERE
Triggers.xtype IN ( 'TR', 'TA' )
ORDER BY
Tables.Name
, Triggers.name

Updated the above query to handle CLR triggers and to show if the trigger is disabled.

Regular Expression Editor/Helper

I’ve been using Expresso for a while now. It’s a handy tool for working with regular expressions. It has a library of regular expressions which is very helpful. The editor lets you try your regular expression against a whole bunch of test data so you can test your expression against all sorts of data. The tool has been key in my getting better at regular expressions. The best part is that it’s FREE. That just makes me feel so good.

http://www.ultrapico.com/Expresso.htm

Wow, Two Years

Wow, it's been two years since my last post. I think I've been recovering from my masters degree. I'm now feeling more inclined to get involved with the blog again, if anybody cares. I expect to start posting again. My current job has me doing more and more SQL projects so my posts will be more focused to that. Besides, we're still on .NET 3.5 and really need to get up-to-date on .NET 4.0 before I start posting .NET again. So embarrassing :D