Release Notes for the Microsoft code name “Oslo” Software Development Kit (SDK) January 2009 Community Technology Preview (CTP)
(Refreshed February 27 2009)

Contents

Introduction. 1

Supported Platforms. 1

Installation. 1

Uninstalling previous versions of the Microsoft "Oslo" CTP. 2

Installation of Microsoft “Oslo” Repository Redistributable. 2

Building and Loading Oslo Models. 2

Steps to clean out the previous install of Oslo models in Repository: 2

Steps to build and load models: 2

Uninstallation. 2

What's New?. 2

Token Actions for MGrammar. 2

MGraph syntax supported in MGrammar RHS. 2

Additional M Collection Members Are Now Implemented. 2

February 2009 Refresh

Known Issues. 3

Building Samples. 3

MSBuild Targets Files on 64-Bit. 3

Intellipad. 3

Breaking Changes. 3

MGrammar. 3

Repository. 3

Appendix 1: SQL script to clean out old models. 4

Copyright. 5

 

 

Introduction

Welcome to the Microsoft® code name “Oslo” SDK.  In this SDK we introduce the new Microsoft code name "M" modeling language. The SDK contains documentation, samples, copies of the “Oslo” models written in "M", and tools designed to help you write your own models in "M", including the code name “Intellipad” tool for code name “Oslo”.

Here is a brief overview of the "Oslo" SDK contents:

SDK Tools

·          Microsoft Visual Studio® integration: edit and build "M" in Visual Studio 2008

·          “Intellipad”: a text editor with "M" language services

·          "M" language compilers

·          Mx.exe, the "M" command-line utility: imports and exports compiled "M" into and from Microsoft SQL Server® 2008

·          "M" Add-in for Microsoft Excel® 2007: imports and exports "M" into and from Microsoft Excel 2007

Documentation

·          "M" formal language specifications

·          "M" language primers

·          Various product Help documentation

Samples

·          "M" language samples

·          "M" parser demonstration

·          SQL Server Integration Services sample

·          "M" source code for "Oslo" models

Repository Tools and Samples

·          CreateRepository.exe: a tool for creating a Repository database.

·          Models.mx: a compiled image of Oslo models.

·          Mx.mx: a compiled image of light-up models for Mx.exe.

·          Mx.exe, the "M" command-line utility: imports and exports compiled "M" into and from Microsoft SQL Server 2008

Supported Platforms

·          This release of the SDK supports Microsoft Visual Studio 2008.

·          This release of the SDK supports x86 and x64 platforms for building and running applications on Windows® XP SP2, Windows Server® 2003 R2, Windows Vista, and Windows Server 2008.

·          Creating a Repository requires SQL Server 2008

Installation

To optimize the experience, we strongly recommend that you install the latest updates and patches from Microsoft Update before you begin installing the SDK.

Install the following prerequisites:

·          Microsoft .NET Framework 3.5 SP1 is required to run any executables.

·          Microsoft Visual Studio 2008 is required to compile and execute code samples.

·          Microsoft Excel 2007 with .NET Programmability Support enabled is required to install and run the "M" Add-In for Excel.

Run OsloSDKJan2009CTP.msi for the SDK and follow the instructions.

Uninstalling previous versions of the Microsoft "Oslo" CTP

To install the new CTP, you need to uninstall the October CTP by doing the following:

1.       Go to Add/Remove Programs and uninstall

a.       Microsoft Codename "Oslo" SDK CTP Setup Temporary Files

b.      Microsoft Codename "Oslo" Repository

c.       Microsoft Codename "Oslo" SDK

2.       Drop your existing Repository database

3.       Download the latest CTP

Installation of Microsoft “Oslo” Repository Redistributable

1.        Run Repository.msi from your download location.

2.        Click Next to start the installation after the EULA page.

3.        Click Next after choosing the location where the repository redistributable will be installed.

·         The default location is C:\program files\Microsoft Repository. If needed, change the location by clicking the Change button.

4.        In the Ready to install the Microsoft “Oslo” Repository page, keep the box checked if you want to create repository database. The database is created in the default local SQL Server instance. However, this can be overridden by selecting a different local instance from the dropdown list. Otherwise, uncheck the box. You can always run CreateRepository.exe later to create a repository database.

·         Note: SQL Server 2008 RTM (Enterprise or Developer Edition) or SQL Server Express 2008 is required to create a repository database. The repository database is installed on the default instance.

5.        Click Install to start the installation process.

6.        When setup is complete, click Finish.

Building and Loading Oslo Models

·          Install the Microsoft Oslo SDK from the drop

·          A repository is installed in the local server

·          Use the Repository redistributable to install a repository in your database if it is not already there

Steps to clean out the previous install of Oslo models in Repository:

If deploying multiple mx files or to remove deployed Oslo models from the Repository, run the SQL script listed in the Appendix. This will create a new stored procedure that will help you clean all objects from the Repository (except for Repository schemas).

Steps to build and load models:

·          Open a cmd shell and cd to the folder C:\\Program Files\\Microsoft Oslo SDK\\Oslo Models.zip

·          Unzip Oslo Models.zip to a new folder and cd to the folder

·          Run the following command to generate the required mx.

o    "%programfiles%\\microsoft oslo sdk 1.0\\bin\\m.exe" /p:image /t:tsql10 /o:Models.mx/recurse:*.m

·          Change the /t:tsql10 to /t:repository new to generate the mx with repository patterns.

·          Deploy the generated mx to the repository which is named "Repository" in your local SQL Server using:

o    "%programfiles%\\microsoft oslo sdk\\bin 1.0\\mx.exe" /i:Models.mx /db:repository

Uninstallation

·          In the taskbar, click Start, and then click Control Panel.

·          Click Uninstall a program in the Programs section. This opens the Uninstall or change a program window.

·          In the Uninstall or change a program window, select Microsoft code name “Oslo” SDK, and click Uninstall.

·          Follow the instructions to uninstall the SDK.

What's New?

The bulk of the changes in this release involve increasing test coverage, improving test quality, and resolving code defects. However, there are some notable differences. Please also see the Breaking Changes section (below) for more changes.

Token Actions for MGrammar

·          Any production in a token can now have a code action or a graph action (formerly known as term construction)!  You can now specify a return type for a token definition in the case of code actions, similar to a syntax definition.

 MGraph syntax supported in MGrammar RHS

·          The following is now supported:

syntax A = b:BSyntax c:CSyntax d:DSyntax => A { B = b, C = c, D = d };

Additional M Collection Members Are Now Implemented

·          The following members are available on all collections: Count, Choose, Distinct

·          The following members are now available on collections of type Logical* : All, Exists 

February 2009 Refresh

·          This refresh changes three DLLs to resolve crashing problems with three-pane modes in Intellipad.

·          Changes in behavior: (1) When the MGrammar compiler crashes, the compiler exception is reported in the errors pane of three pane mode instead of crashing Intellipad; (2) Opening a buffer without making changes to it scrolls at a more reasonable speed

·          Affected binaries: Microsoft.M.Grammar.IntellipadPlugin.dll, Microsoft.M.IntellipadPlugin.dll, Microsoft.Sql.IntellipadPlugin.dll.

·          Note: to install this refresh, follow the same instructions above to uninstall a previous version. 

Known Issues

The following are known issues with the current release of the SDK.  The most recent version of known issues can be found here.

Building Samples

Samples are currently installed with the rest of the SDK software. If you choose the default location or anywhere else under "Program Files", then when you open the included project files using Visual Studio 2008 a message will appear: “Do you want to restart Visual Studio with elevated permissions?”

Workarounds:

·          Copy the Samples folder from the installation directory into a directory on your hard disk where you have write permissions and then open the project file using Visual Studio 2008.

·          Start Visual Studio in an elevated mode.

MSBuild Targets Files on 64-Bit

The SDK includes MSBuild support, including targets files for the "M" language.  These files are required to open and build "M" projects in Visual Studio and “Intellipad”.  On a 64-bit machine, the targets files are only copied to the 32-bit version of the MSBuild targets folder.  The files are not found when running Visual Studio or “Intellipad” in 64-bit.

The workaround is to manually copy these target folders from their 32-bit version folders to their 64-bit counterparts.  From an administrator console, run the following commands:

xcopy.exe /e "%PROGRAMFILES(X86)%\msbuild\microsoft\m\*" "%PROGRAMFILES%\msbuild\microsoft\m\"

Intellipad

There is a known issue with MMode in Intellipad when you attempt to preview SQL for a complex M project that resulting in the following error message:

/*
Internal error: Unhandled Cyclic Dependency: 32 database objects or statements had a cyclic dependency which could not be resolved.*/

Workaround

Note: this section may involve making changes to an MSBuild Project file and assumes some familiarity with MSBuild. Make sure to backup your project file before changing it.
To workaround this issue, you can build the M Project and view the generated SQL in Intellipad. Intellipad will detect changes to the file if you rebuild and prompt you to reload the file.

  1. Make sure the project is configured to generate SQL scripts by setting the MPackageScript property to true in the project file.
  2. Set the MTarget property to true in the variant of SQL that you want to generate. Valid values are ‘Repository’ or ‘TSql10’ (case sensitive).
  3. Press F6 to build your project from Intellipad (The active buffer must be either the project or one of the project files).
  4. The ‘output’ buffer will show the output location of the mx image file. The generated SQL script should be in the same directory.

Below is sample addition to your M project file for steps 1 and 2:

<PropertyGroup>
  <MTarget>TSql10</MTarget>
  <MPackageScript>true</MPackageScript>
</PropertyGroup>

Breaking Changes

MGrammar

·          The CaseSensitive attribute controls whether tokens are matched with our without case sensitivity. In order to bring the name of the attribute in line with .NET Framework standards:

·          The attribute has been renamed to CaseInsensitive.

·          The CaseInsensitive attribute does not require arguments.

·          As a shortcut, MGrammar attribute syntax has changed to allow attributes that don’t require arguments to be defined without an empty argument list. For example, you can use "@{CaseInsensitive}" instead of "@{CaseInsensitive[]}". The latter syntax still works, though.

Repository

·          The [Document] schema has been renamed to [System.Document]

·          The [Item] schema has been renamed to [Repository].[Item] (this change went into Drop 24 but was not announced)

·          You can no longer build all the supplied Oslo models using the /t:Repository option.  Some catalog models (..\\Models\\Repository\\Loader\\*.m )are only supported if built using /t:TSql10.  This change only affects cases when attempting to rebuild the Repository by compiling all the supplied models from source rather than using the provided models.mx file and mx.mx file.

Note: If you check the option to install a default repository database when installing the Repository from the Repository.msi file these tables will be installed automatically. If CreateRepository.exe is used at a later time to create a repository database these light-up tables will not be installed. To install these tables manually you should install the supplied mx file. The two commands below illustrate this process, first the command to create a repository database, then to install the light –up tables into that database. The second step is optional and can be done at any time:

CreateRepository.exe /n:{NewRepositoryDatabaseName}

mx /d:{NewRepositoryDatabaseName} /i:MX.mx

Appendix 1: SQL script to clean out old models

Create the new stored procedure

if exists (select * from sys.objects where object_id = object_id(N'[dbo].[DropModels]') and type in (N'P', N'PC'))

drop procedure [dbo].[DropModels]

go

create procedure [dbo].[DropModels]

as

begin

declare @dropStatement nvarchar(500)

declare @order int

-- drop schema objects --

declare objectsCursor cursor for

select

case

when o.[type] in ('C','D','F','PK','UQ') then 'alter table ' + quotename(s.[name]) + '.' + quotename(p.[name]) + ' drop constraint ' + quotename(o.[name])

when o.[type] in ('P','PC','RF','X') then 'drop procedure ' + quotename(s.[name]) + '.' + quotename(o.[name])

when o.[type] in ('AF','IF','TF','FN','FS','FT') then 'drop function ' + quotename(s.[name]) + '.' + quotename(o.[name])

when o.[type] in ('TA','TR') then 'drop trigger ' + quotename(s.[name]) + '.' + quotename(o.[name])

when o.[type] in ('V') then 'drop view ' + quotename(s.[name]) + '.' + quotename(o.[name])

when o.[type] in ('U','S','IT') then 'drop table ' + quotename(s.[name]) + '.' + quotename(o.[name])

else 'select 1'

end,

[order] =

case

when o.[type] in ('C','D','F','PK','UQ') then 1

when o.[type] in ('P','PC','RF','X') then 2

when o.[type] in ('AF','IF','TF','FN','FS','FT') then 3

when o.[type] in ('TA','TR') then 4

when o.[type] in ('V') then 5

when o.[type] in ('U','S','IT') then 6

else 100

end

from sys.objects o inner join sys.schemas s on o.schema_id = s.schema_id left outer join sys.objects p on o.parent_object_id = p.object_id

where s.name not in ('Clr', 'System.Document', 'Repository.Catalog.Sql', 'Repository.Item', 'System.Globalization','Repository', 'dbo', 'sys', 'guest', 'information_schema')

order by [order];

while exists

(

select * from sys.objects o inner join sys.schemas s on o.schema_id = s.schema_id

where s.name not in ('Clr', 'System.Document', 'Repository.Catalog.Sql', 'Repository.Item', 'System.Globalization','Repository', 'dbo', 'sys', 'guest', 'information_schema')

)

begin

open objectsCursor

fetch next from objectsCursor into @dropStatement, @order

while @@fetch_status = 0

begin

begin try

print (@dropStatement);

execute (@dropStatement);

end try

begin catch end catch;

fetch next from objectsCursor into @dropStatement, @order

end;

close objectsCursor

end;

deallocate objectsCursor;

-- drop schemas --

declare @schemaName sysname;

declare schemasCursor cursor for

select [Name] from [sys].[schemas]

where [Name] not in ('Clr', 'System.Document', 'Repository.Catalog.Sql', 'Repository.Item', 'System.Globalization','Repository', 'dbo', 'sys', 'guest', 'information_schema');

open schemasCursor;

fetch next from schemasCursor into @schemaName;

while @@fetch_status = 0

begin

set @dropStatement = 'drop schema ' + quotename(@schemaName);

print (@dropStatement);

execute (@dropStatement);

fetch next from schemasCursor into @schemaName;

end;

close schemasCursor;

deallocate schemasCursor;

-- delete idsequences --

begin try

delete from [Repository].[IdSequencesTable] where [schema] not in ('Clr', 'System.Document', 'Repository.Catalog.Sql', 'Repository.Item', 'System.Globalization','Repository', 'dbo', 'sys');

delete from [Repository].[IdSequenceAliasesTable] where [schema] not in ('Clr', 'System.Document', 'Repository.Catalog.Sql', 'Repository.Item', 'System.Globalization','Repository', 'dbo', 'sys');

end try

begin catch end catch;

end;

go

Once the stored procedure is created, you can clear out the old models by executing it.

execute [dbo].[DropModels]

Copyright

This document supports a preliminary release of a software product that may be changed substantially prior to final commercial release, and is the confidential and proprietary information of Microsoft Corporation.  It is disclosed pursuant to a non-disclosure agreement between the recipient and Microsoft. This document is provided for informational purposes only and Microsoft makes no warranties, either express or implied, in this document.  Information in this document, including URL and other Internet Web site references, is subject to change without notice.  The entire risk of the use or the results from the use of this document remains with the user.  Unless otherwise noted, the companies, organizations, products, domain names, e-mail addresses, logos, people, places, and events depicted in examples herein are fictitious.  No association with any real company, organization, product, domain name, e-mail address, logo, person, place, or event is intended or should be inferred.  Complying with all applicable copyright laws is the responsibility of the user.  Without limiting the rights under copyright, no part of this document may be reproduced, stored in or introduced into a retrieval system, or transmitted in any form or by any means (electronic, mechanical, photocopying, recording, or otherwise), or for any purpose, without the express written permission of Microsoft Corporation.

Microsoft may have patents, patent applications, trademarks, copyrights, or other intellectual property rights covering subject matter in this document.  Except as expressly provided in any written license agreement from Microsoft, the furnishing of this document does not give you any license to these patents, trademarks, copyrights, or other intellectual property.

©2009 Microsoft Corporation.  All rights reserved.

Microsoft, Excel, Visual Studio, Windows, and Windows Server are trademarks of the Microsoft group of companies.

All other trademarks are property of their respective owners.