SQL Server 2014 CTP1 Released

I hope you got plenty of use out of your SQL Server 2012 because SQL Server 2014 CTP1 has been released. You can dowload a trial here.

http://www.microsoft.com/en-us/sqlserver/sql-server-2014.aspx

Performance is the first word mentioned in the improvements. Following that availability and reliability are next on the list but the interesting thing to me is disaster recovery since I’ve been chatting about it recently. It looks like you can backup your databases on Azure and then recover from there in the event of a disaster.

Next of interest to me is the in-memory OLTP which would give you great performance without installing any add-ons.

Advertisements
Tagged with:
Posted in Development

Microsoft Access DDL Types

When you are scripting data changes in Microsoft Access databases you may need to create temporary tables in order to update the data. This requires using DDL statements like CREATE TABLE. I usually need to lookup the field types since it doesn’t happen very often. Here is a table of types that you can use.

Desired Type DDL Syntax
Text TEXT(50)
Memo MEMO
Byte BYTE
Integer INTEGER
Long LONG
AutoNumber COUNTER
Single SINGLE
Double DOUBLE
Currency CURRENCY
ReplicaID GUID
DateTime DATETIME
YesNo YESNO
OleObject LONGBINARY
Binary BINARY(50)

I got these types from the following Microsoft Support article.

http://support.microsoft.com/kb/180841

Tagged with: ,
Posted in Development

Linq Query with Multiple Order Fields in Method Syntax

Ordering your sequences is simple using comprehension syntax with your Linq queries, but what if you want to use method syntax?

Here is a simple example with multiple fields in the order by statement.

var movies = from m in Movies
orderby m.CategoryID, m.Name
select m;

Now to accomplish the same thing in method syntax you just use apply a second ordering method like so.

var movies = db.Movies.Orderby(c => c.Category).ThenBy(n => n.Name);

Here is where I found an example for this on stackoverflow.

http://stackoverflow.com/questions/298725/multiple-order-by-in-linq

Tagged with:
Posted in Development

Generating Properties Using the prop Snippet in Visual Studio 2013

Saw a very cool way to generate properties in C# code from the //build conference, just by typing the word prop, but I didn’t know what key to press after the typing prop. I tried TAB and ENTER but they didn’t work. Turns out that you have to type TAB + TAB to get it to work. That is press TAB twice.

See here:

http://visualstudiomagazine.com/blogs/tool-tracker/2013/06/write-a-property-with-a-name-and-datatype.aspx

Tagged with: ,
Posted in Development

Visual Studio 2013 Preview Available for Download

Visual Studio 2013 Preview is now available for download. You can download it from here.

http://www.microsoft.com/visualstudio/eng#2013-downloads

You might as well get the Ultimate version for now to try it out although you may need to uninstall and reinstall if you need to switch to Premium later. The express version may be useful as an alternative.

Tagged with:
Posted in Development

Reading XML using PowerShell

Stumbled across a very simple way to read an XML document using Powershell. This is so simple and concise. You just get the content and convert it to an XML object.


 [xml]$books = Get-Content C:\Books.XML 


 $books.catalog.book.title 

Thanks to The Scripting Guy.

http://blogs.technet.com/b/heyscriptingguy/archive/2012/09/13/powertip-use-powershell-to-easily-read-an-xml-document.aspx

Tagged with: ,
Posted in Development

Consuming JSON from External Sources using Javascript

First you need a handy function to do the GET request.

function httpGet(theUrl) {
var xmlHttp = new XMLHttpRequest();
xmlHttp.open("GET", theUrl, false);
xmlHttp.send(null);
return xmlHttp.responseText;
}

Next you simply evaluate the text.

var jsonstring = httpGet("http://data.gc.ca/data/api/...");
var jsonvalue = eval("(" + jsonstring + ")");

Then you access the properties and place them on your page.

document.getElementById("placeholder").innerHTML = jsonvalue.help;

For more information here is an introduction to JSON.
http://msdn.microsoft.com/en-us/library/bb299886.aspx

Tagged with:
Posted in Development