Patrick’s Bytes

Techie for the past 30 years…

Procedure or function expects parameter ‘@something’, which was not supplied.

Where in actually fact I have already insert the parameter into my SQLCommand object. In the end I realize, the problem is not caused by the parameter but the SQLCommand.CommandType; which I had left out. Caused me 1 hour of unproductive time to look for this.

Other common cause which I found online is the use of null value for paramters (especially OUTPUT parameters), you should actually use DBNull.Value.

SQL Azure Data Sync CTP is now public

I notice the Data Sync button on the left when I logged in to my Windows Azure portal this morning. SQL Azure Data Sync is the answer for customers having web applications on SQL Azure but would want to have a local on premise copy for different purposes, example would be the web store database to be sync’ed back to a local SQL Server instance to run Analysis Services. Another example would be to synchronized SQL Azure databases on different region in a geographical distributed database design.

Sync Framework 2.1 and the October 4.0 CTP already provide a basic application framework to synchronize databases from different sources and editions, but most customers would like a out of box solution that works in most cases and leave specific scenarios to the developers.

Since this service is still on CTP, there are no charges of trying it out, however Windows Azure bandwidth charges applied when data are downloaded back to local database or between different regions.

datasync.

Since this is a preview, only US and Europe region are available at the moment. Meaning if your SQL Azure database is hosted in the APAC region like me, I believe it will incur some data transfer charges (need to investigate further and ask my local technology evangelist)

region.

I setup an instance of the service that is based on North Central US, note that your subscription info will be updated. Sync pairing are grouped into sync group with specific rule sets applied to a group of databases.

us.

Once you have provisioned your Data Sync service, you can choose to setup synchronization between your local SQL Server and Azure or sync between 2 SQL Azure instances.

sync options.

SQL Azure to SQL Azure is a no brainer, and since my SQL Server sits behind a firewall, I wonder how it works, so I chose the first option. Data Sync Services provides a pretty intuitive UI to setup.

wizard.

Now I try to add a local SQL Server to the sync group

ScreenClip(2)

Just like Sync Framework, I have options to choose the sync direction

ScreenClip(3)

Since the DB will be

ScreenClip(4)

Now I want to check out whether this works with SQL Express, I proceed to download the agent

ScreenClip(5)

The agent runs as a Windows Service, so I have to specify the user account to use

ScreenClip(6)

Strange, I got an error message, let me try grant local admin right to the service account

ScreenClip(7)

Yup it works!

ScreenClip(8)

Proceed back to Azure portal to generate the agent key

key

After that I would have to register the key in my local Agent

ScreenClip(9)

You have to add the DB you would like to sync by clicking on the Register button

ScreenClip(10)

Then head back to the portal and click on ‘Get Database List’

ScreenClip(11)

And yes! Looks like I can use the agent to connect to any database in my local network. Next step is to add a SQL Azure database to the sync group

ScreenClip(11)[4]

This part is not as intuitive as I need to enter the details manually. It could be I created the database just now.

ScreenClip(12)

Step 4, set up the schedule when the sync happens and the conflict resolution rules.

ScreenClip(13)

Next you have to define the datasets (tables) to be synchronized.

ScreenClip(14)

For someone with no prior experience of SQL Azure Data Sync, this screen looks a bit puzzling, especially when I have both the local and the cloud version of my database using the same name. Let’s try my luck with the first one, then I click ‘Get Latest Schema’.

ScreenClip(15)

Oops?! Later I realize the first option points to the DB on SQL Azure and it is empty, hence the error. Let’s choose the second one.

ScreenClip(16)

And objects got populated on the screen. Note the message in red ‘Some tables/ columns do not meet the schema requirements. See the Report. You may still create a sync group by selecting the remaining tables/ columns from the list.” Now I click on the ‘See the Report’ link, it will tell me (on the next screen) what’s wrong with my database schema.

ScreenClip(17)

Most of them are caused by the absent of clustered index and use of User Defined Datatypes, which are not supported on SQL Azure.

ScreenClip(18)

Note that I can also define filter for the dataset. Now noted that if at this point you reselect the database from the drop down list on top, you will lost whatever changes you made previously even when you change back to the database you worked on just now.

ScreenClip(19)

Now comes to the end of the process, I saw a deploy instruction on top of the screen.

ScreenClip(20)

And bomb! I got another not-so-helpful error message. I suspect its because my database on the cloud is empty. Let me retry with something simple.

ScreenClip(21)

Hmm, when I reprovision the databse on the local sync agent (Pic 1), the changes are not updated on SQL Azure portal and the Refresh button is greyed out (Pic 2), Looks like I got to wait sometime for the information to be refreshed.

ScreenClip(22)

Pic 1

ScreenClip(24)

Pic 2

So on my 2nd try to add the SQL Azure database the drop down list works

ScreenClip(25)

Voilà! This time with the simpler database, the deployment works. I will go back to this later, this post is just to test out Data Sync on a simple scenario.

ScreenClip(26)

Since the database on SQL Azure is still empty, a sync would have upload all tables in the dataset to the database. Let’s confirm the sync via the log viewer.

ScreenClip(27)

Then I take a look at the SQL Azure database via SQL Server Management Studio to make sure everything works.

ScreenClip(28)

Noted that Data Sync Services created it’s own tracking tables for each of the tables in the dataset. I checked my local database and it has the same set of new tables.

That’s my first experience with SQL Azure Data Sync services. Having been playing with Sync Framework for the past 3 years, there are still features not available out of box on Data Sync which a custom application (normally built using Sync Framework) is required; for example:

  • 1. Custom synchronization rules
  • 2. Sync with SQL compact
  • 3. Database sync between SQL Azure and non-SQL Server database such as Oracle and MySQL
  • 4. Data sync between 2 or more SQL Server instances on different locations (no SQL Azure instance involved here)

My company for instance is working on a product based on scenario 1 and 4. Smile

Microsoft has already published a FAQ on Data Sync here.

Troubleshooting SQLDependency

SQLDependency API in SQL Server allows application to get notified via Service Broker when there are changes happened on selected table(s ). You can find out more from this MSDN article.

But working from home today, I realize SQLDependency never fires the notification back to my application. I found out how to troubleshot this from a forum threat here.

So I queried my database using this command select * from sys.transmission_queue and I got the follow result

An exception occurred while enqueueing a message in the target queue. Error: 15404, State: 19. Could not obtain information about Windows NT group/user ‘IPS\patrick’, error code 0x54b.

I suspect Service Broker requires access to the Domain Controller, so I try to login to my VPN and try again… and boolah!! It works!!

Setting up SharePoint 2010 Beta 2 screenshots (Part 1)

I managed to setup SharePoint 2010 Beta 2 on a Windows Server 2008 SP2 VM with SQL Server 2008 R2 Nov 09 CTP. SP2010 requires 64bit version of Windows Server and SQL Server . For the host I have an Intel C2Q machine on 4GB RAM running Windows Server 2008 R2 with Hyper-V installed.

For the VM environment, I have:

  1. AD Domain Controller on Windows Server 2008 SP2 Server Core
  2. Another VM running Windows Server 2008 SP2 enrolled in the AD domain. I have PowerShell feature (for SQL Server), IIS Web Server role and Application Server role (both for SharePoint) setup after I enrolled the VM in AD.

For part 1 of this, I will show how I setup SQL Server 2008 R2. Even though it’s in CTP, setting the database server is no brainer.

Below are my screenshots of the whole process. For detailed explanations, you can follow Microsoft UK MCS’s blog here.

image

This is the system properties of the VM. Note that I allocated 2.5Gb RAM for this VM.

image

Put in the SQL Server 2008 R2 DVD and it asked me to setup prerequisites i.e. .NET Framework 3.5 SP1 and an update to Windows Installer.

image

Prerequisites installer starting up

image

Accept the EULA for .NET Framework 3.5 SP1

image

.NET Framework installer running

image

.NET Framework 3.5 SP1 setup successfully.

image

SQL Server 2008 R2 installer will starts automatically.

image

Click on the Installation tab on the left. Then choose ‘New installation or add feature to an existing installation.’

image

Installer to inspect system and determine all setup rules passed.Click OK here

image

The SQL Server 2008 R2 setup files starting up. Following experience will be very similar to setting up SQL Server 2008. Hope it doesn’t change in the final release

image

Select that I want the Enterprise Edition

image

Accept the EULA

image

Setup files copying themselves

image

Setup support rules are scanned again. I ignore the warning on opening up the SQL Server port at the firewall.

image

This is new for R2, being not 100% sure, I choose the first logical option

image

Then select the SQL Server features I want. I chose:

  • Database engine with Full text search
  • Reporting Services
  • BI Development Studio (optional)
  • Management Tools – Complete

image

Installation rules are scanned to make sure all requirements fulfilled

image

Determined my SQL instance (in case you have more than 1 already installed)

image

Determine I have enough hard disk space

image

Now is the choose the user account(s) to be used for the services. I create a sqlservices account in my domain and I want all services to use the same account. So I clicked on ‘use the same account for all SQL Server services’

image

Keying in the account credential

image

Next screen I have to decide on the authentication mode and add myself as a SQL Server administrator.

image

I am doing nothing for Reporting services so it’s option 3 (Install, but do not configure the reporting server) for me.

image

I don’t want to send error reports back to Microsoft.

image

Final check on configuration rules

image

Review your installation options

image

Installation started

image

Success!

image

Starting up the SQL Server Management Studio, similar to SQL Server 2008

image

Still using VS2008 for BI Development Studio. Hope they will upgrade to VS2010 later as SP2010 will also be using VS2010

Next port I will show the installation process of SharePoint Server 2010

Master of all Microsoft certification

 

 

 

According to the website

The new Microsoft Certified Master series offers advanced technical training and certifications on Microsoft technologies that go beyond any product training offered outside of Microsoft today. IT professionals who successfully complete the training program and certification testing validate their skills as product experts who successfully design and implement solutions that meet the most complex business requirements.

Mind you, this is not a certificate you can get by studying brain dump, candidates are required to attend a 3 weeks training at MIcrosoft’s Redmond campus, passes 3 written exams and one lab exam. Like Cisco Certified Master, I think the hardest test to pass is the lab exam where actual production issues are simulated and candidates are required to solve it in the given timeframe.

How much is the cost? Since it’s the master cert, and you got to go to Redmond to learn from the gurus, the whole cost training + exams will cost you USD18,500. The 3-weeks training is valuable regardless whether you pass the exams or not because it is taught by people (or master I should say) who really know their stuff.

Below are technologies offered in the MSM program

  1. Exchange 2007
  2. SQL Server 2008
  3. Active Directory
  4. SharePoint Server 2007
  5. Office Communications Server 2007

So you think this is very ‘geng’? MCM can go for the new Microsoft Certified Architect (Technology focus) program here after they got the cert. Its different from existing MCA (Solutions/ Infra) programs which are technology agnostic.

Older Posts »