Geoffrey Emery
Tech Goodness

PHP Driver for SQL Server

May 17, 2009 01:59 by gemery

image For those who are not already aware of the Web Platform Installer (WPI), it's a great tool for setting up a Windows machine for Web app development and deployment.  You can download the beta of WPI 2.0 or the WPI 1.0 release here.

PHP itself is available via the WPI 2.0 beta.  Installing PHP through the WPI 2.0 beta also automatically configures FastCGI as part of the installation.  Mai-lan from the API team has a great blog post here with more information about installing PHP via WPI.


Tags: ,
Categories: SQL Server
Actions: E-mail | Permalink | Comments (0) | Comment RSSRSS comment feed

SQL Server The Geography Data type

April 22, 2009 17:57 by gemery
 

Overview

The most important feature of the geography data type is  that stores Geodetic Spatial Data.

image

this is geodetic model.

This model takes account of the curved shape of the earth. When you perform operations on spatial data using the geography data type, SQL server uses angular computations to work out the result.These computations are calculated based on the ellipsoid model of the earth defined by the spatial reference system of the data in question. For example, if you were to to define a line that connects two points on earths surface in the geography data type the line would curve to follow the surface of the earth

image

Every line drawn in the geography data types are actually great elliptic arc.

Coordinate System

The geography data type is based on a three dimensional, round model so you must use latitude and longitude for coordinates.

Units of Measure

Since we are using Latitude and Longitude to define our points the unit of measure is in degrees. Being degrees is helpful for locating a objects, but not very helpful telling us what the actual distance is between the them. For instance lets say we wanted to know the distance between Los Angeles and Dallas. It would not be very helpful to know that it is 13 degrees away. It would be much more valuable to know that it is 1439 miles away.

To account for this the clever folks at Microsoft tell us to put a spatial reference or SRID in of 4326

So lets take a look what kind of measurement we get when we take the distance for Los Angeles To Dallas

 

Declare @LosAngeles as geography = geography::Point(33.56,118.24,4326)
Declare @Dallas as geography = geography::Point(32.47,96.47,4326)
Select @LosAngeles.STDistance(@Dallas)

 

The Result  is

2033990.01214834 metes

2 033 990.01214834 meters = 1 263.8628 miles

We notice that this is different that the first measurement given that is because the first measurement didn't account for the measurement of the earth.

 

Size Limitations

Due to technical Limitations SQL Server limits the size of any single object must fit inside a single hemisphere of the earth. This also include any computation on these objects. To work around this you can break down these objects into smaller polygons and then and then combine those together.

Sweet so there is the first in a series of posts on SQL Server Spatial that are coming out.

almost forgot.

Ring Orientation

If are drawing a ellipsoid everything is stored counter clock wise.


SQL Server 2005 sp3 Released

December 24, 2008 13:38 by gemery

Microsoft just released SQL server sp3 for 2005. Just when you thought it was time to move to 2008 it still is, but if you are still running 2005 look into this pack enhancements.

The purpose of a service pack is to provide a tested intermediate-level upgrade that contains fixes to bugs encountered since the last version release. Service packs don’t typically add new features to the product, although they might provide enhanced behavior to features that were new in the most recent version but weren’t completely ready by the release to manufacturing date. However, Microsoft doesn’t always abide by this definition of service pack, and there have been SQL Server service packs that have added new features, new columns to existing metadata objects, or even entirely new metadata views or functions

Also if you’ve previously applied hotfixes or recent Cumulative Updates (CUs) for Sql Server 2005 SP2 (CU12 or CU11). The most succinct explanation of the relationship between SQL Server 2005 SP3 and the various CUs, including SQL Server 2005 SP3 CU1, which will be released in a week, can be found on Aaron Bertrand’s blog. You can find a list of bugs that have been fixed in SQL Server 2005 SP3 at http://support.microsoft.com/?kbid=955706.

Technorati Tags: ,

Comparison of Execution Speed of EC2 with SQL Express or SimpleDB and Azure Table Services by Oak Leaf

December 23, 2008 23:09 by gemery

I have been getting into cloud computing in a really big way/ I just read a great post from Oakleaf System that put a test harness on all the different cloud computing systems out there, With the exception of       s(s)ds (soon to come) and Google. It is a great through down and worth a read.  Here is a link to the article

http://oakleafblog.blogspot.com/2008/12/test-harnesses-compare-amazon-ec2-with.html

Here is a spoiler if you don’t have time to read the whole thing

Following is a comparison of EC2 execution times with those of the original OakLeaf Systems Azure Table Services Sample Project that’s described at Azure Storage Services Test Harness: Table Services 1 – Introduction and Overview, et seq.

Action: Page Count Insert Delete Create Update
EC2 with SQL Express 0.005 0.002 0.019 0.380 0.112 0.374
EC2 with SimpleDB 0.048 0.094 0.048 10.094 22.142 10.855
Azure Table Services 0.215 0.188 0.155 5.820 5.310 6.561

I was surprised to find Azure Table Services’ execution to be substantially slower than EC2 with SimpleDB for single-page SELECTS, iterative counts, and single INSERT operations.

With the exception of the Insert operation, you can verify the Azure Table Services timing data because the harness is available whenever Azure Data Services is up. EC2 services will be made available on request for brief periods (contact roger_jennings[at]compuserve[dot]com).

Make sure you read the comments there worth a gander.

https://www.blogger.com/comment.g?blogID=11646261&postID=1093778038105568110&page=1


My Interview With David Robinson On Putting SQL Server in the Cloud and More

December 10, 2008 08:44 by gemery

What happens when you all your slides fail your mike doesn’t work and then the projector turns off right before you do your presentation? This is just the start of a great conversation that Geoffrey Emery has with David Robinson at the PDC Underground. Dave just lets it all out and more when he talks about cloud computing and what a exciting time it is to be in the windows family. He is currently working on a new technology at Microsoft called SDS SQL Data Services a program at Microsoft that will eventually put SQL server in the cloud. David also brings up how to do bring the cloud computing to your boss in a way that would be easy for everyone to understand.

Putting the pieces together Microsoft is coming out with some really interesting technologies for cloud computing that is not just a database in the cloud but also hosting of your web site either by spinning up a new server instance and launching it in the cloud or by actually deploying your code into the cloud automatically by using Visual Studio development platform and eliminating the need for the developer to know the ins and outs of IIS for those who don't need it.

Links in the video

David's Blog - http://blogs.msdn.com/drobinson/

Windows Azure – http://azure.com

SQL Server Data Services (SDS) - http://msdn.microsoft.com/en-us/sqlserver/dataservices/default.aspx

Visual Studio - http://msdn.microsoft.com/en-us/vstudio/default.aspx

Microsoft Could Computing – http://azure.com

IIS - http://www.iis.net/

 


SQL Server Express 2008 and SQL Server Express 2008 Management Studio

October 24, 2008 11:22 by gemery

I am getting ready to do bunch of presentations this weekend and I realized half my computers were running the rc of Sql 2008

So I decided to got to the site and downloaded and selected to install SQL Exrpress 2008.

Went to look for SQL Server Express Management Studio Express 2008 annnnnd nothing!

Few search engine searches later and no clear direction found this on SQL Express home page:

You can manually download and install any edition of SQL Server 2008 directly from the Microsoft Download Center:

Which edition of SQL Server 2008 Express is right for you?

SQL Server 2008 Express is available in the following 3 editions (each is available from the Install Wizard):

  • SQL Server 2008 Express
    • SQL Server database engine - create, store, update and retrieve your data
  • SQL Server 2008 Express with Tools
    • SQL Server database engine - create, store, update and retrieve your data
    • SQL Server Management Studio Basic - visual database management tool for creating, editing and managing databases
  • SQL Server 2008 Express with Advanced Services
    • SQL Server database engine - create, store, update and retrieve your data
    • SQL Server Management Studio Basic - visual database management tool for creating, editing and managing databases
    • Full-text Search - powerful, high-speed engine for searching text-intensive data
    • Reporting Services - integrated report creation and design environment to create reports

So make sure you download the SQL Server 2008 Express with ToolsSql

Though I save some people some time.

One last thing:

Step 1: Download and install Microsoft .Net Framework 3.5 SP1.
Step 2 Download and install Windows Installer 4.5.
Step 3 Download and install Windows PowerShell 1.0.


Where are you in Data mining and Business Intelligence

September 3, 2008 06:45 by gemery

I love data...It holds so many interesting secrets just waiting to be mined out and taken advantage of. If you haven't looked into space before the time is now and its never been easier.

Start to read Lynn Langit's Blog She is the BI Queen, and posts solid information that you will need like this great post on  BI.

http://blogs.msdn.com/socaldevgal/archive/2008/08/27/sql-server-2008-data-mining-in-the-cloud.aspx

Her book a great place to start as well

http://www.amazon.com/Foundations-Server-2005-Business-Intelligence/dp/1590598342

Enjoy!


Restoring Backup Databases and viewing logical files In SQL Server

April 11, 2008 11:41 by gemery

Ok so I was running into some errors restoring a database and I ended up writing this little script that did the job.

Thought I would share.

Here’s how you look into a backup set to find out what logical files make up the backup set.

When you get the logical file names you can then write a restore script to restore the database to any name you would like as well as renaming the datafiles to match your new database name.  Here are the steps:

From Management Studio, run this command from the master database: restore filelistonly from

disk=’path\dbname.bak’ where path is the location of the backup set: 
restore filelistonly from disk='\\YourServer\c$\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Backup\Email.bak' 

In this case it returned the following information:

LogicalName   PhysicalName                  Type       FileGroupName        Size                MaxSize              FileId

Email1        E:\Data\Email_Backup.mdf   D         PRIMARY              10770972672           35184372080640       1

Email1_log   E:\Log\Email_Backup.ldf      L         NULL                 4312465408          2199023255552         2

Then we build the restore database statement and change the PhysicalName and location of the file to a new name we prefer.  In this case it looked like this:

 

restore database Email from disk='\\YourServer\c$\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Backup\Email.bak' 
with move 'Email1' to 'C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\DATA\Email_data.mdf', 
move 'Email1_log' to 'C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\DATA\Email_log.ldf' 
go
Bata Bing Bata Boom rocking the new database..