Erik Meijer and Gavin Bierman from Microsoft recently wrote a paper on “A co-Relational Model of Data for Large Shared Data Banks“. They argue that noSQL is really coSQL, and that there is a duality between coSQL and SQL which are simply 2 opposites that coexist in harmony. This is huge, if there is a simple mathematical duality between the 2, then monads and monad comprehensions can provide a common query system which abstracts and simplifies coding for either SQL or noSQL.

It’s a good read, but your brain might melt with some of the mathematics involved.

In this article we present a mathematical data model for the most common noSQL databases—namely, key/value relationships—and demonstrate that this data model is the mathematical dual of SQL’s relational data model of foreign-/primary-key relationships. Following established mathematical nomenclature, we refer to the dual of SQL as coSQL. We also show how a single generalization of the relational algebra over sets—namely, monads and monad comprehensions—forms the basis of a common query language for both SQL and noSQL. Despite common wisdom, SQL and coSQL are not diabolically opposed, but instead deeply connected via beautiful mathematical theory.

Source: A co-Relational Model of Data for Large Shared Data Banks

 

Here’s something I found pretty useful. The situation is I need to insert entries into the database with one of the columns being some random data. If I did a Rand() directly in the statement:

Insert into NewStudy
select studyid,((29 + 1) - 27) * Rand() + 27,null from StudyTable

It will only generate Rand() once and fill in all rows with the same data, which is not what I want.

In order to generate a random number for each row, I have to create a view of the RAND() function:

CREATE VIEW vRandNumber
AS
SELECT RAND() as RandNumber
go
 
Insert into NewStudy
select studyid,((29 + 1) - 27) * (select RandNumber from vRandNumber) + 27,null 
from StudyTable

This works very well. Of course, 29 and 27 are my min and max respectively. I can create a separate function to do the same thing:

CREATE FUNCTION RandNumber(@Min int, @Max int)
RETURNS float
AS
 BEGIN
 RETURN @Min + (select RandNumber from vRandNumber) * ((@Max+1)-@Min)
 END

So instead, I can do RandNumber(27, 29) within the statement.

The problem why I didn’t use this randomization is because of permissions. Elevating a standard user to allow creation of a view is disallowed in my situation.

So this is what I did instead, to keep within the boundaries of the permissions, is to use row_number() instead. Take the mod of row_number by ((@Max + 1) – @Min) which is 3 for my case and add the @Min to it. It’s not random, but deterministic, but it works well enough for my case.

Insert into NewStudy
select studyid, (row_number() over (order by studyid)) % 3 + 27,null
from StudyTable

So that’s it. A deterministic pseudo “random” (not so random it seems) number based on row_number(). I wonder if there are other solutions to this.

 

TechNet National Tour

My “Security” TechNet Tour
How do you build a security strategy, what are some of the common attacks and how can you test your network to see if you are vulnerable, and finally how do you “sell” security to management? Join us at the My TechNet tour where we will take a whole up approach to security from what is required to build a security strategy, to how to sell it to management, and finally go deep with demos on configuring security in your environment.

City Date
Winnipeg October-11-07
St. Johns, NFLD October-16-07
Ottawa October-18-07
Quebec City October-23-07
Montreal October-25-07
Vancouver October-30-07
Calgary November-01-07
Edmonton November-06-07
Regina November-08-07
Toronto November-08-07

Here’s the agenda.

Registration – 9:00 AM (30 Minutes)

Session 1 – 9:30 AM (60 Minutes)

Security is still the number one thing on the minds of IT Professionals according to the voting portion of this tour. Therefore, the first session is going to cover some of the common security mistakes many people are making, what are the possible attacks that may occur against those mistakes (yeah we are going to break things) and how to build an in depth approach to defending against these issues and mitigating the risks.

Session 2 – 10:45 AM (90 Minutes)

Security starts with the core tasks an IT Professional performs. In this session we are going to look back at the security mistakes outlined in the first session and look at how we can resolve those issues. This session covers the technologies available, proper education of your users and IT staff, and concludes with best practices from the field. We will be sure to cover the fundamentals of proper security architecture for your environment.

Lunch – 12:15 PM (45 Minutes)

Session 3 – 1:00 PM (90 Minutes)

Security does not end with a good password policy and proper NTFS (New Technology File System) permissions. One of the most common attack points is your web presence. The application platform is one of the most crucial areas to secure and in this session we will continue our deep dive into security and look at the security best practices for SQL Server, Internet Information Services 6.0, and SharePoint. As more and more Lin of Business applications rely of these technologies it is crucial that they are secure to keep your business running.

Questions and Answers – 2:30 (Until All Your Questions are Answered)

 

This will be the first time I’ll be doing this, and many more to come with subsequent updates. I’ll be sifting out all the new downloads and listing down those that will be of interest to me, and hopefully yourself too.

  • SQL Server 2005 Books Online (May 2007)
    Download an updated version of the documentation and tutorials for Microsoft SQL Server 2005.
  • Visual Studio Code Name “Orcas” SDK – June 2007 CTP
    This CTP includes tools, documentation, and samples for developers to write, build, test, and deploy extensions for Visual Studio code name “Orcas.”
  • Microsoft Code Name “Acropolis” CTP 1
    Microsoft code name “Acropolis” is a set of components and tools intended to make it easier for developers to build and manage modular, business focused, client applications for Microsoft Windows on the .NET Framework.
  • DirectX SDK (June 2007)
    Download the complete DirectX SDK, which contains the all the software required to create DirectX compliant applications in C/C++ and C#.
  • Exchange Best Practices Analyzer v2.8
    The Microsoft Exchange Best Practices Analyzer is designed for administrators who want to determine the overall health of their Exchange servers and topology. The tool scans Exchange servers and identifies items that do not conform to Microsoft best practices.
  • Exchange Load Generator (32 bit)
    Exchange Load Generator is a simulation tool to measure the impact of MAPI clients on Exchange servers.
  • Exchange Load Generator (64 bit)
    Exchange Load Generator is a simulation tool to measure the impact of MAPI clients on Exchange servers.

Alright. Now the featured download for this week is…

Microsoft Code Name “Acropolis” CTP 1

I’ll be looking into this new Client Application Framework (CAF) during the next few days to give you the low-down on what exactly it is. From the description, it seems to be a set of components and tools to help developers create windows client applications. Here are some resources with more information on “Acropolis”.

Apparently, they just announced this at TechEd 2007.

From a few discussions I’ve read so far about “Acropolis”, it is meant to replace Microsoft Composite UI Application Block (CAB) and Smart Client Software Factory (SCSF), taking the lessons learnt and good stuff with both of them to combine what we know as “Acropolis”.

Well, more about “Acropolis” CAF in a few days time.

 

A friend of mine was telling about creating a commercial Content Management System is a good way to go. Then I was asking myself, why would I want to pay for a CMS which is so expensive, when I can get a CMS which costs $0, has online support, and many resources on how to set the system up.

One of them is the Mambo CMS created using PHP and MySQL which all runs on Apache. Here’s a recent review on it.

Open source Mambo CMS succeeds admirably

All these are free. Another one of them is the DotNetNuke created using Visual Basic.NET and runs on IIS which isn’t much of a CMS but there are modules to convert it into a CMS which can also interface with MySQL. The same goes with PHPNuke.

Just do a google search for “Content Management System Opensource” and you’ll get back so many results. So now I ask you, why should I spend time creating my own, and selling it? One way to make money from CMS would be to take one of these Opensource free CMS, and provide the service of customising it for the client. It’s much faster, reduces cost, and it’s already easy and ready to use.

Now I want your opinion on this.

What’s the rationale for creating your own CMS? Even if the rationale is that CMS is meant for big enterprise-level businesses, and most SME aren’t really taking for it, as previously mentioned, there is the niche market there to push into. But why would I want to spend time creating a CMS from scratch, then customising it, then selling it?

And why should I as a businessman want to buy the CMS from Microsoft when it’s so complicated, difficult to setup, and most of all, EXPENSIVE? Integration is one thing, but that’s all I can see as the advantage, which I don’t quite need really for CMS.

Comments please. :)

 

Finished! Completed 1 project. Feeling good. 5 more to go. UGH!

Anyway, here’s something to tingle your senses. I’m sure everyone needs to use a database somehow or another during their development, and not everyone has SQL Server 2000 installed. One way would be to use Access, but that’s too slow. Another way would be to use MSDE. Here’s a good article as how to create your application installation to include and setup MSDE 2000 for your application.

The MSDE Deployment Toolkit (RC) in Action

Enjoy!

Next up I’ll talk about Paladin, if I can remember anything to write about.

 

Professional C#, 2nd Edition: Graphics with GDI+
The sample book chapter shows you how to interact directly with users in C#, displaying information on the screen and accepting user input. You’ll draw lines and simple shapes, images from bitmap and other image files, and text.
By Scott Allen, Ollie Cornes, Steve Danielson, Jay Glynn, Zach Greenvoss, Burton Harvey, Jerod Moemeka, Christian Nagel, Simon Robinson, Morgan Skinner, and Karli Watson

http://accessvbsql.advisor.com/doc/13649

 

Some of you guys might be having trouble installing VSTS aka Visual Studio Team Suite (which is the new name for Visual Studio 2005) and come across this problem as described here.

Problems installing VSTS 2005 Dec. 2004 Refresh

Well, the problem I had was a conflict with the .NET Framework 2.0, with SQL Server 2005 Dec 2005 CTP being installed first. And what is the solution for this?

Uninstall your .NET Framework 2.0, install the VSTS (which now installs), then repair SQL Server 2005. This is how you get it working.

I do not know if you’ll have any problems install SQL Server 2005 after installing VSTS 2005. :) Anyone tried and have problems?

 


Fook Hwei on SQL Server CE Posted by Hello

© 2009 - 2011 JustinLee.sg Suffusion theme by Sayontan Sinha
Stop SOPA!

SOPA breaks our internet freedom!
Any site can be shut down whether or not we've done anything wrong.

Stop SOPA!