September 2005 - Posts

Database mirroring in SQL Server 2005 will be turned off for the RTM.

One of the things we learned is that we believe our Database Mirroring feature needs more time in the hands of customers before we make it generally available for production use. The feature is complete, has passed extensive internal testing, and we are committed to making it generally available in the first half of 2006. We will continue to field test the feature with customers and will release it for general use as soon as you tell us it is ready.

We also heard from many of you that you wanted a more seamless management experience across all SQL Server 2005 editions. With this in mind, we are in the process of building a scaled down version of our SQL Server 2005 Management Studio for SQL Server 2005 Express Edition. We believe this will provide you with the ability to more efficiently manage SQL Server 2005 Express Edition with increased automation and lower complexity. The final delivery of this technology will also depend on additional feedback from customers, but we anticipate that it too will be delivered in the first half of 2006.

I guess we will have to wait for it :(

ps you can enable it if you want with a trace flag but it won't be supported.

-
Posted by simonsabin | with no comments

You might have guessed from my post on the keynote that I thought LINQ was very impressive. Well I really couldn't believe it so I went over to the hands on labs to investigate. I have worked on a number of projects that have tried to achieve the goal of abstracting data access layer in a way that was easy to use, all have failed, and these are the general reasons why.

  • having an iterative process to developing the solution and continuosly finding additional requirements
  • Trying to solve all this requirements with an elegant solution
  • Providing a performant type safe architecture

and a few others.

So I started the lab and soon got onto the data acesss side (DLINQ), the basic principle is that you have classes that map to a rows in a table tables and properties that map to columns in those tables.The mapping is done through attributes. You then have classes that are collections of the row classes.  This enables you to use the new syntax to query the tables and produce results.

. This is a basic DLINK query that selects a few columns from customers

    // Query for customers in London

    var custs =

        from c in Customers

        where c.City == "London"

        select c;

I wanted to know what was going on under the hood, unfortunately the db was an attached sql express database and no profiler. So syscacheobjects came to the rescue. What I found was that the LINQ engine was translating the above query into pretty much a select * from Customers.(it does name all the columns). This is because we are returning a whole c object which is a Customer object as that is what Customers is a table of. So all the columns in Customer need to be populated froma db point of view this isn't great all the time you don't always want all the columns, in this case you can use the following syntax to create an anonymous type that only contains the contactName

var q =

    from c in db.Customers

    where c.Region == null

    select c.ContactName;

So this will only do a "SELECT Contactname FROM Customers WHERE Region is null".

So what else did I find, well objects generally have hierarchies. So what about loading them. Well you could just call custs[0].orders[0].orderdate to get the order date for the first order of the relevant customer and DLINQ would realise that the orders are not populated for that customer and so send a SQL statement to get the details, if however you need to do this for lots of customers you may want to have them already loaded. well to do this you can use another bit on your query

var q = (

    from c in db.Customers

    where c.Region == null

    select c.ContactName)

            .Including(c => c.Orders);

Or even

var q = (

    from c in db.Customers

    where c.Region == null

    select c.ContactName)

       .Including(c => c.Orders.Including(o => o.OrderDetails));

This tells the engine to get those extra levels at the same time as getting the customers. so basically in 3 queries.

There are many operators that are allowed in the where clause that are mapped to SQL functions, interestingly I noted that .contains maps to LIKE with a double wild card (urrgghh). Hopefully they will support full text in the future.

So your thinking ok thats create what about updates, deletes etc.well thats just as easy.

Customer cust =
      new Customer {
            CustomerId = “ABCDE”,
            ContactName = “Frond Smooty”,
            CompanyTitle = “Eggbert’s Eduware”,
            Phone = “888-925-6000”
      };

// Add new customer to Customers table
db.Customers.Add(cust);

How easy is that. You can then don multiple actions on your db and then call db.SubmitChanges(); to send the changes to the db.

You can configure the classes to use Sps instead of direct SQL if you want. The one query that I am still not sure of the answer is to the combination of multiple tables into one class. I think its possible because of the ability to use sps for IUD and a view/sp for the base data however I am not sure how well that will work with the other stuff that does cross class queries. I suspect that you need to scarifice data access the the LINK gods and let it generate the required SQL.

This thing is so cool it is scary, I thought I was doing well just managing to get my head round all the stuff in 2005.

Whats also interesting is that the view of the development side i.e. the C# guy. There are so many, oh my god and wow and chins touching the floor in amazement that this has got to be a goer.

If you're interested in this stuff the download the bits and the papers and see it fly. You will be gobsmacked by it.

I spoke to many guys today and the big drive is to make sure this is kept simple to make sure it is usable. It is therefore not likely to cater for all scenarios, but those it does its going to greatly simplify apps. No more new commands and parameters and data readers :)

ADO.NET RIP ;)

Kents View on LINQ

-
Posted by simonsabin | with no comments
Filed under:

I've taken the plunge and started to uninstall June CTP to be able to install the September CTP of SQL Server 2005. Unfortunately it doesn't support an upgrade so you have to run the Microsoft SQL Server Clean up Wizard. This is running at the moment and I will let you know how it goes.

Simon

ps Its so nice to be able to type a post on a proper keyboard rather than my pocket pc phone.

Update 00:15:

So I ran the Build Uninstall Wizard to remove the old stuff. However it still sqawked that stuff was being used when I tried an install so I uninstalled all 200 bits, including J#, Samples, VS and VS for Office. I would have thought that the uninstall should have told me about uninstalling the other bits (maybe it did and I missed it). One thing it didn't uninstall was the upgrade advisor. It will be interesting to see how whether it works after the new CTP is installed (doing so at the moment)

Beware the New CTP  is a TWO disk install you need to download the server and the tools iso files. A bit suprising that the tools aren't on the server file. I am sure there is a good reason.

Update:

So after finally getting it write I have SQL installed. a couple of points. If you are upgrading and are using the Build Uninstall Wizard i.e. to save your databases. If you do then select to use your existing database files you need to make sure the service account that you set your SQL Server to run under has the correct permissions to the folder that contains the files. If it is a different account to the one used previously it is lilley that it won't have access.

-
Posted by simonsabin | with no comments
I thought that there wouldn't be much new stuff from the PDC in 2003 for the data side. Well I have just come out of the keynote and how wrong could I be.
What blew me away wasn't the 3D in vista or the simplicity of indigo, but the integrated query demo.

Integrated query is the ability to query data using constructs built into the .net language you use. This doesn't require the use of objects you just write a select statement just as you would write a foreach loop of switch statement. the things you can use in your query can be any object that supports ienumerable. To access a db you create a class that maps to a table in a database and select from that class.
so what’s the power. well you can query any in memory "collection" and join these together. I.e as was demoed today get the list of processes from system.processes. you can then join that to the description of processes stored in the db. wow that’s without writing one bit of sql.
this is all code named LINQ details can be found here http://msdn.microsoft.com/netframework/future/linq/default.aspx
as kent said. wow this got the biggest applause.
also mentioned here-
Posted by simonsabin | with no comments

The September CTP is coinciding with the PDC. If you have an MSDN subscription it can be downloaded now. If not then you will need to wait for the public download to be available.

-
Posted by simonsabin | with no comments

So I started blogging from my pocket pc phone (orange spv m2000) I needed to complete the loop and have an rss reader. I downloaded a few but have gone egress. the reason being it has folders so all the groupings I have in sharpreader I can have in egress.
it also makes good use of the limited space on the screen.

So I can know blog and read all from my phone at the PDC:)

-
Posted by simonsabin | with no comments
Well off to PDC tomorrow so will hopefully be providing some intersting posts on the new CTP ;) and whats in store for SQL in the future.-
Posted by simonsabin | with no comments
have downloaded and installed diarist by kev daily kev daly. so I can now blog from my phone-
Posted by simonsabin | with no comments

If you've been using SQL Server 2005 you may have noticed that you can create projects that contain your files. These can then be maintained in sourcesafe. I have been using them recently to hold files for a recent piece of work. and have noticed that the are displayed in the order they were added to the project, which isn't too helpfull.

To get round this I have created a command line utility to reformat the project file and put the files in sort order.

You can download the utility from here http://www.sqlserver.plus.com/SQLServerTools.exe

 

-
Posted by simonsabin | with no comments
Filed under:

Do you want to know whos going to  the PDC well there is a OMPL of attendees available ..

http://commnet.microsoftpdc.com/rss/opml.aspx

-
Posted by simonsabin | with no comments
More Posts « Previous page