Alexander The Great

March 13, 2008

SQL Danger

Filed under: Evolution,Programming,Software — alexanderthegreatest @ 3:53 pm
Tags: , , , , , ,

SQL Server supports a cooperative, non-preemptive threading model in which the threads voluntarily yield execution periodically, or when they are waiting on locks or I/O. The CLR supports a preemptive threading model. If user code running inside SQL Server can directly call the operating system threading primitives, then it does not integrate well into the SQL Server task scheduler and can degrade the scalability of the system. The CLR does not distinguish between virtual and physical memory, but SQL Server directly manages physical memory and is required to use physical memory within a configurable limit.

ms-help://MS.SQLCC.v9/MS.SQLSVR.v9.en/denet9/html/d280d359-08f0-47b5-a07e-67dd2a58ad73.htm

If you’re scratching your head, thank your lucky stars you don’t need to understand this gibberish. I’ve been having to focus on SQL Server and .NET Integration, also known as SQL CLR integration. A lot of people have made fairly bad choices in the very, very recent past. Just because you can write your stored procedures now in Visual Basic doesn’t mean you should. Obviously it cuts both ways, and that doesn’t mean you shouldn’t – the trouble seems to come when people can’t decide whether they should or not.

Having to help guide that decision, I found the 1st paragraph above, which has some frightening guidance on the matter. It seems to suggest never to use .NET at first glance, but that isn’t really the case. What it really says is long running code that might interfere with SQL’s thread scheduling can be bad. Code that spawns new threads really shouldn’t be hosted in SQL. PInvoke calls can hurt.

But XML processing is an example of something that does none of those things. And while SQL has good XML support, for some operations, .NET is better. Also the set based nature of SQL compared to the procedural and object oriented nature of C# mean you have better control over caching in .NET, so by porting this type of sproc, you can parse an XML document in memory once, instead of once for every time you need to access it.

After all, it’s not SyBase in 1997!

Advertisements

March 11, 2008

I Can’t Help It – Vista

Filed under: Humor,Modern Life — alexanderthegreatest @ 11:55 am
Tags: , , , , , , , ,

February 2, 2008

Even ASP Ancient Can Do XML With Access

Filed under: Software — alexanderthegreatest @ 9:42 pm
Tags: , , , , , , ,

Access is a baby RDBMS or Relational Database Management System. It runs SQL, stores its data in tables, provides queries (select with projection, DML, even DDL) and has code integration in the sense that VBA (Visual Basic for Applications – embedded, crappy VB Scripting) functions you write can be used in a SQL query.

In all honesty, SQL Server has allowed this forever with UDFs but only recently with the CLR. This is a unique way that Access has lead SQL Server if you simply must write your functions in Visual Basic.

But I digress. The point is that even in absolutely ancient ASP, and with Access the baby brother to SQL Server, you can generate XML. Here’s how.

This is a legacy tip – SQL Server has better support for XML by far, though, without even needing an external language like ASP. And SQL Server is free – Access is not. This defies the conventional wisdom that SQL Server is more expensive than Access (true in web hosting, and true if you buy enterprise versions of SQL Server).

January 22, 2008

People Use XML in PHP?

Filed under: Americana,Science,Software — alexanderthegreatest @ 6:49 pm
Tags: , , ,

What the?  A Euro genius who really should be using the Microsoft .NET Framework wrote Quick XML, a class I’m not able to use because its for PHP.

January 16, 2008

Cell Phones vs (or =?) Computers

Filed under: Cool Site,Modern Life,Web — alexanderthegreatest @ 12:56 pm
Tags: , , , , ,

Matt McDonald has written a fascinating post about not only an unprecedented trend happening today, but also about this trend’s implications. What’s the news? There are cell phones that are more powerful than the average consumer PC or Mac. What are the implications? Read A Race From Both Ends.

Obviously, one thing this leads to is a more connected world. McDonald points to some facts that blow Hillary and Obama’s meteroic rise out of the water

  1. In 2001 about 120 million Americans were using cell phones.
  2. As of late 2007 there was over 250 million.
  3. We’re talking about a country with 300 million people.

I had previously written a post asking similar questions to the ones Matt is posing for his readers. Mine was called MySpaceBook, Killer of Jobs, and discussed both the positive and negative effects that the business section of the Sunday paper talks about. Highly automated software is replacing the concept of a workforce, at least in some areas of the tech and web “industry”. The natural panic is less jobs, but this could mean less work needing to be done, and cheaper (if not free) services. More utopian than dystopian, if you ask me.

Matt comes to similar conclusions. 1,000 years from now, historians will study our times, and call these days the most important since the Agricultural Revolution. We’re going through a peroid of amazing and rapid change. It’s not without its costs, but these will ultimately be worth the benefits to society and to too many individuals to count.

Blog at WordPress.com.