Roy Ashbrook

let go or be dragged
posts - 196, comments - 29, trackbacks - 8

July 2007 Entries

404 error or XML Parsing Error: no element found error on IIS with .Net

 A colleague asked me to be a second pair of eyes for a project he was working on that was getting this error. He had just deployed a new .NET web site to a relatively clean IIS6 machine. He was receiving a 404 error in IE when he merely tried to view his asmx pages. When I tried to open them in Firefox, I received an XML Parsing Error: no element found error. After some looking on the web, I didn't find anything that seemed pertinent to our situation. So, I just started looking around. I noticed he had ASP.NET...

posted @ Tuesday, July 31, 2007 12:12 PM | Feedback (0) | Filed Under [ SA ]

alter column dbcc cleantable

 i meant to write a long post about this but i never did. if you have to perform an alter column on a large blob column, sometimes all your space doesn't come back, you may want to issue a dbcc cleantable command on the table. 

posted @ Tuesday, July 24, 2007 12:53 AM | Feedback (0) | Filed Under [ DBA ]

More CLR Internal, Debugging, Etc reading material

I'm done with most of these, but not totally. Tons of great information!   Here are some more great articles that I found doing debugging research. They mostly pertain to debugging and CLR internals type of stuff. CLR Inside Out - Investigating Memory Issues Drill Into .NET Framework Internals to See How the CLR Creates Runtime Objects So, what’s new in the CLR 2.0 GC? Windows Debuggers: Part 1: A WinDbg Tutorial Debug Tutorial Part 1: Beginning Debugging Using CDB and NTSD Debug Tutorial...

posted @ Wednesday, July 18, 2007 7:55 AM | Feedback (0) | Filed Under [ DEV ]

First/Second Chance Exceptions Defined

"A debugger attached to a process can receive two types of notifications for each thrown exception: first and second chance. The debugger gets the first chance to handle the exception. If the debugger allows the execution to continue and does not handle the exception, the application will see the exception as usual. If the application does not handle the exception, the debugger gets a second chance to see the exception. In this case the application would normally crash if the debugger was not present." http://msdn.microsoft.com/msdnmag/issues/05/07/Debugging/

posted @ Wednesday, July 18, 2007 7:11 AM | Feedback (0) | Filed Under [ DEV ]

Electronification of Paper aka EOP

If you use this term, you are a moron. Electronification is a made up word. We already have digital documents. Please, US Financial Industry, stop the madness. The United States already looks retarded enough around the world without you causing anyone else to think we have to create new words because we haven't expanded our vocabulary enough to include digital documents or digitization of paper. Every time I see or hear some executive somewhere use the phrase EOP or Electronification of Paper as if they did not just babble some ridiculous sounding nonsense it makes my stomach turn. If you...

posted @ Wednesday, July 18, 2007 12:48 AM | Feedback (1) | Filed Under [ ARCH ]

Why "SET NOCOUNT ON" Sucks

As I mentioned in a previous post,  David Hayden sat in the front row and gave me an especially hard time about ‘set nocount on’ as a tip. I don’t remember the exact words, so I’m going to have to roughly paraphrase. His complaint was that some data access layers or object relational mapping tools or other data abstraction methods in .NET sometimes utilized the return record count to determine success or failure. Michael Wells (also in the front row) stated that normally he just utilized a try/catch to determine success, or just relying on a thrown error. Typically, I...

posted @ Tuesday, July 17, 2007 6:26 AM | Feedback (0) | Filed Under [ DEV ]

Reflections on Tampa CodeCamp

In retrospect, I probably should have posted a ‘reflection’ on my JaxDUG talk as well. That was my first talk and I believe my first PowerPoint deck ever created. The deck is pretty much the same except I had only a minor amount of notes in the first and a few items weren’t there. The DDLDML slide is the only one I recall that I added. In any case, I want to thank all of the people that came to my talk. I hope it was informative. I received some feedback on it. All of it was pretty positive. I again...

posted @ Tuesday, July 17, 2007 5:52 AM | Feedback (0) | Filed Under [ DBA ]

Tampa Code Camp Slides

You can download the slides I used for my "SQL Tips n' Tricks for Developers" talk at the Tampa Code Camp (7/14/2007) from the following location: http://drowningintechnicaldebt.com/files/folders/royashbrook/entry403.aspx Here's the session description: This session is designed to bridge the gap between DBA and SQL Developers and Application developers by bringing (more or less) common knowledge from the database side of the house to the application side of the house. It should hopefully provide some tips for refactoring opportunities and point out some potential pain points.  

posted @ Monday, July 16, 2007 11:21 PM | Feedback (0) | Filed Under [ DBA ]

how do i alter fill factor on all tables in a database or for a whole server

Recently we had an issue at work where nightly MS SQL Server DB index defrags were taking a long time. Upon looking at the logs it appeared that almost all of the tables were fragmented quite often. It didn't take long to ask if anyone ever modified the fill factor from the default of 0. Nope. If you can't set it in a wider fashion for the whole server due to permissions, controls, politics, solar flares, whatever, here's a script that will set the fill factor to 90 on each table and show the table it's processing. sp_MSforeachtable @command1="print '?' alter...

posted @ Wednesday, July 11, 2007 3:24 AM | Feedback (0) | Filed Under [ DBA ]

use CommandBehavior.CloseConnection even with usings

Recently I put together a SQL talk for developers and gave it at our local JAXDUG meeting. It went over well and one of the items I covered was utilizing CommandBehavior.CloseConnection with the command being used. While the implicit finally created by the using connection below will close the connection, in the interest of "open late close early" you should go ahead and implement this CommandBehavior setting. This will cause the connection to be closed as soon as you exit the reader using enclosure below. If you do not, the connection will remain open until you are out of the...

posted @ Wednesday, July 11, 2007 12:47 AM | Feedback (0) | Filed Under [ DEV ]

re: Testing your code

A colleague of mine asked me to comment on this post. http://blog.madskristensen.dk/post/Testing-your-code.aspx For the duration of my post, I will assume that Mads is a "smart" guy, not a "stupid" guy. =) First, I suppose I should give my views of unit testing. If you are writing business logic code, I think you should write unit tests for it. Always. It's that simple. So, moving on.  I’m very ambivalent about unit testing and always have been for many different reasons. Although testing is very important, I often find unit testing to be a time consuming liability but it depends on the project. When smart...

posted @ Tuesday, July 10, 2007 4:31 PM | Feedback (2) | Filed Under [ DEV ]

Top 10 "Why XML Sucks" Articles

As many of my colleagues know, I am not a really big fan of XML. I think it's bloated. I think it's not needed. I don't think it accomplishes much if anything that couldn't be done before just by sending text delimited in a different way. I'm not sure why if I want to tell someone a yes or a no answer on something being found, I have to wrap it in 1000 characters of SOAP data when i could just send a 0 a 1 or nothing and accomplish the same thing. Or why if I want a list...

posted @ Monday, July 9, 2007 8:53 PM | Feedback (1) | Filed Under [ ARCH ]

Nulls to Codd to Fabian Pascal!

Recently, I was looking for some articles on treatment of nulls in databases. This was a surfing thread that actually originated as my attempt to find some already done benchmarks on coalesce(col,'') != '' vs. col is not null for performance purposes. I had already found some positive match ideas for finding things that weren't null. In fact, I don't remember the original context for this particular search anymore, but I know that's what I was looking for. In any case, that led me to this answers page: http://www.answers.com/topic/null-sql This enlightened me on some issues I wasn’t aware of. For instance, my...

posted @ Monday, July 9, 2007 8:33 PM | Feedback (0) | Filed Under [ ARCH DBA ]

Top 10 Fabian Pascal Articles/Pages/Responses

I'm a big fan of Fabian Pascal. Here are 10 Articles/Pages/Responses that I like the best. =P You can find tons more from these though. They are almost all pure gold. =) On Grinding Water: Reply to St. Laurent NO THEORY, NO RELATIONAL, NO THINKING On Incompetence ON CALLING A SPADE A SPADE: REPLY TO CALLAHAN The Data Exchange Tail - Part 1 ON TRADE MEDIA'S "BALANCE": ANOTHER ONE BITES THE DUST If You Liked SQL,You'll Love XQUERY ...

posted @ Monday, July 9, 2007 8:19 PM | Feedback (0) | Filed Under [ DBA ]

re: Imprisoning Mort

this is in response to http://ayende.com/Blog/archive/2007/06/20/Imprisoning-Mort.aspx does this mean that I am bound to write unmaintainable [sic] code and should be locked down to a very small set of "safe" choices, which were chosen for me by those Above Me ? In my experience, those often placed above me are _not_ there because they are smarter or better. I rarely see that they make the best choices for what is "safe" code. I would say I rarely see choices that just plain don't suck. Why would you hire someone to write completely disposable code? If you have no faith in their ability, why...

posted @ Monday, July 9, 2007 8:05 PM | Feedback (0) | Filed Under [ DEV ]

Top 10 Articles on Storing XML BLOB data in SQL2005, maybe using compression, sqlclr or encryption =)

SERIOUSLY too long of an article name, but hey, it covers a large amount of stuff. I basically had some large XML blobs (wordml docs) I needed to store in SQL and I wanted to store them as compressed BLOBs to save space. These are the articles I found most useful at the time when I was working on that.   Using CLR integration to compress BLOBs/CLOBs in SQL Server 2005 CLR Stored Procedures Passing a DataSet to a SQLCLR Stored Procedure Storing Binary Files Directly in the Database...

posted @ Sunday, July 8, 2007 11:10 PM | Feedback (0) | Filed Under [ DBA ]

simple web service

using System; using System.Data; using System.Data.SqlClient; using System.Web.Services; namespace IamSimple.Service.WebServices {     [WebService(Namespace = "http://royashbrook.com/ns")]     [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]     public class simple : System.Web.Services.WebService     {         [WebMethod(Description = "Return a query as a dataset")]         public DataSet QueryAsDataSet(string q)         {             string cs = "connection string"             using (SqlConnection c = new SqlConnection(cs))                 using (SqlCommand cm = new SqlCommand(q, c))                     using (SqlDataAdapter da = new SqlDataAdapter(cm))                         using (DataSet ds = new DataSet())                         {                             ds.RemotingFormat = SerializationFormat.Binary;                             c.Open();                             da.Fill(ds);                             c.Close();                             return ds;                         }     } }

posted @ Wednesday, July 4, 2007 12:50 AM | Feedback (0) | Filed Under [ DEV ]

Quote of the Day

"The real writing is in the re-writing." -chris rock   It's been said before, but I heard him say it. =P 

posted @ Tuesday, July 3, 2007 6:21 PM | Feedback (0) |

Odds and Ends

Stuff I've been intending to post a meaningful post about, but haven't: If you have ever wondered what ildasm is all about, here's a great link. http://msdn.microsoft.com/msdnmag/issues/01/05/bugslayer/ Simple SQLCLR stored Proc deployment Walthrough: http://blogs.msdn.com/vsdata/archive/2004/12/14/300216.aspx Three sweet articles about Threads, System.Threading.Thread, and !threads (sos.dll) http://blogs.msdn.com/yunjin/archive/2005/08/25/456355.aspx http://blogs.msdn.com/yunjin/archive/2005/08/29/457150.aspx http://blogs.msdn.com/yunjin/archive/2005/08/30/457756.aspx A couple of sites that led me to err.exe http://blogs.technet.com/brad_rutkowski/archive/2007/03/29/the-case-of-sidebar-exe-not-starting-oh-snap.aspx http://blogs.technet.com/brad_rutkowski/archive/2006/09/18/to-err-is-admin.aspx some unit testing stuff i wanted to read http://www.codeproject.com/cs/database/UnitTestDbAppsWithNDbUnit.asp http://msdn.microsoft.com/msdnmag/issues/05/03/TestRun/ http://msdn.microsoft.com/msdnmag/issues/06/01/UnitTesting/ and, finally, a great article on troubleshooting memory management issues with .net http://msdn.microsoft.com/msdnmag/issues/06/11/CLRInsideOut/   I'm tagging this post with 'tips' if for nothing else than err.exe =) 

posted @ Sunday, July 1, 2007 2:13 AM | Feedback (0) | Filed Under [ DEV ]

Powered by: