List:Commits« Previous MessageNext Message »
From:rburnett Date:June 3 2008 9:40pm
Subject:Connector/NET commit: r1311 - trunk/MySql.Data.Entity/Provider/Properties
View as plain text  
Modified:
   trunk/MySql.Data.Entity/Provider/Properties/ProviderManifest.xml
   trunk/MySql.Data.Entity/Provider/Properties/SchemaDefinition.ssdl
   trunk/MySql.Data.Entity/Provider/Properties/SchemaMapping.msl
Log:
made changes for SP1 beta.  Schema definition files now pass validation

Modified: trunk/MySql.Data.Entity/Provider/Properties/ProviderManifest.xml
===================================================================
--- trunk/MySql.Data.Entity/Provider/Properties/ProviderManifest.xml	2008-06-02 17:55:55 UTC (rev 1310)
+++ trunk/MySql.Data.Entity/Provider/Properties/ProviderManifest.xml	2008-06-03 21:40:06 UTC (rev 1311)
@@ -10,1300 +10,145 @@
 <ProviderManifest Namespace="MySql" xmlns="http://schemas.microsoft.com/ado/2006/04/edm/providermanifest">
   <Types>
     <Type Name="byte" PrimitiveTypeKind="Byte"/>
-    <Type Name="int16" PrimitiveTypeKind="Int16"/>
-    <Type Name="int32" PrimitiveTypeKind="Int32"/>
+	  <Type Name="smallint" PrimitiveTypeKind="Int16"/>
+<!--    <Type Name="int16" PrimitiveTypeKind="Int16"/>-->
+    <Type Name="int" PrimitiveTypeKind ="Int32"/>
+<!--    <Type Name="int32" PrimitiveTypeKind="Int32"/>-->
     <Type Name="int64" PrimitiveTypeKind="Int64"/>
     <Type Name="float" PrimitiveTypeKind="Single"/>
     <Type Name="double" PrimitiveTypeKind="Double"/>
     <Type Name="decimal" PrimitiveTypeKind="Decimal">
       <FacetDescriptions>
-        <Precision Minimum="1" Maximum="65" Default="10" Constant="false" />
-        <Scale Minimum="0" Maximum="30" Default="0" Constant="false" />
+        <Precision Minimum="1" Maximum="65" DefaultValue="10" Constant="false" />
+        <Scale Minimum="0" Maximum="30" DefaultValue="0" Constant="false" />
       </FacetDescriptions>
     </Type>
     <Type Name="timestamp" PrimitiveTypeKind="Binary">
       <FacetDescriptions>
-        <MaxLength Default="19" Constant="true" />
-        <FixedLength Default="true" Constant="true" />
+        <MaxLength DefaultValue="19" Constant="true" />
+        <FixedLength DefaultValue="true" Constant="true" />
       </FacetDescriptions>
     </Type>
     <Type Name="date" PrimitiveTypeKind="DateTime">
       <FacetDescriptions>
-        <PreserveSeconds Default="true" Constant="true" />
-        <DateTimeKind Default="Unspecified" Constant="true" />
+        <Precision DefaultValue="0" Constant="true" />
       </FacetDescriptions>
     </Type>
     <Type Name="time" PrimitiveTypeKind="Binary">
       <FacetDescriptions>
-        <MaxLength Default="8" Constant="true" />
-        <FixedLength Default="true" Constant="true" />
+        <MaxLength DefaultValue="8" Constant="true" />
+        <FixedLength DefaultValue="true" Constant="true" />
       </FacetDescriptions>
     </Type>
     <Type Name="datetime" PrimitiveTypeKind="DateTime">
       <FacetDescriptions>
-        <PreserveSeconds Default="true" Constant="true" />
-        <DateTimeKind Default="Unspecified" Constant="true" />
+        <Precision DefaultValue="3" Constant="true" />
       </FacetDescriptions>
     </Type>
     <Type Name="nvarchar" PrimitiveTypeKind="String">
       <FacetDescriptions>
         <MaxLength Minimum="1" Maximum="65535" Constant="false" />
-        <Unicode Default="true" Constant="true" />
-        <FixedLength Default="false" Constant="true" />
+        <Unicode DefaultValue="true" Constant="true" />
+        <FixedLength DefaultValue="false" Constant="true" />
       </FacetDescriptions>
     </Type>
     <Type Name="varchar" PrimitiveTypeKind="String">
       <FacetDescriptions>
         <MaxLength Minimum="1" Maximum="65535" Constant="false" />
-        <Unicode Default="false" Constant="true" />
-        <FixedLength Default="false" Constant="true" />
+        <Unicode DefaultValue="false" Constant="true" />
+        <FixedLength DefaultValue="false" Constant="true" />
       </FacetDescriptions>
     </Type>
     <Type Name="char" PrimitiveTypeKind="String">
       <FacetDescriptions>
         <MaxLength Minimum="1" Maximum="255" Constant="false" />
-        <Unicode Default="false" Constant="true" />
-        <FixedLength Default="true" Constant="true" />
+        <Unicode DefaultValue="false" Constant="true" />
+        <FixedLength DefaultValue="true" Constant="true" />
       </FacetDescriptions>
     </Type>
     <Type Name="nchar" PrimitiveTypeKind="String">
       <FacetDescriptions>
         <MaxLength Minimum="1" Maximum="255" Constant="false" />
-        <Unicode Default="true" Constant="true" />
-        <FixedLength Default="true" Constant="true" />
+        <Unicode DefaultValue="true" Constant="true" />
+        <FixedLength DefaultValue="true" Constant="true" />
       </FacetDescriptions>
     </Type>
     <Type Name="binary" PrimitiveTypeKind="Binary">
       <FacetDescriptions>
         <MaxLength Minimum="1" Maximum="255" Constant="false" />
-        <FixedLength Default="true" Constant="true" />
+        <FixedLength DefaultValue="true" Constant="true" />
       </FacetDescriptions>
     </Type>
     <Type Name="varbinary" PrimitiveTypeKind="Binary">
       <FacetDescriptions>
         <MaxLength Minimum="1" Maximum="65535" Constant="false" />
-        <FixedLength Default="false" Constant="true" />
+        <FixedLength DefaultValue="false" Constant="true" />
       </FacetDescriptions>
     </Type>
     <Type Name="bit" PrimitiveTypeKind="Boolean"/>
     <Type Name="tinyblob" PrimitiveTypeKind="Binary" >
       <FacetDescriptions>
-        <MaxLength Default="255" Constant="true" />
-        <FixedLength Default="false" Constant="true" />
+        <MaxLength DefaultValue="255" Constant="true" />
+        <FixedLength DefaultValue="false" Constant="true" />
       </FacetDescriptions>
     </Type>
     <Type Name="blob" PrimitiveTypeKind="Binary" >
       <FacetDescriptions>
-        <MaxLength Default="65535" Constant="true" />
-        <FixedLength Default="false" Constant="true" />
+        <MaxLength DefaultValue="65535" Constant="true" />
+        <FixedLength DefaultValue="false" Constant="true" />
       </FacetDescriptions>
     </Type>
     <Type Name="mediumblob" PrimitiveTypeKind="Binary" >
       <FacetDescriptions>
-        <MaxLength Default="16777215" Constant="true" />
-        <FixedLength Default="false" Constant="true" />
+        <MaxLength DefaultValue="16777215" Constant="true" />
+        <FixedLength DefaultValue="false" Constant="true" />
       </FacetDescriptions>
     </Type>
-    <Type Name="longblob" PrimitiveTypeKind="Binary" >
+	  <Type Name="longblob" PrimitiveTypeKind="Binary" >
       <FacetDescriptions>
-        <MaxLength Default="2147483647" Constant="true" />
-        <FixedLength Default="false" Constant="true" />
+        <MaxLength DefaultValue="2147483647" Constant="true" />
+        <FixedLength DefaultValue="false" Constant="true" />
       </FacetDescriptions>
     </Type>
     <Type Name="tinytext" PrimitiveTypeKind="String" >
       <FacetDescriptions>
-        <MaxLength Default="255" Constant="true" />
-        <Unicode Default="false" Constant="true" />
-        <FixedLength Default="false" Constant="true" />
+        <MaxLength DefaultValue="255" Constant="true" />
+        <Unicode DefaultValue="false" Constant="true" />
+        <FixedLength DefaultValue="false" Constant="true" />
       </FacetDescriptions>
     </Type>
     <Type Name="text" PrimitiveTypeKind="String" >
       <FacetDescriptions>
-        <MaxLength Default="65535" Constant="true" />
-        <Unicode Default="false" Constant="true" />
-        <FixedLength Default="false" Constant="true" />
+        <MaxLength DefaultValue="65535" Constant="true" />
+        <Unicode DefaultValue="false" Constant="true" />
+        <FixedLength DefaultValue="false" Constant="true" />
       </FacetDescriptions>
     </Type>
     <Type Name="mediumtext" PrimitiveTypeKind="String" >
       <FacetDescriptions>
-        <MaxLength Default="16777215" Constant="true" />
-        <Unicode Default="false" Constant="true" />
-        <FixedLength Default="false" Constant="true" />
+        <MaxLength DefaultValue="16777215" Constant="true" />
+        <Unicode DefaultValue="false" Constant="true" />
+        <FixedLength DefaultValue="false" Constant="true" />
       </FacetDescriptions>
     </Type>
-    <Type Name="longtext" PrimitiveTypeKind="String" >
+	  <!--    <Type Name="longtext" PrimitiveTypeKind="String" >
       <FacetDescriptions>
         <MaxLength Default="2147483647" Constant="true" />
         <Unicode Default="false" Constant="true" />
         <FixedLength Default="false" Constant="true" />
       </FacetDescriptions>
-    </Type>
-  </Types>
-  <Functions>
+    </Type>-->
 
-    <!-- BEGIN AGGREGATES ############################################# -->
-    <!-- AVG -->
-    <Function Name="AVG" Aggregate="true" BuiltIn="true">
-      <ReturnType Type="Int32" />
-      <Parameter Name="arg" Type="Collection(Int32)" Mode="In" />
-    </Function>
-    <Function Name="AVG" Aggregate="true" BuiltIn="true">
-      <ReturnType Type="Int64" />
-      <Parameter Name="arg" Type="Collection(Int64)" Mode="In" />
-    </Function>
-    <Function Name="AVG" Aggregate="true" BuiltIn="true">
-      <ReturnType Type="Decimal" />
-      <Parameter Name="arg" Type="Collection(Decimal)" Mode="In" />
-    </Function>
-    <Function Name="AVG" Aggregate="true" BuiltIn="true">
-      <ReturnType Type="Double" />
-      <Parameter Name="arg" Type="Collection(Double)" Mode="In" />
-    </Function>
+	  <Type Name="longtext" PrimitiveTypeKind="String" >
+		  <FacetDescriptions>
+			  <MaxLength DefaultValue="1073741823" Constant="true" />
+			  <Unicode DefaultValue="false" Constant="true" />
+			  <FixedLength DefaultValue="false" Constant="true" />
+		  </FacetDescriptions>
+	  </Type>
 
-    <!-- COUNT -->
-    <Function Name="COUNT" Aggregate="true" BuiltIn="true">
-      <ReturnType Type="Int32" />
-      <Parameter Name="arg" Type="Collection(Boolean)" Mode="In" />
-    </Function>
-    <Function Name="COUNT" Aggregate="true" BuiltIn="true">
-      <ReturnType Type="Int32" />
-      <Parameter Name="arg" Type="Collection(Double)" Mode="In" />
-    </Function>
-    <Function Name="COUNT" Aggregate="true" BuiltIn="true">
-      <ReturnType Type="Int32" />
-      <Parameter Name="arg" Type="Collection(DateTime)" Mode="In" />
-    </Function>
-    <Function Name="COUNT" Aggregate="true" BuiltIn="true">
-      <ReturnType Type="Int32" />
-      <Parameter Name="arg" Type="Collection(Guid)" Mode="In" />
-    </Function>
-    <Function Name="COUNT" Aggregate="true" BuiltIn="true">
-      <ReturnType Type="Int32" />
-      <Parameter Name="arg" Type="Collection(String)" Mode="In" />
-    </Function>
-    <Function Name="COUNT" Aggregate="true" BuiltIn="true">
-      <ReturnType Type="Int32" />
-      <Parameter Name="arg" Type="Collection(Binary)" Mode="In" />
-    </Function>
 
-    <!-- GROUPING !NOT SUPPORTED! -->
-
-    <!-- MAX -->
-    <Function Name="MAX" Aggregate="true" BuiltIn="true">
-      <ReturnType Type="Byte" />
-      <Parameter Name="arg" Type="Collection(Byte)" Mode="In" />
-    </Function>
-    <Function Name="MAX" Aggregate="true" BuiltIn="true">
-      <ReturnType Type="Int16" />
-      <Parameter Name="arg" Type="Collection(Int16)" Mode="In" />
-    </Function>
-    <Function Name="MAX" Aggregate="true" BuiltIn="true">
-      <ReturnType Type="Int32" />
-      <Parameter Name="arg" Type="Collection(Int32)" Mode="In" />
-    </Function>
-    <Function Name="MAX" Aggregate="true" BuiltIn="true">
-      <ReturnType Type="Int64" />
-      <Parameter Name="arg" Type="Collection(Int64)" Mode="In" />
-    </Function>
-    <Function Name="MAX" Aggregate="true" BuiltIn="true">
-      <ReturnType Type="Decimal" />
-      <Parameter Name="arg" Type="Collection(Decimal)" Mode="In" />
-    </Function>
-    <Function Name="MAX" Aggregate="true" BuiltIn="true">
-      <ReturnType Type="Double" />
-      <Parameter Name="arg" Type="Collection(Double)" Mode="In" />
-    </Function>
-    <Function Name="MAX" Aggregate="true" BuiltIn="true">
-      <ReturnType Type="Single" />
-      <Parameter Name="arg" Type="Collection(Single)" Mode="In" />
-    </Function>
-    <Function Name="MAX" Aggregate="true" BuiltIn="true">
-      <ReturnType Type="DateTime" />
-      <Parameter Name="arg" Type="Collection(DateTime)" Mode="In" />
-    </Function>
-    <Function Name="MAX" Aggregate="true" BuiltIn="true">
-      <ReturnType Type="String" />
-      <Parameter Name="arg" Type="Collection(String)" Mode="In" />
-    </Function>
-    <Function Name="MAX" Aggregate="true" BuiltIn="true">
-      <ReturnType Type="Binary" />
-      <Parameter Name="arg" Type="Collection(Binary)" Mode="In" />
-    </Function>
-
-    <!-- MIN -->
-    <Function Name="MIN" Aggregate="true" BuiltIn="true">
-      <ReturnType Type="Byte" />
-      <Parameter Name="arg" Type="Collection(Byte)" Mode="In" />
-    </Function>
-    <Function Name="MIN" Aggregate="true" BuiltIn="true">
-      <ReturnType Type="Int16" />
-      <Parameter Name="arg" Type="Collection(Int16)" Mode="In" />
-    </Function>
-    <Function Name="MIN" Aggregate="true" BuiltIn="true">
-      <ReturnType Type="Int32" />
-      <Parameter Name="arg" Type="Collection(Int32)" Mode="In" />
-    </Function>
-    <Function Name="MIN" Aggregate="true" BuiltIn="true">
-      <ReturnType Type="Int64" />
-      <Parameter Name="arg" Type="Collection(Int64)" Mode="In" />
-    </Function>
-    <Function Name="MIN" Aggregate="true" BuiltIn="true">
-      <ReturnType Type="Decimal" />
-      <Parameter Name="arg" Type="Collection(Decimal)" Mode="In" />
-    </Function>
-    <Function Name="MIN" Aggregate="true" BuiltIn="true">
-      <ReturnType Type="Double" />
-      <Parameter Name="arg" Type="Collection(Double)" Mode="In" />
-    </Function>
-    <Function Name="MIN" Aggregate="true" BuiltIn="true">
-      <ReturnType Type="Single" />
-      <Parameter Name="arg" Type="Collection(Single)" Mode="In" />
-    </Function>
-    <Function Name="MIN" Aggregate="true" BuiltIn="true">
-      <ReturnType Type="DateTime" />
-      <Parameter Name="arg" Type="Collection(DateTime)" Mode="In" />
-    </Function>
-    <Function Name="MIN" Aggregate="true" BuiltIn="true">
-      <ReturnType Type="String" />
-      <Parameter Name="arg" Type="Collection(String)" Mode="In" />
-    </Function>
-    <Function Name="MIN" Aggregate="true" BuiltIn="true">
-      <ReturnType Type="Binary" />
-      <Parameter Name="arg" Type="Collection(Binary)" Mode="In" />
-    </Function>
-
-    <!-- SUM -->
-    <Function Name="SUM" Aggregate="true" BuiltIn="true">
-      <ReturnType Type="Int32" />
-      <Parameter Name="arg" Type="Collection(Int32)" Mode="In" />
-    </Function>
-    <Function Name="SUM" Aggregate="true" BuiltIn="true">
-      <ReturnType Type="Int64" />
-      <Parameter Name="arg" Type="Collection(Int64)" Mode="In" />
-    </Function>
-    <Function Name="SUM" Aggregate="true" BuiltIn="true">
-      <ReturnType Type="Decimal" />
-      <Parameter Name="arg" Type="Collection(Decimal)" Mode="In" />
-    </Function>
-    <Function Name="SUM" Aggregate="true" BuiltIn="true">
-      <ReturnType Type="Double" />
-      <Parameter Name="arg" Type="Collection(Double)" Mode="In" />
-    </Function>
-
-    <!-- STDEV -->
-    <Function Name="STD" Aggregate="true" BuiltIn="true">
-      <ReturnType Type="Double" />
-      <Parameter Name="arg" Type="Collection(Double)" Mode="In" />
-    </Function>
-
-    <!-- STDEVP -->
-    <Function Name="STDEV_POP" Aggregate="true" BuiltIn="true">
-      <ReturnType Type="Double" />
-      <Parameter Name="arg" Type="Collection(Double)" Mode="In" />
-    </Function>
-
-    <!-- VAR -->
-    <Function Name="VARIANCE" Aggregate="true" BuiltIn="true">
-      <ReturnType Type="Double" />
-      <Parameter Name="arg" Type="Collection(Double)" Mode="In" />
-    </Function>
-
-    <!-- VARP -->
-    <Function Name="VAR_POP" Aggregate="true" BuiltIn="true">
-      <ReturnType Type="Double" />
-      <Parameter Name="arg" Type="Collection(Double)" Mode="In" />
-    </Function>
-
-    <!-- END AGGREGATES ############################################# -->
-
-    <!-- BEGIN STRING FUNCTIONS ##################################### -->
-    <!-- ASCII( arg ) 
-                arg1: char, varchar (nvarchar is allowed by SQL server)
-                returns: int   
-        -->
-    <Function Name="ASCII" BuiltIn="true">
-      <ReturnType Type="Int32" />
-      <Parameter Name="arg" Type="String" Unicode="true" Mode="In" />
-    </Function>
-
-    <!-- CHAR( arg )
-                arg: tinyint, *smallint, *int, *bigint
-                returns: char(1)
-        -->
-    <Function Name="CHAR" BuiltIn="true">
-      <ReturnType Type="String" Unicode="false" />
-      <Parameter Name="arg" Type="Int32" Mode="In" />
-    </Function>
-
-    <!-- CHARINDEX( strSearch, strTarget [, startLocation ] )
-                strSearch: character expression
-                strTarget: character expression
-                startLocation: tinyint, smallint, int, bigint
-                returns: int, bigint   
-        -->
-    <Function Name="CHARINDEX" BuiltIn="true">
-      <ReturnType Type="Int32" />
-      <Parameter Name="strSearch" Type="String" Mode="In" />
-      <Parameter Name="strTarget" Type="String" Mode="In" />
-    </Function>
-    <Function Name="CHARINDEX" BuiltIn="true">
-      <ReturnType Type="Int32" />
-      <Parameter Name="strSearch" Type="Binary" Mode="In" />
-      <Parameter Name="strTarget" Type="Binary" Mode="In" />
-    </Function>
-    <Function Name="CHARINDEX" BuiltIn="true">
-      <ReturnType Type="Int32" />
-      <Parameter Name="strSearch" Type="String" Mode="In" />
-      <Parameter Name="strTarget" Type="String" Mode="In" />
-      <Parameter Name="startLocation" Type="Int32" Mode="In" />
-    </Function>
-    <Function Name="CHARINDEX" BuiltIn="true">
-      <ReturnType Type="Int32" />
-      <Parameter Name="strSearch" Type="Binary" Mode="In" />
-      <Parameter Name="strTarget" Type="Binary" Mode="In" />
-      <Parameter Name="startLocation" Type="Int32" Mode="In" />
-    </Function>
-    <Function Name="CHARINDEX" BuiltIn="true">
-      <ReturnType Type="Int64" />
-      <Parameter Name="strSearch" Type="String" Mode="In" />
-      <Parameter Name="strTarget" Type="String" Mode="In" />
-      <Parameter Name="startLocation" Type="Int64" Mode="In" />
-    </Function>
-    <Function Name="CHARINDEX" BuiltIn="true">
-      <ReturnType Type="Int64" />
-      <Parameter Name="strSearch" Type="Binary" Mode="In" />
-      <Parameter Name="strTarget" Type="Binary" Mode="In" />
-      <Parameter Name="startLocation" Type="Int64" Mode="In" />
-    </Function>
-
-    <!-- DIFFERENCE( str1, str2 ) 
-            str1: varchar
-            str2: varchar
-            returns: int   
-        -->
-    <Function Name="DIFFERENCE" BuiltIn="true">
-      <ReturnType Type="Int32" />
-      <Parameter Name="str1" Type="String" Mode="In" />
-      <Parameter Name="str2" Type="String" Mode="In" />
-    </Function>
-    <!-- LEFT( str, count ) 
-                str: char, nchar, varchar, nvarchar, varchar(max), nvarchar(max)
-                count: tinyint, smallint, int, bigint
-                returns: varchar, nvarchar
-        -->
-    <Function Name="LEFT" BuiltIn="true">
-      <ReturnType Type="String" Unicode="false" />
-      <Parameter Name="str" Type="String" Unicode="false" Mode="In" />
-      <Parameter Name="count" Type="Int64" Mode="In" />
-    </Function>
-    <Function Name="LEFT" BuiltIn="true">
-      <ReturnType Type="String" Unicode="true" />
-      <Parameter Name="str" Type="String" Unicode="true" Mode="In" />
-      <Parameter Name="count" Type="Int64" Mode="In" />
-    </Function>
-
-    <!-- LEN( string_expression )
-                string_expression: char, nchar, varchar, nvarchar, varchar(max), nvarchar(max)
-                returns: int, bigint   
-        -->
-    <Function Name="LEN" BuiltIn="true">
-      <ReturnType Type="Int32" />
-      <Parameter Name="string_expression" Type="String" Mode="In" />
-    </Function>
-    <Function Name="LEN" BuiltIn="true">
-      <ReturnType Type="Int32" />
-      <Parameter Name="string_expression" Type="Binary" Mode="In" />
-    </Function>
-
-    <!-- LOWER( str ) 
-            str: char, nchar, varchar, nvarchar, varchar(max), nvarchar(max)
-            returns: varchar, nvarchar   
-        -->
-    <Function Name="LOWER" BuiltIn="true">
-      <ReturnType Type="String" Unicode="false" />
-      <Parameter Name="str" Type="String" Unicode="false" Mode="In" />
-    </Function>
-
-    <Function Name="LOWER" BuiltIn="true">
-      <ReturnType Type="String" Unicode="true" />
-      <Parameter Name="str" Type="String" Unicode="true" Mode="In" />
-    </Function>
-
-
-    <!-- LTRIM( str ) 
-            str: char, nchar, varchar, nvarchar, varchar(max), nvarchar(max)
-            returns: varchar, nvarchar
-        -->
-    <Function Name="LTRIM" BuiltIn="true">
-      <ReturnType Type="String" Unicode="false" />
-      <Parameter Name="str" Type="String" Unicode="false" Mode="In" />
-    </Function>
-    <Function Name="LTRIM" BuiltIn="true">
-      <ReturnType Type="String" Unicode="true" />
-      <Parameter Name="str" Type="String" Unicode="true" Mode="In" />
-    </Function>
-
-    <!-- nchar( ncharCode ) 
-                ncharCode: tinyint, smallint, int, bigint
-                returns: nchar(1)
-        -->
-    <Function Name="NCHAR" BuiltIn="true">
-      <ReturnType Type="String" Unicode="true" />
-      <Parameter Name="arg" Type="Int32" Mode="In" />
-    </Function>
-
-    <!-- PATINDEX( strPattern, strTarget )
-            strPattern: char, nchar, varchar, nvarchar
-            strTarget: char, nchar, varchar, nvarchar, varchar(max), nvarchar(max)
-            returns: int, bigint   
-        -->
-    <Function Name="PATINDEX" BuiltIn="true">
-      <ReturnType Type="Int32" />
-      <Parameter Name="strPattern" Type="String" Mode="In" />
-      <Parameter Name="strTarget" Type="String" Mode="In" />
-    </Function>
-
-    <!-- QUOTENAME( character_string [,quote_character] ) 
-                character_string: nchar, nvarchar, nvarchar(max)
-                quote_character: nchar, char, varchar, nvarchar
-                returns: nvarchar   
-        -->
-    <Function Name="QUOTENAME" BuiltIn="true">
-      <ReturnType Type="String" Unicode="true" />
-      <Parameter Name="character_string" Type="String" Unicode="true" Mode="In" />
-    </Function>
-    <Function Name="QUOTENAME" BuiltIn="true">
-      <ReturnType Type="String" Unicode="true" />
-      <Parameter Name="character_string" Type="String" Unicode="true" Mode="In" />
-      <Parameter Name="quote_character" Type="String" Unicode="true" Mode="In" />
-    </Function>
-
-    <!-- REPLACE( strTarget, strSearch, strReplacement )
-            strTarget: char, nchar, varchar, nvarchar, varchar(max), nvarchar(max)
-            strSearch: char, nchar, varchar, nvarchar, varchar(max), nvarchar(max)
-            strReplacement: char, nchar, varchar, nvarchar, varchar(max), nvarchar(max)
-            returns: varchar, nvarchar   
-        -->
-    <Function Name="REPLACE" BuiltIn="true">
-      <ReturnType Type="String" Unicode="true" />
-      <Parameter Name="strTarget" Type="String" Unicode="true" Mode="In" />
-      <Parameter Name="strSearch" Type="String" Unicode="true" Mode="In" />
-      <Parameter Name="strReplacement" Type="String" Unicode="true" Mode="In" />
-    </Function>
-    <Function Name="REPLACE" BuiltIn="true">
-      <ReturnType Type="String" Unicode="false" />
-      <Parameter Name="strTarget" Type="String" Unicode="false" Mode="In" />
-      <Parameter Name="strSearch" Type="String" Unicode="false" Mode="In" />
-      <Parameter Name="strReplacement" Type="String" Unicode="false" Mode="In" />
-    </Function>
-
-    <!-- REPLICATE( strSource, count )
-            strSource: varchar, nvarchar
-            count: tinyint, smallint, int
-            returns: varchar, nvarchar   
-        -->
-    <Function Name="REPLICATE" BuiltIn="true">
-      <ReturnType Type="String" Unicode="false" />
-      <Parameter Name="strTarget" Type="String" Unicode="false" Mode="In" />
-      <Parameter Name="count" Type="Int32" Mode="In" />
-    </Function>
-    <Function Name="REPLICATE" BuiltIn="true">
-      <ReturnType Type="String" Unicode="true" />
-      <Parameter Name="strTarget" Type="String" Unicode="true" Mode="In" />
-      <Parameter Name="count" Type="Int32" Mode="In" />
-    </Function>
-
-    <!-- REVERSE( arg ) 
-            arg: char, nchar, varchar, nvarchar, varchar(max), nvarchar(max)
-            returns: varchar, nvarchar
-        -->
-    <Function Name="REVERSE" BuiltIn="true">
-      <ReturnType Type="String" Unicode="false" />
-      <Parameter Name="arg" Type="String" Unicode="false" Mode="In" />
-    </Function>
-    <Function Name="REVERSE" BuiltIn="true">
-      <ReturnType Type="String" Unicode="true" />
-      <Parameter Name="arg" Type="String" Unicode="true" Mode="In" />
-    </Function>
-
-    <!-- RIGHT( atr, count ) 
-                str: char, nchar, varchar, nvarchar, varchar(max), nvarchar(max)
-                count: tinyint, smallint, int, bigint
-                returns: varchar, nvarchar
-        -->
-    <Function Name="RIGHT" BuiltIn="true">
-      <ReturnType Type="String" Unicode="false" />
-      <Parameter Name="str" Type="String" Unicode="false" Mode="In" />
-      <Parameter Name="count" Type="Int64" Mode="In" />
-    </Function>
-    <Function Name="RIGHT" BuiltIn="true">
-      <ReturnType Type="String" Unicode="true" />
-      <Parameter Name="str" Type="String" Unicode="true" Mode="In" />
-      <Parameter Name="count" Type="Int64" Mode="In" />
-    </Function>
-
-    <!-- RTRIM( arg1 ) 
-            str: char, nchar, varchar, nvarchar, varchar(max), nvarchar(max)
-            returns: varchar, nvarchar
-        -->
-    <Function Name="RTRIM" BuiltIn="true">
-      <ReturnType Type="String" Unicode="false" />
-      <Parameter Name="str" Type="String" Unicode="false" Mode="In" />
-    </Function>
-    <Function Name="RTRIM" BuiltIn="true">
-      <ReturnType Type="String" Unicode="true" />
-      <Parameter Name="str" Type="String" Unicode="true" Mode="In" />
-    </Function>
-
-    <!-- SOUNDEX( arg ) 
-            arg: char, nchar, varchar, nvarchar, varchar(max), nvarchar(max)
-            returns: varchar   
-        -->
-    <Function Name="SOUNDEX" BuiltIn="true">
-      <ReturnType Type="String" Unicode="false" />
-      <Parameter Name="arg" Type="String" Mode="In" />
-    </Function>
-
-    <!-- SPACE( arg ) 
-            arg: tinyint, smallint, int
-            returns: char   
-        -->
-    <Function Name="SPACE" BuiltIn="true">
-      <ReturnType Type="String" Unicode="false" />
-      <Parameter Name="arg1" Type="Int32" Mode="In" />
-    </Function>
-
-    <!-- STR( number [,length [,decimal]] ) 
-                number: float
-                length: int
-                decimal: int
-                returns: char   
-        -->
-    <Function Name="STR" BuiltIn="true">
-      <ReturnType Type="String" Unicode="false" />
-      <Parameter Name="number" Type="Double" Mode="In" />
-    </Function>
-    <Function Name="STR" BuiltIn="true">
-      <ReturnType Type="String" Unicode="false" />
-      <Parameter Name="number" Type="Double" Mode="In" />
-      <Parameter Name="length" Type="Int32" Mode="In" />
-    </Function>
-    <Function Name="STR" BuiltIn="true">
-      <ReturnType Type="String" Unicode="false" />
-      <Parameter Name="number" Type="Double" Mode="In" />
-      <Parameter Name="length" Type="Int32" Mode="In" />
-      <Parameter Name="decimal" Type="Int32" Mode="In" />
-    </Function>
-
-    <!-- STUFF( strInput, start, length, strReplacement )
-                strInput: varchar, nvarchar
-                start: int
-                legth: int
-                strReplacement: varchar, nvarchar
-                returns: int, bigint   
-        -->
-    <Function Name="STUFF" BuiltIn="true">
-      <ReturnType Type="String" Unicode="false" />
-      <Parameter Name="strInput" Type="String" Unicode="false" Mode="In" />
-      <Parameter Name="start" Type="Int32" Mode="In" />
-      <Parameter Name="length" Type="Int32" Mode="In" />
-      <Parameter Name="strReplacement" Type="String" Unicode="false" Mode="In" />
-    </Function>
-    <Function Name="STUFF" BuiltIn="true">
-      <ReturnType Type="String" Unicode="true" />
-      <Parameter Name="strInput" Type="String" Unicode="true" Mode="In" />
-      <Parameter Name="start" Type="Int32" Mode="In" />
-      <Parameter Name="length" Type="Int32" Mode="In" />
-      <Parameter Name="strReplacement" Type="String" Unicode="true" Mode="In" />
-    </Function>
-
-    <!-- SUBSTRING( str, start, length )
-                str: char, nchar, varchar, nvarchar, varchar(max), nvarchar(max)
-                start: tinyint, smallint, int, bigint
-                length: tinyint, smallint, int, bigint
-                returns: varchar, nvarchar
-        -->
-    <Function Name="SUBSTRING" BuiltIn="true">
-      <ReturnType Type="String" />
-      <Parameter Name="str" Type="String" Mode="In" />
-      <Parameter Name="start" Type="Int64" Mode="In" />
-      <Parameter Name="length" Type="Int64" Mode="In" />
-    </Function>
-    <Function Name="SUBSTRING" BuiltIn="true">
-      <ReturnType Type="Binary" />
-      <Parameter Name="str" Type="Binary" Mode="In" />
-      <Parameter Name="start" Type="Int64" Mode="In" />
-      <Parameter Name="length" Type="Int64" Mode="In" />
-    </Function>
-
-    <!-- UNICODE( arg ) 
-            arg: nchar, nvarchar
-            returns: int   
-        -->
-    <Function Name="UNICODE" BuiltIn="true">
-      <ReturnType Type="Int32" />
-      <Parameter Name="arg" Type="String" Unicode="true" Mode="In" />
-    </Function>
-
-    <!-- UPPER( arg ) 
-                str: char, nchar, varchar, nvarchar, varchar(max), nvarchar(max)
-                returns: varchar, nvarchar   
-        -->
-    <Function Name="UPPER" BuiltIn="true">
-      <ReturnType Type="String" Unicode="true" />
-      <Parameter Name="str" Type="String" Unicode="true" Mode="In" />
-    </Function>
-    <Function Name="UPPER" BuiltIn="true">
-      <ReturnType Type="String" Unicode="false" />
-      <Parameter Name="str" Type="String" Unicode="false" Mode="In" />
-    </Function>
-
-    <!-- END STRING FUNCTIONS ####################################### -->
-
-    <!-- BEGIN MATH FUNCTIONS ####################################### -->
-    <!-- ABS( arg )
-                arg: tinyint, smallint, int, bigint, numeric, decimal, smallmoney, money, real, float
-                returns: tinyint, smallint, int, bigint, numeric, decimal, smallmoney, money, real, float
-        -->
-    <Function Name="ABS" BuiltIn="true">
-      <ReturnType Type="Int32" />
-      <Parameter Name="arg" Type="Int32" Mode="In" />
-    </Function>
-    <Function Name="ABS" BuiltIn="true">
-      <ReturnType Type="Int64" />
-      <Parameter Name="arg" Type="Int64" Mode="In" />
-    </Function>
-    <Function Name="ABS" BuiltIn="true">
-      <ReturnType Type="Decimal" />
-      <Parameter Name="arg" Type="Decimal" Mode="In" />
-    </Function>
-    <Function Name="ABS" BuiltIn="true">
-      <ReturnType Type="Double" />
-      <Parameter Name="arg" Type="Double" Mode="In" />
-    </Function>
-
-    <!-- ACOS( arg )
-                arg: float
-                returns: float   
-        -->
-    <Function Name="ACOS" BuiltIn="true">
-      <ReturnType Type="Double" />
-      <Parameter Name="arg1" Type="Double" Mode="In" />
-    </Function>
-
-    <!-- ASIN( arg )
-                arg: float
-                returns: float   
-        -->
-    <Function Name="ASIN" BuiltIn="true">
-      <ReturnType Type="Double" />
-      <Parameter Name="arg" Type="Double" Mode="In" />
-    </Function>
-
-    <!-- ATAN( arg )
-                arg: float
-                returns: float   
-        -->
-    <Function Name="ATAN" BuiltIn="true">
-      <ReturnType Type="Double" />
-      <Parameter Name="arg" Type="Double" Mode="In" />
-    </Function>
-
-    <!-- ATN2( arg1, arg2 )
-                arg1: float
-                arg2: float
-                returns: float   
-        -->
-    <Function Name="ATN2" BuiltIn="true">
-      <ReturnType Type="Double" />
-      <Parameter Name="arg1" Type="Double" Mode="In" />
-      <Parameter Name="arg2" Type="Double" Mode="In" />
-    </Function>
-
-    <!-- CEILING( arg )
-                arg: smalldatetime, datetime
-                returns: int   
-        -->
-    <Function Name="CEILING" BuiltIn="true">
-      <ReturnType Type="Int32" />
-      <Parameter Name="arg" Type="Int32" Mode="In" />
-    </Function>
-    <Function Name="CEILING" BuiltIn="true">
-      <ReturnType Type="Int64" />
-      <Parameter Name="arg" Type="Int64" Mode="In" />
-    </Function>
-    <Function Name="CEILING" BuiltIn="true">
-      <ReturnType Type="Decimal" />
-      <Parameter Name="arg" Type="Decimal" Mode="In" />
-    </Function>
-    <Function Name="CEILING" BuiltIn="true">
-      <ReturnType Type="Double" />
-      <Parameter Name="arg" Type="Double" Mode="In" />
-    </Function>
-
-    <!-- COS( arg )
-                arg: float
-                returns: float   
-        -->
-    <Function Name="COS" BuiltIn="true">
-      <ReturnType Type="Double" />
-      <Parameter Name="arg" Type="Double" Mode="In" />
-    </Function>
-
-    <!-- COT( arg )
-                arg: float
-                returns: float   
-        -->
-    <Function Name="COT" BuiltIn="true">
-      <ReturnType Type="Double" />
-      <Parameter Name="arg" Type="Double" Mode="In" />
-    </Function>
-
-    <!-- DEGREES( arg )
-                arg: tinyint, smallint, int, bigint, numeric, decimal, smallmoney, money, real, float
-                returns: tinyint, smallint, int, bigint, numeric, decimal, smallmoney, money, real, float
-        -->
-    <Function Name="DEGREES" BuiltIn="true">
-      <ReturnType Type="Int32" />
-      <Parameter Name="arg1" Type="Int32" Mode="In" />
-    </Function>
-    <Function Name="DEGREES" BuiltIn="true">
-      <ReturnType Type="Int64" />
-      <Parameter Name="arg1" Type="Int64" Mode="In" />
-    </Function>
-    <Function Name="DEGREES" BuiltIn="true">
-      <ReturnType Type="Decimal" />
-      <Parameter Name="arg1" Type="Decimal" Mode="In" />
-    </Function>
-    <Function Name="DEGREES" BuiltIn="true">
-      <ReturnType Type="Double" />
-      <Parameter Name="arg1" Type="Double" Mode="In" />
-    </Function>
-
-    <!-- EXP( arg )
-                arg: float
-                returns: float   
-        -->
-    <Function Name="EXP" BuiltIn="true">
-      <ReturnType Type="Double" />
-      <Parameter Name="arg" Type="Double" Mode="In" />
-    </Function>
-
-    <!-- FLOOR( arg )
-                arg: tinyint, smallint, int, bigint, numeric, decimal, smallmoney, money, real, float
-                returns: tinyint, smallint, int, bigint, numeric, decimal, smallmoney, money, real, float
-        -->
-    <Function Name="FLOOR" BuiltIn="true">
-      <ReturnType Type="Int32" />
-      <Parameter Name="arg" Type="Int32" Mode="In" />
-    </Function>
-    <Function Name="FLOOR" BuiltIn="true">
-      <ReturnType Type="Int64" />
-      <Parameter Name="arg" Type="Int64" Mode="In" />
-    </Function>
-    <Function Name="FLOOR" BuiltIn="true">
-      <ReturnType Type="Decimal" />
-      <Parameter Name="arg" Type="Decimal" Mode="In" />
-    </Function>
-    <Function Name="FLOOR" BuiltIn="true">
-      <ReturnType Type="Double" />
-      <Parameter Name="arg" Type="Double" Mode="In" />
-    </Function>
-
-    <!-- LOG( arg )
-            arg: float
-            returns: float   
-        -->
-    <Function Name="LOG" BuiltIn="true">
-      <ReturnType Type="Double" />
-      <Parameter Name="arg" Type="Double" Mode="In" />
-    </Function>
-
-    <!-- LOG10( arg )
-                arg: float
-                returns: float   
-        -->
-    <Function Name="LOG10" BuiltIn="true">
-      <ReturnType Type="Double" />
-      <Parameter Name="arg" Type="Double" Mode="In" />
-    </Function>
-
-    <!-- PI( )
-                returns: float   
-        -->
-    <Function Name="PI" BuiltIn="true">
-      <ReturnType Type="Double" />
-    </Function>
-
-    <!-- POWER( x, y )
-                x: tinyint, smallint, int, bigint, numeric, decimal, smallmoney, money, real, float
-                y: tinyint, smallint, int, bigint, numeric, decimal, smallmoney, money, real, float
-                returns: tinyint, smallint, int, bigint, numeric, decimal, smallmoney, money, real, float
-        -->
-    <Function Name="POWER" BuiltIn="true">
-      <ReturnType Type="Int32" />
-      <Parameter Name="x" Type="Int32" Mode="In" />
-      <Parameter Name="y" Type="Double" Mode="In" />
-    </Function>
-    <Function Name="POWER" BuiltIn="true">
-      <ReturnType Type="Int64" />
-      <Parameter Name="x" Type="Int64" Mode="In" />
-      <Parameter Name="y" Type="Double" Mode="In" />
-    </Function>
-    <Function Name="POWER" BuiltIn="true">
-      <ReturnType Type="Decimal" />
-      <Parameter Name="x" Type="Decimal" Mode="In" />
-      <Parameter Name="y" Type="Double" Mode="In" />
-    </Function>
-    <Function Name="POWER" BuiltIn="true">
-      <ReturnType Type="Double" />
-      <Parameter Name="x" Type="Double" Mode="In" />
-      <Parameter Name="y" Type="Double" Mode="In" />
-    </Function>
-
-    <!-- RADIANS( arg )
-                arg: tinyint, smallint, int, bigint, numeric, decimal, smallmoney, money, real, float
-                returns: tinyint, smallint, int, bigint, numeric, decimal, smallmoney, money, real, float
-        -->
-    <Function Name="RADIANS" BuiltIn="true">
-      <ReturnType Type="Int32" />
-      <Parameter Name="arg" Type="Int32" Mode="In" />
-    </Function>
-    <Function Name="RADIANS" BuiltIn="true">
-      <ReturnType Type="Int64" />
-      <Parameter Name="arg" Type="Int64" Mode="In" />
-    </Function>
-    <Function Name="RADIANS" BuiltIn="true">
-      <ReturnType Type="Decimal" />
-      <Parameter Name="arg" Type="Decimal" Mode="In" />
-    </Function>
-    <Function Name="RADIANS" BuiltIn="true">
-      <ReturnType Type="Double" />
-      <Parameter Name="arg" Type="Double" Mode="In" />
-    </Function>
-
-    <!-- RAND( [seed] )
-                seed: tinyint, smallint, int
-                returns: float
-        -->
-    <Function Name="RAND" BuiltIn="true">
-      <ReturnType Type="Double" />
-    </Function>
-    <Function Name="RAND" BuiltIn="true">
-      <ReturnType Type="Double" />
-      <Parameter Name="seed" Type="Int32" Mode="In" />
-    </Function>
-
-    <!-- ROUND( numeric_expression, length [ ,function ] )
-                numeric_expression: tinyint, smallint, int, bigint, numeric, decimal, smallmoney, money, real, float
-                length: tinyint, smallint, int
-                function: tinyint, smallint, int
-                returns: tinyint, smallint, int, bigint, numeric, decimal, smallmoney, money, real, float
-        -->
-    <Function Name="ROUND" BuiltIn="true">
-      <ReturnType Type="Int32" />
-      <Parameter Name="numeric_expression" Type="Int32" Mode="In" />
-      <Parameter Name="length" Type="Int32" Mode="In" />
-    </Function>
-    <Function Name="ROUND" BuiltIn="true">
-      <ReturnType Type="Int64" />
-      <Parameter Name="numeric_expression" Type="Int64" Mode="In" />
-      <Parameter Name="length" Type="Int32" Mode="In" />
-    </Function>
-    <Function Name="ROUND" BuiltIn="true">
-      <ReturnType Type="Decimal" />
-      <Parameter Name="numeric_expression" Type="Decimal" Mode="In" />
-      <Parameter Name="length" Type="Int32" Mode="In" />
-    </Function>
-    <Function Name="ROUND" BuiltIn="true">
-      <ReturnType Type="Double" />
-      <Parameter Name="numeric_expression" Type="Double" Mode="In" />
-      <Parameter Name="length" Type="Int32" Mode="In" />
-    </Function>
-    <Function Name="ROUND" BuiltIn="true">
-      <ReturnType Type="Int32" />
-      <Parameter Name="numeric_expression" Type="Int32" Mode="In" />
-      <Parameter Name="length" Type="Int32" Mode="In" />
-      <Parameter Name="function" Type="Int32" Mode="In" />
-    </Function>
-    <Function Name="ROUND" BuiltIn="true">
-      <ReturnType Type="Int64" />
-      <Parameter Name="numeric_expression" Type="Int64" Mode="In" />
-      <Parameter Name="length" Type="Int32" Mode="In" />
-      <Parameter Name="function" Type="Int32" Mode="In" />
-    </Function>
-    <Function Name="ROUND" BuiltIn="true">
-      <ReturnType Type="Decimal" />
-      <Parameter Name="numeric_expression" Type="Decimal" Mode="In" />
-      <Parameter Name="length" Type="Int32" Mode="In" />
-      <Parameter Name="function" Type="Int32" Mode="In" />
-    </Function>
-    <Function Name="ROUND" BuiltIn="true">
-      <ReturnType Type="Double" />
-      <Parameter Name="numeric_expression" Type="Double" Mode="In" />
-      <Parameter Name="length" Type="Int32" Mode="In" />
-      <Parameter Name="function" Type="Int32" Mode="In" />
-    </Function>
-
-    <!-- SIGN( arg )
-            arg: tinyint, smallint, int, bigint, numeric, decimal, smallmoney, money, real, float
-            returns: bigint, numeric, decimal, money, float
-        -->
-    <Function Name="SIGN" BuiltIn="true">
-      <ReturnType Type="Int32" />
-      <Parameter Name="arg" Type="Int32" Mode="In" />
-    </Function>
-    <Function Name="SIGN" BuiltIn="true">
-      <ReturnType Type="Int64" />
-      <Parameter Name="arg" Type="Int64" Mode="In" />
-    </Function>
-    <Function Name="SIGN" BuiltIn="true">
-      <ReturnType Type="Decimal" />
-      <Parameter Name="arg" Type="Decimal" Mode="In" />
-    </Function>
-    <Function Name="SIGN" BuiltIn="true">
-      <ReturnType Type="Double" />
-      <Parameter Name="arg" Type="Double" Mode="In" />
-    </Function>
-
-    <!-- SIN( arg )
-                arg: float
-                returns: float   
-        -->
-    <Function Name="SIN" BuiltIn="true">
-      <ReturnType Type="Double" />
-      <Parameter Name="arg" Type="Double" Mode="In" />
-    </Function>
-
-    <!-- SQRT( arg )
-                arg: float
-                returns: float   
-        -->
-    <Function Name="SQRT" BuiltIn="true">
-      <ReturnType Type="Double" />
-      <Parameter Name="arg" Type="Double" Mode="In" />
-    </Function>
-
-    <!-- SQUARE( arg )
-                arg: smalldatetime, datetime
-                returns: int   
-        -->
-    <Function Name="SQUARE" BuiltIn="true">
-      <ReturnType Type="Double" />
-      <Parameter Name="arg1" Type="Double" Mode="In" />
-    </Function>
-
-    <!-- TAN( arg )
-                arg: float
-                returns: float   
-        -->
-    <Function Name="TAN" BuiltIn="true">
-      <ReturnType Type="Double" />
-      <Parameter Name="arg" Type="Double" Mode="In" />
-    </Function>
-    <!-- END MATH FUNCTIONS ######################################### -->
-
-
-    <!-- BEGIN DATE FUNCTIONS ####################################### -->
-    <!-- DATEADD 
-                datepart: nvarchar
-                number: tinyint, smallint, int, bigint, numeric, decimal, real, float
-                date: smalldatetime, datetime, varchar, nvarchar, char, nchar
-                returns: SMALLTIME, datetime   
-        -->
-    <Function Name="DATEADD" BuiltIn="true">
-      <ReturnType Type="DateTime" />
-      <Parameter Name="datepart" Type="String" Mode="In" />
-      <Parameter Name="number" Type="Double" Mode="In" />
-      <Parameter Name="date" Type="DateTime" Mode="In" />
-    </Function>
-    <Function Name="DATEADD" BuiltIn="true">
-      <ReturnType Type="DateTime" />
-      <Parameter Name="datepart" Type="String" Mode="In" />
-      <Parameter Name="number" Type="Double" Mode="In" />
-      <Parameter Name="date" Type="String" Mode="In" />
-    </Function>
-
-    <!-- DATEDIFF( datepart, startdate, enddate )
-                datepart: nvarchar
-                startdate: smalldatetime, datetime, char, nchar, varchar, nvarchar
-                enddate: smalldatetime, datetime, char, nchar, varchar, nvarchar
-                returns: int   
-        -->
-    <Function Name="DATEDIFF" BuiltIn="true">
-      <ReturnType Type="Int32" />
-      <Parameter Name="datepart" Type="String" Mode="In" />
-      <Parameter Name="startdate" Type="DateTime" Mode="In" />
-      <Parameter Name="enddate" Type="DateTime" Mode="In" />
-    </Function>
-    <Function Name="DATEDIFF" BuiltIn="true">
-      <ReturnType Type="Int32" />
-      <Parameter Name="datepart" Type="String" Mode="In" />
-      <Parameter Name="startdate" Type="String" Mode="In" />
-      <Parameter Name="enddate" Type="DateTime" Mode="In" />
-    </Function>
-    <Function Name="DATEDIFF" BuiltIn="true">
-      <ReturnType Type="Int32" />
-      <Parameter Name="datepart" Type="String" Mode="In" />
-      <Parameter Name="startdate" Type="DateTime" Mode="In" />
-      <Parameter Name="enddate" Type="String" Mode="In" />
-    </Function>
-    <Function Name="DATEDIFF" BuiltIn="true">
-      <ReturnType Type="Int32" />
-      <Parameter Name="datepart" Type="String" Mode="In" />
-      <Parameter Name="startdate" Type="String" Mode="In" />
-      <Parameter Name="enddate" Type="String" Mode="In" />
-    </Function>
-
-    <!-- DATENAME( datepart, date )
-            datepart: nvarchar
-            date: smalldatetime, datetime, char, nchar, varchar, nvarchar
-            returns: nvarchar   
-        -->
-    <Function Name="DATENAME" BuiltIn="true">
-      <ReturnType Type="String" />
-      <Parameter Name="datepart" Type="String" Mode="In" />
-      <Parameter Name="date" Type="DateTime" Mode="In" />
-    </Function>
-    <Function Name="DATENAME" BuiltIn="true">
-      <ReturnType Type="String" />
-      <Parameter Name="datepart" Type="String" Mode="In" />
-      <Parameter Name="date" Type="String" Mode="In" />
-    </Function>
-
-    <!-- DATEPART( datepart, date )
-                datepart: nvarchar
-                date: smalldatetime, datetime, char, nchar, varchar, nvarchar
-                returns: int   
-        -->
-    <Function Name="DATEPART" BuiltIn="true">
-      <ReturnType Type="Int32" />
-      <Parameter Name="datepart" Type="String" Mode="In" />
-      <Parameter Name="date" Type="DateTime" Mode="In" />
-    </Function>
-    <Function Name="DATEPART" BuiltIn="true">
-      <ReturnType Type="Int32" />
-      <Parameter Name="datepart" Type="String" Mode="In" />
-      <Parameter Name="date" Type="String" Mode="In" />
-    </Function>
-
-    <!-- DAY( date )
-            date: smalldatetime, datetime
-            returns: int   
-        -->
-    <Function Name="DAY" BuiltIn="true">
-      <ReturnType Type="Int32" />
-      <Parameter Name="date" Type="DateTime" Mode="In" />
-    </Function>
-    <Function Name="DAY" BuiltIn="true">
-      <ReturnType Type="Int32" />
-      <Parameter Name="date" Type="String" Mode="In" />
-    </Function>
-
-    <!-- GETDATE()
-            returns: datetime   
-        -->
-    <Function Name="GETDATE" BuiltIn="true">
-      <ReturnType Type="DateTime" PreserveSeconds="true" />
-    </Function>
-
-
-    <!-- GETUTCDATE()
-            returns: datetime   
-        -->
-    <Function Name="GETUTCDATE" BuiltIn="true">
-      <ReturnType Type="DateTime" PreserveSeconds="true" />
-    </Function>
-
-    <!-- MONTH( date )
-                date: smalldatetime, datetime
-                returns: int   
-        -->
-    <Function Name="MONTH" BuiltIn="true">
-      <ReturnType Type="Int32" />
-      <Parameter Name="date" Type="DateTime" Mode="In" />
-    </Function>
-    <Function Name="MONTH" BuiltIn="true">
-      <ReturnType Type="Int32" />
-      <Parameter Name="date" Type="String" Mode="In" />
-    </Function>
-
-    <!-- YEAR( date )
-            date: smalldatetime, datetime
-            returns: int   
-        -->
-    <Function Name="YEAR" BuiltIn="true">
-      <ReturnType Type="Int32" />
-      <Parameter Name="date" Type="DateTime" Mode="In" />
-    </Function>
-    <Function Name="YEAR" BuiltIn="true">
-      <ReturnType Type="Int32" />
-      <Parameter Name="date" Type="String" Mode="In" />
-    </Function>
-    <!-- END DATE FUNCTIONS ######################################### -->
-
-    <!-- BEGIN SYSTEM FUNCTIONS ##################################### -->
-    <!-- DATALENGTH( arg ) 
-                arg: any
-                returns: int, bigint  
-        -->
-    <Function Name="DATALENGTH" BuiltIn="true" ParameterTypeSemantics="AllowImplicitPromotion">
-      <ReturnType Type="Int32" />
-      <Parameter Name="arg" Type="Boolean" Mode="In" />
-    </Function>
-    <Function Name="DATALENGTH" BuiltIn="true" ParameterTypeSemantics="AllowImplicitPromotion">
-      <ReturnType Type="Int32" />
-      <Parameter Name="arg" Type="Double" Mode="In" />
-    </Function>
-    <Function Name="DATALENGTH" BuiltIn="true" ParameterTypeSemantics="AllowImplicitPromotion">
-      <ReturnType Type="Int32" />
-      <Parameter Name="arg" Type="DateTime" Mode="In" />
-    </Function>
-    <Function Name="DATALENGTH" BuiltIn="true" ParameterTypeSemantics="AllowImplicitPromotion">
-      <ReturnType Type="Int32" />
-      <Parameter Name="arg" Type="String" Mode="In" />
-    </Function>
-    <Function Name="DATALENGTH" BuiltIn="true" ParameterTypeSemantics="AllowImplicitPromotion">
-      <ReturnType Type="Int32" />
-      <Parameter Name="arg" Type="Binary" Mode="In" />
-    </Function>
-    <Function Name="DATALENGTH" BuiltIn="true" ParameterTypeSemantics="AllowImplicitPromotion">
-      <ReturnType Type="Int32" />
-      <Parameter Name="arg" Type="Guid" Mode="In" />
-    </Function>
-
-    <!-- CHECKSUM -->
-    <Function Name="CHECKSUM" BuiltIn="true">
-      <ReturnType Type="Int32" />
-      <Parameter Name="arg1" Type="Boolean" Mode="In" />
-    </Function>
-    <Function Name="CHECKSUM" BuiltIn="true">
-      <ReturnType Type="Int32" />
-      <Parameter Name="arg1" Type="Double" Mode="In" />
-    </Function>
-    <Function Name="CHECKSUM" BuiltIn="true">
-      <ReturnType Type="Int32" />
-      <Parameter Name="arg1" Type="String" Mode="In" />
-    </Function>
-    <Function Name="CHECKSUM" BuiltIn="true">
-      <ReturnType Type="Int32" />
-      <Parameter Name="arg1" Type="DateTime" Mode="In" />
-    </Function>
-    <Function Name="CHECKSUM" BuiltIn="true">
-      <ReturnType Type="Int32" />
-      <Parameter Name="arg1" Type="Binary" Mode="In" />
-    </Function>
-    <Function Name="CHECKSUM" BuiltIn="true">
-      <ReturnType Type="Int32" />
-      <Parameter Name="arg1" Type="Guid" Mode="In" />
-    </Function>
-    <Function Name="CHECKSUM" BuiltIn="true">
-      <ReturnType Type="Int32" />
-      <Parameter Name="arg1" Type="Boolean" Mode="In" />
-      <Parameter Name="arg2" Type="Boolean" Mode="In" />
-    </Function>
-    <Function Name="CHECKSUM" BuiltIn="true">
-      <ReturnType Type="Int32" />
-      <Parameter Name="arg1" Type="Double" Mode="In" />
-      <Parameter Name="arg2" Type="Double" Mode="In" />
-    </Function>
-    <Function Name="CHECKSUM" BuiltIn="true">
-      <ReturnType Type="Int32" />
-      <Parameter Name="arg1" Type="String" Mode="In" />
-      <Parameter Name="arg2" Type="String" Mode="In" />
-    </Function>
-    <Function Name="CHECKSUM" BuiltIn="true">
-      <ReturnType Type="Int32" />
-      <Parameter Name="arg1" Type="DateTime" Mode="In" />
-      <Parameter Name="arg2" Type="DateTime" Mode="In" />
-    </Function>
-    <Function Name="CHECKSUM" BuiltIn="true">
-      <ReturnType Type="Int32" />
-      <Parameter Name="arg1" Type="Binary" Mode="In" />
-      <Parameter Name="arg2" Type="Binary" Mode="In" />
-    </Function>
-    <Function Name="CHECKSUM" BuiltIn="true">
-      <ReturnType Type="Int32" />
-      <Parameter Name="arg1" Type="Guid" Mode="In" />
-      <Parameter Name="arg2" Type="Guid" Mode="In" />
-    </Function>
-    <Function Name="CHECKSUM" BuiltIn="true">
-      <ReturnType Type="Int32" />
-      <Parameter Name="arg1" Type="Boolean" Mode="In" />
-      <Parameter Name="arg2" Type="Boolean" Mode="In" />
-      <Parameter Name="arg3" Type="Boolean" Mode="In" />
-    </Function>
-    <Function Name="CHECKSUM" BuiltIn="true">
-      <ReturnType Type="Int32" />
-      <Parameter Name="arg1" Type="Double" Mode="In" />
-      <Parameter Name="arg2" Type="Double" Mode="In" />
-      <Parameter Name="arg3" Type="Double" Mode="In" />
-    </Function>
-    <Function Name="CHECKSUM" BuiltIn="true">
-      <ReturnType Type="Int32" />
-      <Parameter Name="arg1" Type="String" Mode="In" />
-      <Parameter Name="arg2" Type="String" Mode="In" />
-      <Parameter Name="arg3" Type="String" Mode="In" />
-    </Function>
-    <Function Name="CHECKSUM" BuiltIn="true">
-      <ReturnType Type="Int32" />
-      <Parameter Name="arg1" Type="DateTime" Mode="In" />
-      <Parameter Name="arg2" Type="DateTime" Mode="In" />
-      <Parameter Name="arg3" Type="DateTime" Mode="In" />
-    </Function>
-    <Function Name="CHECKSUM" BuiltIn="true">
-      <ReturnType Type="Int32" />
-      <Parameter Name="arg1" Type="Binary" Mode="In" />
-      <Parameter Name="arg2" Type="Binary" Mode="In" />
-      <Parameter Name="arg3" Type="Binary" Mode="In" />
-    </Function>
-    <Function Name="CHECKSUM" BuiltIn="true">
-      <ReturnType Type="Int32" />
-      <Parameter Name="arg1" Type="Guid" Mode="In" />
-      <Parameter Name="arg2" Type="Guid" Mode="In" />
-      <Parameter Name="arg3" Type="Guid" Mode="In" />
-    </Function>
-
-    <!-- NEWID() -->
-    <Function Name="NEWID" BuiltIn="true">
-      <ReturnType Type="Guid" />
-    </Function>
-
-    <!-- CURRENT_TIMESTAMP -->
-    <Function Name="CURRENT_TIMESTAMP" BuiltIn="true" NiladicFunction="true">
-      <ReturnType Type="DateTime" PreserveSeconds="true" />
-    </Function>
-
-    <!-- CURRENT_USER -->
-    <Function Name="CURRENT_USER" BuiltIn="true" NiladicFunction="true">
-      <ReturnType Type="String" Unicode="false" />
-    </Function>
-
-    <!-- HOST_NAME() -->
-    <Function Name="HOST_NAME" BuiltIn="true">
-      <ReturnType Type="String" Unicode="true" />
-    </Function>
-
-    <!-- USER_NAME() -->
-    <Function Name="USER_NAME" BuiltIn="true">
-      <ReturnType Type="String" Unicode="true" />
-      <Parameter Name="arg" Type="Int32" Mode="In" />
-    </Function>
-    <Function Name="USER_NAME" BuiltIn="true">
-      <ReturnType Type="String" Unicode="true" />
-    </Function>
-
-    <!-- ISNUMERIC( arg ) //implicit conversion -->
-    <Function Name="ISNUMERIC" BuiltIn="true">
-      <ReturnType Type="Int32" />
-      <Parameter Name="arg" Type="String" Mode="In" />
-    </Function>
-
-    <!-- ISDATE( arg ) //implicit conversion -->
-    <Function Name="ISDATE" BuiltIn="true">
-      <ReturnType Type="Int32" />
-      <Parameter Name="arg" Type="String" Mode="In" />
-    </Function>
-    <!-- END SYSTEM FUNCTIONS ####################################### -->
+  </Types>
+  <Functions>
   </Functions>
 </ProviderManifest>

Modified: trunk/MySql.Data.Entity/Provider/Properties/SchemaDefinition.ssdl
===================================================================
--- trunk/MySql.Data.Entity/Provider/Properties/SchemaDefinition.ssdl	2008-06-02 17:55:55 UTC (rev 1310)
+++ trunk/MySql.Data.Entity/Provider/Properties/SchemaDefinition.ssdl	2008-06-03 21:40:06 UTC (rev 1311)
@@ -1,35 +1,55 @@
 <?xml version="1.0" encoding="utf-8"?>
-<Schema Namespace="MySqlClient" Alias="Self" xmlns="http://schemas.microsoft.com/ado/2006/04/edm/ssdl">
+<Schema Namespace="MySqlClient" 
+        Provider="MySql.Data.MySqlClient"
+        ProviderManifestToken="5"
+        Alias="Self" 
+        xmlns="http://schemas.microsoft.com/ado/2006/04/edm/ssdl">
   <EntityContainer Name="Schema">
     
     <EntitySet Name="STables" EntityType="Self.Table">
       <DefiningQuery>
-        SELECT
-            TABLE_CATALOG as Catalog
-        ,   TABLE_SCHEMA  as Schema
-        ,   TABLE_NAME    as Name
-        FROM
-        INFORMATION_SCHEMA.TABLES
-        WHERE
-        TABLE_TYPE = 'BASE TABLE'
-      </DefiningQuery>
+		  SELECT
+		  CONCAT('`', TABLE_SCHEMA, '`.`', TABLE_NAME, '`') `Id`
+		  ,   TABLE_CATALOG as `Catalog`
+		  ,   TABLE_SCHEMA  as `Schema`
+		  ,   TABLE_NAME    as `Name`
+		  FROM
+		  INFORMATION_SCHEMA.TABLES
+		  WHERE
+		  TABLE_TYPE = 'BASE TABLE'
+	  </DefiningQuery>
     </EntitySet>
     
     <EntitySet Name="STableColumns" EntityType="Self.TableColumn">
       <DefiningQuery>
         SELECT
-        ,   c.COLUMN_NAME      as Name
-        ,   c.ORDINAL_POSITION as Ordinal
-        ,   CAST( CASE c.IS_NULLABLE WHEN 'YES' THEN 1 WHEN 'NO' THEN 0 ELSE 0 END as bit) as IsNullable
-        ,   c.DATA_TYPE as TypeName
-        ,   c.CHARACTER_MAXIMUM_LENGTH as MaxLength
-        ,   c.NUMERIC_PRECISION as Precision
-        ,   c.NUMERIC_SCALE as Scale
-<!--        ,   columnproperty( object_id('[' + c.TABLE_SCHEMA + ']' + '.' + '[' + c.TABLE_NAME + ']'), c.COLUMN_NAME, 'IsIdentity' )
-        as [IsIdentity]
-        ,   columnproperty( object_id('[' + c.TABLE_SCHEMA + ']' + '.' + '[' + c.TABLE_NAME + ']'), c.COLUMN_NAME, 'IsComputed' ) |
-        CASE WHEN c.DATA_TYPE = 'timestamp' THEN 1 ELSE 0 END
-        as [IsStoreGenerated]-->
+        CONCAT('`', c.TABLE_SCHEMA, '`.`', c.TABLE_NAME, '`.`', c.COLUMN_NAME, '`') `Id`
+        ,   CONCAT('`', c.TABLE_SCHEMA, '`.`', c.TABLE_NAME, '`') `ParentId`
+        ,   c.COLUMN_NAME      as `Name`
+        ,   c.ORDINAL_POSITION as `Ordinal`
+        ,   CASE c.IS_NULLABLE WHEN 'YES' THEN 1 WHEN 'NO' THEN 0 ELSE 0 END as IsNullable
+        ,   CASE
+        WHEN c.DATA_TYPE in ('varchar', 'nvarchar', 'varbinary') and
+        c.CHARACTER_MAXIMUM_LENGTH = -1 THEN
+        c.DATA_TYPE + '(max)'
+        ELSE
+        c.DATA_TYPE
+        END
+        as `TypeName`
+        ,   c.CHARACTER_MAXIMUM_LENGTH as `MaxLength`
+        ,   c.NUMERIC_PRECISION as `Precision`
+        ,   0 AS `DateTimePrecision`
+        ,   c.NUMERIC_SCALE as `Scale`
+        ,   NULL AS `CollationCatalog`
+        ,   NULL AS `CollationSchema`
+        ,   c.COLLATION_NAME as `CollationName`
+        ,   NULL AS `CharacterSetCatalog`
+        ,   NULL AS `CharacterSetSchema`
+        ,   c.CHARACTER_SET_NAME as `CharacterSetName`
+        ,   0 AS `IsMultiSet`
+        ,   0 AS `IsIdentity`
+        ,   0 AS `IsStoreGenerated`
+        ,   c.COLUMN_DEFAULT as `Default`
         FROM
         INFORMATION_SCHEMA.COLUMNS c
         INNER JOIN
@@ -44,11 +64,12 @@
     <EntitySet Name="SViews" EntityType="Self.View">
       <DefiningQuery>
         SELECT
-            TABLE_CATALOG   as `Catalog`
-        ,   TABLE_SCHEMA    as `Schema`
-        ,   TABLE_NAME      as `Name`
-        ,   VIEW_DEFINITION as ViewDefinition
-        ,   CASE IS_UPDATABLE WHEN 'YES' THEN 1 WHEN 'NO' THEN 0 ELSE 0 END as IsUpdatable
+        CONCAT('`', TABLE_SCHEMA, '`.`', TABLE_NAME, '`') `Id`
+        ,   TABLE_CATALOG             `CatalogName`
+        ,   TABLE_SCHEMA              `SchemaName`
+        ,   TABLE_NAME                `Name`
+        ,   VIEW_DEFINITION           `ViewDefinition`
+        ,   CASE IS_UPDATABLE WHEN 'YES' THEN 1 WHEN 'NO' THEN 0 ELSE 0 END `IsUpdatable`
         FROM
         INFORMATION_SCHEMA.VIEWS
       </DefiningQuery>
@@ -57,9 +78,11 @@
     <EntitySet Name="SViewColumns" EntityType="Self.ViewColumn">
       <DefiningQuery>
         SELECT
-            c.COLUMN_NAME   [Name]
-        ,   c.ORDINAL_POSITION [Ordinal]
-        ,   CAST( CASE c.IS_NULLABLE WHEN 'YES' THEN 1 WHEN 'NO' THEN 0 ELSE 0 END as bit) [IsNullable]
+        CONCAT('`', c.TABLE_SCHEMA, '`.`', c.TABLE_NAME, '`.`', c.COLUMN_NAME, '`') `Id`
+        ,   CONCAT('`', c.TABLE_SCHEMA, '`.`', c.TABLE_NAME, '`') `ParentId`
+        ,   c.COLUMN_NAME   `Name`
+        ,   c.ORDINAL_POSITION `Ordinal`
+        ,   CASE c.IS_NULLABLE WHEN 'YES' THEN 1 WHEN 'NO' THEN 0 ELSE 0 END as IsNullable
         ,   CASE
         WHEN c.DATA_TYPE in ('varchar', 'nvarchar', 'varbinary') and
         c.CHARACTER_MAXIMUM_LENGTH = -1 THEN
@@ -67,15 +90,21 @@
         ELSE
         c.DATA_TYPE
         END
-        as [TypeName]
-        ,   c.CHARACTER_MAXIMUM_LENGTH [MaxLength]
-        ,   c.NUMERIC_PRECISION [Precision]
-        ,   c.NUMERIC_SCALE [Scale]
-        ,   columnproperty( object_id('[' + c.TABLE_SCHEMA + ']' + '.' + '[' + c.TABLE_NAME + ']'), c.COLUMN_NAME, 'IsIdentity' )
-        as [IsIdentity]
-        ,   columnproperty( object_id('[' + c.TABLE_SCHEMA + ']' + '.' + '[' + c.TABLE_NAME + ']'), c.COLUMN_NAME, 'IsComputed' ) |
-        CASE WHEN c.DATA_TYPE = 'timestamp' THEN 1 ELSE 0 END
-        as [IsStoreGenerated]
+        as `TypeName`
+        ,   c.CHARACTER_MAXIMUM_LENGTH `MaxLength`
+        ,   c.NUMERIC_PRECISION `Precision`
+        ,   0 AS `DateTimePrecision`
+        ,   c.NUMERIC_SCALE `Scale`
+        ,   NULL AS `CollationCatalog`
+        ,   NULL AS `CollationSchema`
+        ,   c.COLLATION_NAME `CollationName`
+        ,   NULL AS `CharacterSetCatalog`
+        ,   NULL AS `CharacterSetSchema`
+        ,   c.CHARACTER_SET_NAME `CharacterSetName`
+        ,   0 AS `IsMultiSet`
+        ,   0 AS `IsIdentity`
+        ,   0 AS `IsStoreGenerated`
+        ,   c.COLUMN_DEFAULT `Default`
         FROM
         INFORMATION_SCHEMA.COLUMNS c
         INNER JOIN
@@ -83,49 +112,174 @@
         c.TABLE_CATALOG = v.TABLE_CATALOG AND
         c.TABLE_SCHEMA = v.TABLE_SCHEMA AND
         c.TABLE_NAME = v.TABLE_NAME
+      </DefiningQuery>
+    </EntitySet>
+
+    <EntitySet Name="SFunctions" EntityType="Self.Function">
+      <DefiningQuery>
+        SELECT
+        CONCAT('`', ROUTINE_SCHEMA, '`.`', ROUTINE_NAME, '`') `Id`
+        , ROUTINE_CATALOG         `CatalogName`
+        , ROUTINE_SCHEMA          `SchemaName`
+        , ROUTINE_NAME            `Name`
+        FROM
+        INFORMATION_SCHEMA.ROUTINES
         WHERE
-        NOT (v.TABLE_SCHEMA = 'dbo'
-        AND v.TABLE_NAME in('syssegments', 'sysconstraints')
-        AND SUBSTRING(CAST(SERVERPROPERTY('productversion') as varchar(20)),1,1) = 8)
+          ROUTINE_TYPE = 'FUNCTION'
       </DefiningQuery>
     </EntitySet>
 
+    <EntitySet Name="SFunctionParameters" EntityType="Self.Parameter">
+      <DefiningQuery>
+        SELECT
+        '[' + f.SPECIFIC_SCHEMA + ']' + '[' + f.SPECIFIC_NAME + ']' + '[' + f.PARAMETER_NAME + ']' [Id]
+        , '[' + f.SPECIFIC_SCHEMA + ']' + '[' + f.SPECIFIC_NAME + ']'                              [ParentId]
+        , CASE -- trim off the @ symbol
+        WHEN f.PARAMETER_NAME is null THEN NULL
+        ELSE SUBSTRING(f.PARAMETER_NAME, 2, LEN(f.PARAMETER_NAME) )
+        END   [Name]
+        , f.ORDINAL_POSITION [Ordinal]
+        , CASE
+        WHEN f.DATA_TYPE in ('varchar', 'nvarchar', 'varbinary') and
+        f.CHARACTER_MAXIMUM_LENGTH = -1 THEN
+        f.DATA_TYPE + '(max)'
+        ELSE
+        f.DATA_TYPE
+        END [TypeName]
+        , f.CHARACTER_MAXIMUM_LENGTH [MaxLength]
+        , f.NUMERIC_PRECISION [Precision]
+        , CAST(f.DATETIME_PRECISION as integer) as [DateTimePrecision]
+        , f.NUMERIC_SCALE    [Scale]
+        , f.COLLATION_CATALOG [CollationCatalog]
+        , f.COLLATION_SCHEMA [CollationSchema]
+        , f.COLLATION_NAME [CollationName]
+        , f.CHARACTER_SET_CATALOG [CharacterSetCatalog]
+        , f.CHARACTER_SET_SCHEMA [CharacterSetSchema]
+        , f.CHARACTER_SET_NAME [CharacterSetName]
+        , CAST(0 as bit) as [IsMultiSet]
+        , f.PARAMETER_MODE   [Mode]
+        , NULL [Default]
+        FROM
+        INFORMATION_SCHEMA.PARAMETERS f
+        INNER JOIN INFORMATION_SCHEMA.ROUTINES r ON
+        f.SPECIFIC_SCHEMA = r.SPECIFIC_SCHEMA AND
+        f.SPECIFIC_NAME = r.SPECIFIC_NAME AND
+        r.ROUTINE_TYPE = 'FUNCTION'
+        WHERE
+        f.IS_RESULT = 'NO'
+      </DefiningQuery>
+    </EntitySet>
 
-    <EntitySet Name="SPrimaryKeys" EntityType="Self.PrimaryKey">
+    <EntitySet Name="SProcedures" EntityType="Self.Procedure">
       <DefiningQuery>
         SELECT
-        '[' + kc.TABLE_SCHEMA + ']' + '[' + kc.TABLE_NAME + ']' + '[' + kc.COLUMN_NAME + ']' [Id]
-        ,   kc.CONSTRAINT_NAME [Name]
-        ,   kc.ORDINAL_POSITION [Ordinal]
+        CONCAT('`', ROUTINE_SCHEMA, '`.`', ROUTINE_NAME, '`') `Id`
+        , ROUTINE_CATALOG         `CatalogName`
+        , ROUTINE_SCHEMA          `SchemaName`
+        , ROUTINE_NAME            `Name`
         FROM
-        INFORMATION_SCHEMA.TABLE_CONSTRAINTS pk
-        INNER JOIN
-        INFORMATION_SCHEMA.KEY_COLUMN_USAGE kc on
-        kc.CONSTRAINT_SCHEMA = pk.CONSTRAINT_SCHEMA
-        AND kc.CONSTRAINT_NAME = pk.CONSTRAINT_NAME
+        INFORMATION_SCHEMA.ROUTINES
         WHERE
-        pk.CONSTRAINT_TYPE = 'PRIMARY KEY'
+        ROUTINE_TYPE = 'PROCEDURE'
       </DefiningQuery>
     </EntitySet>
-    <EntitySet Name="SRelationships" EntityType="Self.Relationship">
+
+    <EntitySet Name="SProcedureParameters" EntityType="Self.Parameter">
       <DefiningQuery>
         SELECT
-        '[' + CONSTRAINT_SCHEMA + ']' + '[' + CONSTRAINT_NAME + ']' [Id]
-        ,   CONSTRAINT_NAME    [Name]
-        ,   CAST( CASE DELETE_RULE WHEN 'CASCADE' THEN 1 ELSE 0 END as bit) [IsCascadeDelete]
+        '[' + p.SPECIFIC_SCHEMA + ']' + '[' + p.SPECIFIC_NAME + ']' + '[' + p.PARAMETER_NAME + ']' [Id]
+        , '[' + p.SPECIFIC_SCHEMA + ']' + '[' + p.SPECIFIC_NAME + ']'                              [ParentId]
+        , CASE -- trim off the @ symbol
+        WHEN p.PARAMETER_NAME is null THEN NULL
+        ELSE SUBSTRING(p.PARAMETER_NAME, 2, LEN(p.PARAMETER_NAME) )
+        END   [Name]
+        , p.ORDINAL_POSITION [Ordinal]
+        , CASE
+        WHEN p.DATA_TYPE in ('varchar', 'nvarchar', 'varbinary') and
+        p.CHARACTER_MAXIMUM_LENGTH = -1 THEN
+        p.DATA_TYPE + '(max)'
+        ELSE
+        p.DATA_TYPE
+        END [TypeName]
+        , p.CHARACTER_MAXIMUM_LENGTH [MaxLength]
+        , p.NUMERIC_PRECISION [Precision]
+        , CAST(p.DATETIME_PRECISION as integer) as [DateTimePrecision]
+        , p.NUMERIC_SCALE    [Scale]
+        , p.COLLATION_CATALOG [CollationCatalog]
+        , p.COLLATION_SCHEMA [CollationSchema]
+        , p.COLLATION_NAME [CollationName]
+        , p.CHARACTER_SET_CATALOG [CharacterSetCatalog]
+        , p.CHARACTER_SET_SCHEMA [CharacterSetSchema]
+        , p.CHARACTER_SET_NAME [CharacterSetName]
+        , CAST(0 as bit) as [IsMultiSet]
+        , p.PARAMETER_MODE   [Mode]
+        , NULL [Default]
         FROM
-        INFORMATION_SCHEMA.REFERENTIAL_CONSTRAINTS
+        INFORMATION_SCHEMA.PARAMETERS p
+        INNER JOIN INFORMATION_SCHEMA.ROUTINES r ON
+        p.SPECIFIC_SCHEMA = r.SPECIFIC_SCHEMA AND
+        p.SPECIFIC_NAME = r.SPECIFIC_NAME AND
+        r.ROUTINE_TYPE = 'PROCEDURE'
+        WHERE
+        p.IS_RESULT = 'NO'
       </DefiningQuery>
     </EntitySet>
-    <EntitySet Name="SRelationshipColumnMaps" EntityType="Self.RelationshipColumnMap">
+
+    <EntitySet Name="SConstraints" EntityType="Self.Constraint">
       <DefiningQuery>
         SELECT
-        '[' + FC.CONSTRAINT_SCHEMA + ']' + '[' + FC.CONSTRAINT_NAME + ']' + '[' + cast(FC.ORDINAL_POSITION as nvarchar(30)) + ']' [Id]
-        ,   '[' + PC.TABLE_SCHEMA      + ']' + '[' + PC.TABLE_NAME      + ']' + '[' + PC.COLUMN_NAME + ']' [FromColumnId]
-        ,   '[' + FC.TABLE_SCHEMA      + ']' + '[' + FC.TABLE_NAME      + ']' + '[' + FC.COLUMN_NAME + ']' [ToColumnId]
-        ,   '[' + FC.CONSTRAINT_SCHEMA + ']' + '[' + FC.CONSTRAINT_NAME                              + ']' [RelationshipId]
-        ,   FC.ORDINAL_POSITION [MapOrdinal]
+        CONCAT('`', tc.CONSTRAINT_SCHEMA, '`.`', tc.CONSTRAINT_NAME, '`') `Id`
+        , CONCAT('`', tc.TABLE_SCHEMA, '`.`', tc.TABLE_NAME, '`') `ParentId`
+        ,   tc.CONSTRAINT_NAME `Name`
+        ,   tc.CONSTRAINT_TYPE `ConstraintType`
+        , 0 AS `IsDeferrable`
+        , 0 AS `IsInitiallyDeferred`
         FROM
+        INFORMATION_SCHEMA.TABLE_CONSTRAINTS tc
+        WHERE tc.CONSTRAINT_TYPE != 'CHECK'
+        AND tc.TABLE_NAME IS NOT NULL
+      </DefiningQuery>
+    </EntitySet>
+
+    <EntitySet Name="SCheckConstraints" EntityType="Self.CheckConstraint">
+      <DefiningQuery>
+        SELECT
+        NULL AS `Id`
+        , NULL AS `Expression`
+      </DefiningQuery>
+    </EntitySet>
+
+    <EntitySet Name="SConstraintColumns" EntityType="Self.ConstraintColumn">
+      <DefiningQuery>
+        SELECT
+        CONCAT('`', CONSTRAINT_SCHEMA, '`.`', CONSTRAINT_NAME, '`') `ConstraintId`
+        ,   CONCAT('`', TABLE_SCHEMA, '`.`', TABLE_NAME, '`.`', COLUMN_NAME, '`') `ColumnId`
+        FROM
+        INFORMATION_SCHEMA.KEY_COLUMN_USAGE
+      </DefiningQuery>
+    </EntitySet>
+
+    <EntitySet Name="SForeignKeyConstraints" EntityType="Self.ForeignKeyConstraint">
+      <DefiningQuery>
+        SELECT
+        CONCAT('`', rc.CONSTRAINT_SCHEMA, '`.`', rc.CONSTRAINT_NAME, '`') `Id`
+        , rc.UPDATE_RULE `UpdateRule`
+        , rc.DELETE_RULE `DeleteRule`
+        FROM
+        INFORMATION_SCHEMA.REFERENTIAL_CONSTRAINTS rc
+      </DefiningQuery>
+    </EntitySet>
+
+    <EntitySet Name="SForeignKeys" EntityType="Self.ForeignKey">
+      <DefiningQuery>
+        SELECT
+        CONCAT('`', FC.CONSTRAINT_SCHEMA, '`.`', FC.CONSTRAINT_NAME, '`.`',
+        cast(FC.ORDINAL_POSITION as char(30)), '`') `Id`
+        ,   CONCAT('`', PC.TABLE_SCHEMA, '`.`', PC.TABLE_NAME, '`.`', PC.COLUMN_NAME, '`') `ToColumnId`
+        ,   CONCAT('`', FC.TABLE_SCHEMA, '`.`', FC.TABLE_NAME, '`.`', FC.COLUMN_NAME, '`') `FromColumnId`
+        ,   CONCAT('`', FC.CONSTRAINT_SCHEMA, '`.`', FC.CONSTRAINT_NAME, '`') `ConstraintId`
+        ,   FC.ORDINAL_POSITION `Ordinal`
+        FROM
         INFORMATION_SCHEMA.REFERENTIAL_CONSTRAINTS AS RC
         INNER JOIN
         INFORMATION_SCHEMA.KEY_COLUMN_USAGE AS PC /* PRIMARY KEY COLS*/
@@ -139,294 +293,477 @@
       </DefiningQuery>
     </EntitySet>
 
-    <EntitySet Name="SFunctions" EntityType="Self.Function">
+    <EntitySet Name="SViewConstraints" EntityType="Self.ViewConstraint">
       <DefiningQuery>
         SELECT
-        '[' + SPECIFIC_SCHEMA + ']' + '[' + SPECIFIC_NAME + ']' [Id]
-        , SPECIFIC_CATALOG         [Catalog]
-        , SPECIFIC_SCHEMA          [Schema]
-        , SPECIFIC_NAME            [Name]
-        ,   CASE
-        WHEN DATA_TYPE in ('varchar', 'nvarchar', 'varbinary') and
-        CHARACTER_MAXIMUM_LENGTH = -1 THEN
-        DATA_TYPE + '(max)'
-        ELSE
-        DATA_TYPE
-        END [ReturnTypeName]
-        , CHARACTER_MAXIMUM_LENGTH [ReturnMaxLength]
-        , NUMERIC_PRECISION        [ReturnPrecision]
-        , NUMERIC_SCALE            [ReturnScale]
-        , CASE
-        WHEN ROUTINE_TYPE = 'PROCEDURE' THEN
-        CAST(0 as bit)
-        ELSE
-        CAST(1 as bit)
-        END
-        as [IsComposable]
-        , CAST(0 as bit) as [IsAggregate]
-        , CAST(0 as bit) as [IsBuiltIn]
-        , CAST(0 as bit) as [IsNiladic]
+        CAST(NULL as char(1))   `Id`
+        , CAST(NULL as char(256)) `ParentId`
+        , CAST(NULL as char(256)) `Name`
+        , CAST(NULL as char(256)) `ConstraintType`
+        , CAST(NULL as char(256)) `Expression`
+        , CAST(NULL as char(11))  `UpdateRule`
+        , CAST(NULL as char(11))  `DeleteRule`
+      </DefiningQuery>
+    </EntitySet>
 
-        FROM
-        INFORMATION_SCHEMA.ROUTINES
-        WHERE
-        NOT (ROUTINE_SCHEMA = 'dbo'
-        AND ROUTINE_NAME LIKE 'dt[_]%'
-        AND SUBSTRING(CAST(SERVERPROPERTY('productversion') as varchar(20)),1,1) = 8)
-        AND (DATA_TYPE != 'TABLE' OR DATA_TYPE is null)
+    <EntitySet Name="SViewConstraintColumns" EntityType="Self.ConstraintColumn">
+      <DefiningQuery>
+        SELECT
+        CAST(NULL as char(1))   `ConstraintId`
+        , CAST(NULL as char(1)) `ColumnId`
+        WHERE 1=2
       </DefiningQuery>
     </EntitySet>
 
-    <EntitySet Name="SFunctionParameters" EntityType="Self.FunctionParameter">
+    <EntitySet Name="SViewForeignKeys" EntityType="Self.ForeignKey">
       <DefiningQuery>
         SELECT
-        '[' + SPECIFIC_SCHEMA + ']' + '[' + SPECIFIC_NAME + ']' + '[' + PARAMETER_NAME + ']' [Id]
-        , '[' + SPECIFIC_SCHEMA + ']' + '[' + SPECIFIC_NAME + ']'                              [FunctionId]
-        , CASE -- trim off the @ symbol
-        WHEN PARAMETER_NAME is null THEN NULL
-        ELSE SUBSTRING(PARAMETER_NAME, 2, LEN(PARAMETER_NAME) )
-        END   [Name]
-        , ORDINAL_POSITION [Ordinal]
-        , CASE
-        WHEN DATA_TYPE in ('varchar', 'nvarchar', 'varbinary') and
-        CHARACTER_MAXIMUM_LENGTH = -1 THEN
-        DATA_TYPE + '(max)'
-        ELSE
-        DATA_TYPE
-        END [TypeName]
-        , CHARACTER_MAXIMUM_LENGTH [MaxLength]
-        , NUMERIC_PRECISION [Precision]
-        , NUMERIC_SCALE    [Scale]
-        , PARAMETER_MODE   [Mode]
-        FROM
-        INFORMATION_SCHEMA.PARAMETERS
-        WHERE
-        IS_RESULT = 'NO'
+        CAST(NULL as char(1))    `Id`
+        ,  CAST(NULL as char(1)) `ToColumnId`
+        ,  CAST(NULL as char(1)) `FromColumnId`
+        ,  CAST(NULL as char(1)) `ConstraintId`
+        ,  0 `Ordinal`
       </DefiningQuery>
     </EntitySet>
 
+    <AssociationSet Name="STableTableColumns" Association="Self.TableTableColumn" >
+      <End Role="Parent" EntitySet="STables"/>
+      <End Role="Column" EntitySet="STableColumns"/>
+    </AssociationSet>
+    <AssociationSet Name="STableConstraints" Association="Self.TableTableConstraint" >
+      <End Role="Parent" EntitySet="STables"/>
+      <End Role="Constraint" EntitySet="SConstraints"/>
+    </AssociationSet>
+    <AssociationSet Name="SConstraintConstraintColumns" Association="Self.ConstraintConstraintColumn" >
+      <End Role="ConstraintColumn" EntitySet="SConstraintColumns"/>
+      <End Role="Constraint" EntitySet="SConstraints"/>
+    </AssociationSet>
+    <AssociationSet Name="SConstraintForeignKeys" Association="Self.ConstraintForeignKey" >
+      <End Role="ForeignKey" EntitySet="SForeignKeys"/>
+      <End Role="Constraint" EntitySet="SForeignKeyConstraints"/>
+    </AssociationSet>
+    <AssociationSet Name="SFromForeignKeyColumns" Association="Self.FromForeignKeyColumn" >
+      <End Role="ForeignKey" EntitySet="SForeignKeys"/>
+      <End Role="Column" EntitySet="STableColumns"/>
+    </AssociationSet>
+    <AssociationSet Name="SToForeignKeyColumns" Association="Self.ToForeignKeyColumn" >
+      <End Role="ForeignKey" EntitySet="SForeignKeys"/>
+      <End Role="Column" EntitySet="STableColumns"/>
+    </AssociationSet>
 
-    <AssociationSet Name="SColumnPrimaryKeys" Association="Self.ColumnPrimaryKey" />
-    <AssociationSet Name="SRelationshipRelationshipColumnMaps" Association="Self.RelationshipRelationshipColumnMap" />
-    <AssociationSet Name="SFromColumnRelationshipColumnMaps" Association="Self.FromColumnRelationshipColumnMap" />
-    <AssociationSet Name="SToColumnRelationshipColumnMaps" Association="Self.ToColumnRelationshipColumnMap" />
-    <AssociationSet Name="STableTableColumns" Association="Self.TableTableColumn" />
-    <AssociationSet Name="SViewViewColumns" Association="Self.ViewViewColumn" />
-    <AssociationSet Name="FunctionFunctionParameters" Association="Self.FunctionFunctionParameter" />
+    <AssociationSet Name="SViewViewColumns" Association="Self.ViewViewColumn" >
+      <End Role="Parent" EntitySet="SViews"/>
+      <End Role="Column" EntitySet="SViewColumns"/>
+    </AssociationSet>
+    <AssociationSet Name="SViewViewConstraints" Association="Self.ViewViewConstraint" >
+      <End Role="Parent" EntitySet="SViews"/>
+      <End Role="Constraint" EntitySet="SViewConstraints"/>
+    </AssociationSet>
+    <AssociationSet Name="SViewConstraintConstraintColumns" Association="Self.ViewConstraintConstraintColumn" >
+      <End Role="ConstraintColumn" EntitySet="SViewConstraintColumns"/>
+      <End Role="Constraint" EntitySet="SViewConstraints"/>
+    </AssociationSet>
+    <AssociationSet Name="SViewConstraintForeignKeys" Association="Self.ViewConstraintForeignKey" >
+      <End Role="ForeignKey" EntitySet="SViewForeignKeys"/>
+      <End Role="Constraint" EntitySet="SViewConstraints"/>
+    </AssociationSet>
+    <AssociationSet Name="SFromForeignKeyViewColumns" Association="Self.FromForeignKeyViewColumn" >
+      <End Role="ForeignKey" EntitySet="SViewForeignKeys"/>
+      <End Role="Column" EntitySet="SViewColumns"/>
+    </AssociationSet>
+    <AssociationSet Name="SToForeignKeyViewColumns" Association="Self.ToForeignKeyViewColumn" >
+      <End Role="ForeignKey" EntitySet="SViewForeignKeys"/>
+      <End Role="Column" EntitySet="SViewColumns"/>
+    </AssociationSet>
+
+    <AssociationSet Name="FunctionFunctionParameters" Association="Self.FunctionFunctionParameter">
+      <End Role="Function" EntitySet="SFunctions"/>
+      <End Role="Parameter" EntitySet="SFunctionParameters"/>
+    </AssociationSet>
+    <AssociationSet Name="ProcedureProcedureParameters" Association="Self.ProcedureProcedureParameter" >
+      <End Role="Procedure" EntitySet="SProcedures"/>
+      <End Role="Parameter" EntitySet="SProcedureParameters"/>
+    </AssociationSet>
   </EntityContainer>
 
   <EntityType Name="Table">
     <Key>
       <PropertyRef Name="Id" />
     </Key>
-    <Property Name="Id" Nullable="false" Type="nvarchar(max)" />
-    <Property Name="Catalog" Type="nvarchar" MaxLength="256" />
-    <Property Name="Schema" Nullable="false" Type="nvarchar" MaxLength="256" />
-    <Property Name="Name" Nullable="false" Type="nvarchar" MaxLength="256" />
+    <Property Name="Id" Nullable="false" Type="varchar" MaxLength="256"/>
+    <Property Name="Catalog" Type="varchar" MaxLength="256" />
+    <Property Name="Schema" Type="varchar" MaxLength="256" />
+    <Property Name="Name" Nullable="false" Type="varchar" MaxLength="256" />
   </EntityType>
 
+
+
+  <EntityType Name="TableColumn">
+    <Key>
+      <PropertyRef Name="Id" />
+    </Key>
+    <Property Name="Id" Nullable="false" Type="varchar" MaxLength="256"/>
+    <Property Name="ParentId" Nullable="false" Type="varchar" MaxLength ="256"/>
+    <Property Name="Name" Nullable="false" Type="varchar" MaxLength="256"/>
+    <Property Name="Ordinal" Nullable="false" Type="int64" />
+    <Property Name="IsNullable" Nullable="false" Type="bit" />
+    <Property Name="TypeName" Nullable="false" Type="varchar" MaxLength="256" />
+    <Property Name="MaxLength" Type="int64" />
+    <Property Name="Precision" Type="int64" />
+    <Property Name="DateTimePrecision" Type="int" />
+    <Property Name="Scale" Type="int64" />
+    <Property Name="CollationCatalog" Type="varchar" MaxLength="128" />
+    <Property Name="CollationSchema" Type="varchar" MaxLength="128" />
+    <Property Name="CollationName" Type="varchar" MaxLength="128" />
+    <Property Name="CharacterSetCatalog" Type="varchar" MaxLength="128" />
+    <Property Name="CharacterSetSchema" Type="varchar" MaxLength="128" />
+    <Property Name="CharacterSetName" Type="varchar" MaxLength="128" />
+    <Property Name="IsMultiSet" Nullable="false" Type="bit" />
+    <Property Name="IsIdentity" Nullable="false" Type="bit" />
+    <Property Name="IsStoreGenerated" Nullable="false" Type="bit" />
+    <Property Name="Default" Nullable="true" Type="longtext"/>
+  </EntityType>
+
   <EntityType Name="View">
     <Key>
       <PropertyRef Name="Id" />
     </Key>
-    <Property Name="Id" Nullable="false" Type="nvarchar(max)" />
-    <Property Name="Catalog" Type="nvarchar" MaxLength="256" />
-    <Property Name="Schema" Nullable="false" Type="nvarchar" MaxLength="256" />
-    <Property Name="Name" Nullable="false" Type="nvarchar" MaxLength="256" />
-    <Property Name="ViewDefinition" Nullable="false" Type="nvarchar(max)" />
+    <Property Name="Id" Nullable="false" Type="varchar" MaxLength ="256" />
+    <Property Name="CatalogName" Type="varchar" MaxLength="256" />
+    <Property Name="SchemaName" Type="varchar" MaxLength="256" />
+    <Property Name="Name" Nullable="false" Type="varchar" MaxLength="256" />
+    <Property Name="ViewDefinition" Nullable="true" Type="text" />
     <Property Name="IsUpdatable" Nullable="false" Type="bit" />
   </EntityType>
 
+  <EntityType Name="ViewColumn">
+    <Key>
+      <PropertyRef Name="Id" />
+    </Key>
+    <Property Name="Id" Nullable="false" Type="varchar" MaxLength="256"/>
+    <Property Name="ParentId" Nullable="false" Type="varchar" MaxLength="256"/>
+    <Property Name="Name" Nullable="false" Type="varchar" MaxLength="256"/>
+    <Property Name="Ordinal" Nullable="false" Type="int64" />
+    <Property Name="IsNullable" Nullable="false" Type="bit" />
+    <Property Name="TypeName" Nullable="false" Type="varchar" MaxLength="256" />
+    <Property Name="MaxLength" Type="int64" />
+    <Property Name="Precision" Type="int64" />
+    <Property Name="DateTimePrecision" Type="int" />
+    <Property Name="Scale" Type="int64" />
+    <Property Name="CollationCatalog" Type="varchar" MaxLength="128" />
+    <Property Name="CollationSchema" Type="varchar" MaxLength="128" />
+    <Property Name="CollationName" Type="varchar" MaxLength="128" />
+    <Property Name="CharacterSetCatalog" Type="varchar" MaxLength="128" />
+    <Property Name="CharacterSetSchema" Type="varchar" MaxLength="128" />
+    <Property Name="CharacterSetName" Type="varchar" MaxLength="128" />
+    <Property Name="IsMultiSet" Nullable="false" Type="bit" />
+    <Property Name="IsIdentity" Nullable="false" Type="bit" />
+    <Property Name="IsStoreGenerated" Nullable="false" Type="bit" />
+    <Property Name="Default" Nullable="true" Type="longtext"/>
+  </EntityType>
+
   <EntityType Name="Function">
     <Key>
       <PropertyRef Name="Id" />
     </Key>
-    <Property Name="Id" Nullable="false" Type="nvarchar(max)"/>
-    <Property Name="Catalog" Type="nvarchar" MaxLength="256"/>
-    <Property Name="Schema" Nullable="false" Type="nvarchar" MaxLength="256"/>
-    <Property Name="Name" Nullable="false" Type="nvarchar" MaxLength="256"/>
-    <Property Name="ReturnTypeName" Type="nvarchar" MaxLength="256" />
-    <Property Name="ReturnMaxLength" Type="int" />
-    <Property Name="ReturnPrecision" Type="int" />
-    <Property Name="ReturnScale" Type="int" />
+    <Property Name="Id" Nullable="false" Type="varchar" MaxLength="256"/>
+    <Property Name="CatalogName" Type="varchar" MaxLength="256"/>
+    <Property Name="SchemaName" Type="varchar" MaxLength="256"/>
+    <Property Name="Name" Nullable="false" Type="varchar" MaxLength="256"/>
+    <Property Name="ReturnTypeName" Type="varchar" MaxLength="256" />
+    <Property Name="ReturnMaxLength" Type="int64" />
+    <Property Name="ReturnPrecision" Type="int64" />
+    <Property Name="ReturnDateTimePrecision" Type="int" />
+    <Property Name="ReturnScale" Type="int64" />
+    <Property Name="ReturnCollationCatalog" Type="varchar" MaxLength="128" />
+    <Property Name="ReturnCollationSchema" Type="varchar" MaxLength="128" />
+    <Property Name="ReturnCollationName" Type="varchar" MaxLength="128" />
+    <Property Name="ReturnCharacterSetCatalog" Type="varchar" MaxLength="128" />
+    <Property Name="ReturnCharacterSetSchema" Type="varchar" MaxLength="128" />
+    <Property Name="ReturnCharacterSetName" Type="varchar" MaxLength="128" />
+    <Property Name="ReturnIsMultiSet" Nullable="false" Type="bit" />
     <Property Name="IsAggregate" Type="bit" />
-    <Property Name="IsComposable" Type="bit" />
     <Property Name="IsBuiltIn" Type="bit" />
     <Property Name="IsNiladic" Type="bit" />
   </EntityType>
 
-  <EntityType Name="FunctionParameter">
+  <EntityType Name="Procedure">
     <Key>
       <PropertyRef Name="Id" />
     </Key>
-    <Property Name="Id" Nullable="false" Type="nvarchar(max)"/>
-    <Property Name="FunctionId" Nullable="false" Type="nvarchar(max)"/>
-    <Property Name="Name" Nullable="false" Type="nvarchar(max)" />
+    <Property Name="Id" Nullable="false" Type="varchar" MaxLength="256"/>
+    <Property Name="CatalogName" Type="varchar" MaxLength="256"/>
+    <Property Name="SchemaName" Type="varchar" MaxLength="256"/>
+    <Property Name="Name" Nullable="false" Type="varchar" MaxLength="256"/>
+  </EntityType>
+
+  <EntityType Name="Parameter">
+    <Key>
+      <PropertyRef Name="Id" />
+    </Key>
+    <Property Name="Id" Nullable="false" Type="varchar" MaxLength="256"/>
+    <Property Name="ParentId" Nullable="false" Type="varchar" MaxLength="256"/>
+    <Property Name="Name" Nullable="false" Type="varchar" MaxLength="256" />
     <Property Name="Ordinal" Nullable="false" Type="int"/>
-    <Property Name="TypeName" Nullable="false" Type="nvarchar" MaxLength="256" />
-    <Property Name="MaxLength" Nullable="true" Type="int" />
-    <Property Name="Precision" Nullable="true" Type="int" />
-    <Property Name="Scale" Nullable="true" Type="int" />
-    <Property Name="Mode" Type="nvarchar" MaxLength="16" />
+    <Property Name="TypeName" Nullable="false" Type="varchar" MaxLength="256" />
+    <Property Name="MaxLength" Nullable="true" Type="int64" />
+    <Property Name="Precision" Nullable="true" Type="int64" />
+    <Property Name="DateTimePrecision" Type="int" />
+    <Property Name="Scale" Nullable="true" Type="int64" />
+    <Property Name="CollationCatalog" Type="varchar" MaxLength="128" />
+    <Property Name="CollationSchema" Type="varchar" MaxLength="128" />
+    <Property Name="CollationName" Type="varchar" MaxLength="128" />
+    <Property Name="CharacterSetCatalog" Type="varchar" MaxLength="128" />
+    <Property Name="CharacterSetSchema" Type="varchar" MaxLength="128" />
+    <Property Name="CharacterSetName" Type="varchar" MaxLength="128" />
+    <Property Name="IsMultiSet" Nullable="false" Type="bit" />
+    <Property Name="Mode" Type="varchar" MaxLength="16" />
+    <Property Name="Default" Type="longtext" />
   </EntityType>
 
-  <EntityType Name="TableColumn">
+  <EntityType Name="Constraint">
     <Key>
       <PropertyRef Name="Id" />
     </Key>
-    <Property Name="Id" Nullable="false" Type="nvarchar(max)"/>
-    <Property Name="TableId" Nullable="false" Type="nvarchar(max)"/>
-    <Property Name="Name" Nullable="false" Type="nvarchar" MaxLength="256"/>
-    <Property Name="Ordinal" Nullable="false" Type="int" />
-    <Property Name="IsNullable" Nullable="false" Type="bit" />
-    <Property Name="TypeName" Nullable="false" Type="nvarchar" MaxLength="256" />
-    <Property Name="MaxLength" Type="int" />
-    <Property Name="Precision" Type="int" />
-    <Property Name="Scale" Type="int" />
-    <Property Name="IsIdentity" Nullable="false" Type="bit" />
-    <Property Name="IsStoreGenerated" Nullable="false" Type="bit" />
+    <Property Name="Id" Nullable="false" Type="varchar" MaxLength ="256" />
+    <Property Name="ParentId" Nullable="false" Type="varchar" MaxLength="256"/>
+    <Property Name="Name" Nullable="false" MaxLength="256" Type="varchar" />
+    <Property Name="IsDeferrable" Nullable="false" Type="bit" />
+    <Property Name="IsInitiallyDeferred" Nullable="false" Type="bit" />
+    <Property Name="ConstraintType" Nullable="false" MaxLength="11" Type="varchar" />
   </EntityType>
 
-
-  <EntityType Name="ViewColumn">
+  <EntityType Name="CheckConstraint">
     <Key>
       <PropertyRef Name="Id" />
     </Key>
-    <Property Name="Id" Nullable="false" Type="nvarchar(max)"/>
-    <Property Name="ViewId" Nullable="false" Type="nvarchar(max)"/>
-    <Property Name="Name" Nullable="false" Type="nvarchar" MaxLength="256"/>
-    <Property Name="Ordinal" Nullable="false" Type="int" />
-    <Property Name="IsNullable" Nullable="false" Type="bit" />
-    <Property Name="TypeName" Nullable="false" Type="nvarchar" MaxLength="256" />
-    <Property Name="MaxLength" Type="int" />
-    <Property Name="Precision" Type="int" />
-    <Property Name="Scale" Type="int" />
-    <Property Name="IsIdentity" Nullable="false" Type="bit" />
-    <Property Name="IsStoreGenerated" Nullable="false" Type="bit" />
+    <Property Name="Id" Nullable="false" Type="varchar" MaxLength ="256" />
+    <Property Name="Expression" Nullable="true" MaxLength="4000" Type="varchar" />
   </EntityType>
 
+  <EntityType Name="ConstraintColumn">
+    <Key>
+      <PropertyRef Name="ConstraintId" />
+      <PropertyRef Name="ColumnId" />
+    </Key>
+    <Property Name="ConstraintId" Nullable="false" Type="varchar" MaxLength="256" />
+    <Property Name="ColumnId" Nullable="false" Type="varchar" MaxLength="256" />
+  </EntityType>
 
-  <EntityType Name="PrimaryKey">
+  <EntityType Name="ForeignKeyConstraint">
     <Key>
       <PropertyRef Name="Id" />
     </Key>
-    <Property Name="Id" Nullable="false" Type="nvarchar(max)" />
-    <Property Name="Name" Nullable="false" MaxLength="256" Type="nvarchar" />
-    <Property Name="Ordinal" Nullable="false" Type="int" />
-    <NavigationProperty Relationship="Self.ColumnPrimaryKey" Name="Column" FromRole="PrimaryKey" ToRole="Column" />
+    <Property Name="Id" Nullable="false" Type="varchar" MaxLength="256" />
+    <Property Name="UpdateRule" Nullable="false" MaxLength="11" Type="varchar" />
+    <Property Name="DeleteRule" Nullable="false" MaxLength="11" Type="varchar" />
   </EntityType>
 
-  <EntityType Name="Relationship">
+  <EntityType Name="ForeignKey">
     <Key>
       <PropertyRef Name="Id" />
     </Key>
-    <Property Name="Id" Nullable="false" Type="nvarchar(max)" />
-    <Property Name="Name" Nullable="false" MaxLength="256" Type="nvarchar" />
-    <Property Name="IsCascadeDelete" Nullable="false" Type="bit" />
+    <Property Name="Id" Nullable="false" Type="varchar" MaxLength="256"/>
+    <Property Name="Ordinal" Nullable="false" Type="int" />
+    <Property Name="ConstraintId" Nullable="false" Type="varchar" MaxLength="256" />
+    <Property Name="FromColumnId" Nullable="false" Type="varchar" MaxLength="256" />
+    <Property Name="ToColumnId" Nullable="false" Type="varchar" MaxLength ="256" />
   </EntityType>
 
-  <EntityType Name="RelationshipColumnMap">
+  <EntityType Name="ViewConstraint">
     <Key>
       <PropertyRef Name="Id" />
     </Key>
-    <Property Name="Id" Nullable="false" Type="nvarchar(max)" />
-    <Property Name="MapOrdinal" Nullable="false" Type="int" />
-    <Property Name="RelationshipId" Nullable="false" Type="nvarchar(max)" />
-    <Property Name="FromColumnId" Nullable="false" Type="nvarchar(max)" />
-    <Property Name="ToColumnId" Nullable="false" Type="nvarchar(max)" />
+    <Property Name="Id" Nullable="false" Type="varchar" MaxLength="256" />
+    <Property Name="ParentId" Nullable="false" Type="varchar" MaxLength="256" />
+    <Property Name="Name" Nullable="false" MaxLength="256" Type="varchar" />
+    <Property Name="IsDeferrable" Nullable="false" Type="bit" />
+    <Property Name="IsInitiallyDeferred" Nullable="false" Type="bit" />
+    <Property Name="ConstraintType" Nullable="false" MaxLength="11" Type="varchar" />
+    <Property Name="Expression" Nullable="true" MaxLength="4000" Type="varchar" />
+    <Property Name="UpdateRule" Nullable="true" MaxLength="11" Type="varchar" />
+    <Property Name="DeleteRule" Nullable="true" MaxLength="11" Type="varchar" />
   </EntityType>
 
-  <Association Name="ColumnPrimaryKey">
-    <End Type="Self.TableColumn" Role="Column" Multiplicity="1" />
-    <End Type="Self.PrimaryKey" Role="PrimaryKey" Multiplicity="0..1" />
+  <Association Name="TableTableConstraint">
+    <End Type="Self.Table" Role="Parent" Multiplicity="1" />
+    <End Type="Self.Constraint" Role="Constraint" Multiplicity="*" />
     <ReferentialConstraint>
-      <Principal Role="Column">
+      <Principal Role="Parent">
         <PropertyRef Name="Id" />
       </Principal>
-      <Dependent Role="PrimaryKey">
+      <Dependent Role="Constraint">
+        <PropertyRef Name="ParentId" />
+      </Dependent>
+    </ReferentialConstraint>
+  </Association>
+
+  <Association Name="ConstraintConstraintColumn">
+    <End Type="Self.Constraint" Role="Constraint" Multiplicity="1" />
+    <End Type="Self.ConstraintColumn" Role="ConstraintColumn" Multiplicity="*" />
+    <ReferentialConstraint>
+      <Principal Role="Constraint">
         <PropertyRef Name="Id" />
+      </Principal>
+      <Dependent Role="ConstraintColumn">
+        <PropertyRef Name="ConstraintId" />
       </Dependent>
     </ReferentialConstraint>
   </Association>
 
-
-  <Association Name="RelationshipRelationshipColumnMap">
-    <End Type="Self.Relationship" Role="Relationship" Multiplicity="1" />
-    <End Type="Self.RelationshipColumnMap" Role="RelationshipColumnMap" Multiplicity="*" />
+  <Association Name="ConstraintForeignKey">
+    <End Type="Self.ForeignKeyConstraint" Role="Constraint" Multiplicity="1" />
+    <End Type="Self.ForeignKey" Role="ForeignKey" Multiplicity="*" />
     <ReferentialConstraint>
-      <Principal Role="Relationship">
+      <Principal Role="Constraint">
         <PropertyRef Name="Id" />
       </Principal>
-      <Dependent Role="RelationshipColumnMap">
-        <PropertyRef Name="RelationshipId" />
+      <Dependent Role="ForeignKey">
+        <PropertyRef Name="ConstraintId" />
       </Dependent>
     </ReferentialConstraint>
   </Association>
 
-  <Association Name="FromColumnRelationshipColumnMap">
+  <Association Name="FromForeignKeyColumn">
     <End Type="Self.TableColumn" Role="Column" Multiplicity="1" />
-    <End Type="Self.RelationshipColumnMap" Role="RelationshipColumnMap" Multiplicity="*" />
+    <End Type="Self.ForeignKey" Role="ForeignKey" Multiplicity="*" />
     <ReferentialConstraint>
       <Principal Role="Column">
         <PropertyRef Name="Id" />
       </Principal>
-      <Dependent Role="RelationshipColumnMap">
+      <Dependent Role="ForeignKey">
         <PropertyRef Name="FromColumnId" />
       </Dependent>
     </ReferentialConstraint>
   </Association>
 
-  <Association Name="ToColumnRelationshipColumnMap">
+  <Association Name="ToForeignKeyColumn">
     <End Type="Self.TableColumn" Role="Column" Multiplicity="1" />
-    <End Type="Self.RelationshipColumnMap" Role="RelationshipColumnMap" Multiplicity="*" />
+    <End Type="Self.ForeignKey" Role="ForeignKey" Multiplicity="*" />
     <ReferentialConstraint>
       <Principal Role="Column">
         <PropertyRef Name="Id" />
       </Principal>
-      <Dependent Role="RelationshipColumnMap">
+      <Dependent Role="ForeignKey">
         <PropertyRef Name="ToColumnId" />
       </Dependent>
     </ReferentialConstraint>
   </Association>
 
   <Association Name="TableTableColumn">
-    <End Type="Self.Table" Role="Table" Multiplicity="1" />
+    <End Type="Self.Table" Role="Parent" Multiplicity="1" />
     <End Type="Self.TableColumn" Role="Column" Multiplicity="*" />
     <ReferentialConstraint>
-      <Principal Role="Table">
+      <Principal Role="Parent">
         <PropertyRef Name="Id" />
       </Principal>
       <Dependent Role="Column">
-        <PropertyRef Name="TableId" />
+        <PropertyRef Name="ParentId" />
       </Dependent>
     </ReferentialConstraint>
   </Association>
 
-
   <Association Name="ViewViewColumn">
-    <End Type="Self.View" Role="View" Multiplicity="1" />
-    <End Type="Self.ViewColumn" Role="ViewColumn" Multiplicity="*" />
+    <End Type="Self.View" Role="Parent" Multiplicity="1" />
+    <End Type="Self.ViewColumn" Role="Column" Multiplicity="*" />
     <ReferentialConstraint>
-      <Principal Role="View">
+      <Principal Role="Parent">
         <PropertyRef Name="Id" />
       </Principal>
-      <Dependent Role="ViewColumn">
-        <PropertyRef Name="ViewId" />
+      <Dependent Role="Column">
+        <PropertyRef Name="ParentId" />
       </Dependent>
     </ReferentialConstraint>
   </Association>
 
   <Association Name="FunctionFunctionParameter">
     <End Type="Self.Function" Role="Function" Multiplicity="1" />
-    <End Type="Self.FunctionParameter" Role="Parameter" Multiplicity="*" />
+    <End Type="Self.Parameter" Role="Parameter" Multiplicity="*" />
     <ReferentialConstraint>
       <Principal Role="Function">
         <PropertyRef Name="Id" />
       </Principal>
       <Dependent Role="Parameter">
-        <PropertyRef Name="FunctionId" />
+        <PropertyRef Name="ParentId" />
       </Dependent>
     </ReferentialConstraint>
   </Association>
 
+  <Association Name="ProcedureProcedureParameter">
+    <End Type="Self.Procedure" Role="Procedure" Multiplicity="1" />
+    <End Type="Self.Parameter" Role="Parameter" Multiplicity="*" />
+    <ReferentialConstraint>
+      <Principal Role="Procedure">
+        <PropertyRef Name="Id" />
+      </Principal>
+      <Dependent Role="Parameter">
+        <PropertyRef Name="ParentId" />
+      </Dependent>
+    </ReferentialConstraint>
+  </Association>
+
+  <Association Name="ViewViewConstraint">
+    <End Type="Self.View" Role="Parent" Multiplicity="1" />
+    <End Type="Self.ViewConstraint" Role="Constraint" Multiplicity="*" />
+    <ReferentialConstraint>
+      <Principal Role="Parent">
+        <PropertyRef Name="Id" />
+      </Principal>
+      <Dependent Role="Constraint">
+        <PropertyRef Name="ParentId" />
+      </Dependent>
+    </ReferentialConstraint>
+  </Association>
+
+  <Association Name="ViewConstraintConstraintColumn">
+    <End Type="Self.ViewConstraint" Role="Constraint" Multiplicity="1" />
+    <End Type="Self.ConstraintColumn" Role="ConstraintColumn" Multiplicity="*" />
+    <ReferentialConstraint>
+      <Principal Role="Constraint">
+        <PropertyRef Name="Id" />
+      </Principal>
+      <Dependent Role="ConstraintColumn">
+        <PropertyRef Name="ConstraintId" />
+      </Dependent>
+    </ReferentialConstraint>
+  </Association>
+
+  <Association Name="ViewConstraintForeignKey">
+    <End Type="Self.ViewConstraint" Role="Constraint" Multiplicity="1" />
+    <End Type="Self.ForeignKey" Role="ForeignKey" Multiplicity="*" />
+    <ReferentialConstraint>
+      <Principal Role="Constraint">
+        <PropertyRef Name="Id" />
+      </Principal>
+      <Dependent Role="ForeignKey">
+        <PropertyRef Name="ConstraintId" />
+      </Dependent>
+    </ReferentialConstraint>
+  </Association>
+
+  <Association Name="FromForeignKeyViewColumn">
+    <End Type="Self.ViewColumn" Role="Column" Multiplicity="1" />
+    <End Type="Self.ForeignKey" Role="ForeignKey" Multiplicity="*" />
+    <ReferentialConstraint>
+      <Principal Role="Column">
+        <PropertyRef Name="Id" />
+      </Principal>
+      <Dependent Role="ForeignKey">
+        <PropertyRef Name="FromColumnId" />
+      </Dependent>
+    </ReferentialConstraint>
+  </Association>
+
+  <Association Name="ToForeignKeyViewColumn">
+    <End Type="Self.ViewColumn" Role="Column" Multiplicity="1" />
+    <End Type="Self.ForeignKey" Role="ForeignKey" Multiplicity="*" />
+    <ReferentialConstraint>
+      <Principal Role="Column">
+        <PropertyRef Name="Id" />
+      </Principal>
+      <Dependent Role="ForeignKey">
+        <PropertyRef Name="ToColumnId" />
+      </Dependent>
+    </ReferentialConstraint>
+  </Association>  
 </Schema>
\ No newline at end of file

Modified: trunk/MySql.Data.Entity/Provider/Properties/SchemaMapping.msl
===================================================================
--- trunk/MySql.Data.Entity/Provider/Properties/SchemaMapping.msl	2008-06-02 17:55:55 UTC (rev 1310)
+++ trunk/MySql.Data.Entity/Provider/Properties/SchemaMapping.msl	2008-06-03 21:40:06 UTC (rev 1311)
@@ -1,149 +1,388 @@
 <?xml version="1.0" encoding="utf-8"?>
-<Mapping xmlns:cs="urn:schemas-microsoft-com:windows:storage:mapping:CS" Space="C-S" xmlns="urn:schemas-microsoft-com:windows:storage:mapping:CS">
+<Mapping xmlns:cs="urn:schemas-microsoft-com:windows:storage:mapping:CS" 
+         Space="C-S" xmlns="urn:schemas-microsoft-com:windows:storage:mapping:CS">
   <cs:EntityContainerMapping StorageEntityContainer="Schema" CdmEntityContainer="SchemaInformation">
-    <cs:EntitySetMapping Name="Tables" StoreEntitySet="STables" TypeName="Provider.Table">
+    <cs:EntitySetMapping Name="Tables" StoreEntitySet="STables" TypeName="Store.Table">
       <cs:ScalarProperty Name="Id" ColumnName="Id" />
-      <cs:ScalarProperty Name="Catalog" ColumnName="Catalog" />
-      <cs:ScalarProperty Name="Schema" ColumnName="Schema" />
+      <cs:ScalarProperty Name="CatalogName" ColumnName="Catalog" />
+      <cs:ScalarProperty Name="SchemaName" ColumnName="Schema" />
       <cs:ScalarProperty Name="Name" ColumnName="Name" />
     </cs:EntitySetMapping>
-    <cs:EntitySetMapping Name="Views">
-      <cs:EntityTypeMapping TypeName="Provider.View">
-        <cs:MappingFragment StoreEntitySet="SViews">
-          <cs:ScalarProperty Name="Id" ColumnName="Id" />
-          <cs:ScalarProperty Name="Catalog" ColumnName="Catalog" />
-          <cs:ScalarProperty Name="Schema" ColumnName="Schema" />
-          <cs:ScalarProperty Name="Name" ColumnName="Name" />
-          <cs:ScalarProperty Name="ViewDefinition" ColumnName="ViewDefinition" />
-          <cs:ScalarProperty Name="IsUpdatable" ColumnName="IsUpdatable" />
-        </cs:MappingFragment>
-      </cs:EntityTypeMapping>
-    </cs:EntitySetMapping>
-    <cs:EntitySetMapping Name="Functions">
-      <cs:EntityTypeMapping TypeName="Provider.Function">
-        <cs:MappingFragment StoreEntitySet="SFunctions">
-          <cs:ScalarProperty Name="Id" ColumnName="Id" />
-          <cs:ScalarProperty Name="Catalog" ColumnName="Catalog" />
-          <cs:ScalarProperty Name="Schema" ColumnName="Schema" />
-          <cs:ScalarProperty Name="Name" ColumnName="Name" />
-          <cs:ScalarProperty Name="ReturnTypeName" ColumnName="ReturnTypeName" />
-          <cs:ScalarProperty Name="ReturnMaxLength" ColumnName="ReturnMaxLength" />
-          <cs:ScalarProperty Name="ReturnPrecision" ColumnName="ReturnPrecision" />
-          <cs:ScalarProperty Name="ReturnScale" ColumnName="ReturnScale" />
-          <cs:ScalarProperty Name="IsAggregate" ColumnName="IsAggregate" />
-          <cs:ScalarProperty Name="IsComposable" ColumnName="IsComposable" />
-          <cs:ScalarProperty Name="IsBuiltIn" ColumnName="IsBuiltIn" />
-          <cs:ScalarProperty Name="IsNiladic" ColumnName="IsNiladic" />
-        </cs:MappingFragment>
-      </cs:EntityTypeMapping>
-    </cs:EntitySetMapping>
-    <cs:EntitySetMapping Name="TableColumns" StoreEntitySet="STableColumns" TypeName="Provider.TableColumn">
+	  
+    <cs:EntitySetMapping Name="TableColumns" StoreEntitySet="STableColumns" TypeName="Store.Column">
       <cs:ScalarProperty Name="Id" ColumnName="Id" />
       <cs:ScalarProperty Name="Name" ColumnName="Name" />
       <cs:ScalarProperty Name="Ordinal" ColumnName="Ordinal" />
       <cs:ScalarProperty Name="IsNullable" ColumnName="IsNullable" />
-      <cs:ScalarProperty Name="TypeName" ColumnName="TypeName" />
-      <cs:ScalarProperty Name="MaxLength" ColumnName="MaxLength" />
-      <cs:ScalarProperty Name="Precision" ColumnName="Precision" />
-      <cs:ScalarProperty Name="Scale" ColumnName="Scale" />
+      <cs:ComplexProperty Name="ColumnType">
+        <cs:ScalarProperty Name="TypeName" ColumnName="TypeName" />
+        <cs:ScalarProperty Name="MaxLength" ColumnName="MaxLength" />
+        <cs:ScalarProperty Name="DateTimePrecision" ColumnName="DateTimePrecision" />
+        <cs:ScalarProperty Name="Precision" ColumnName="Precision" />
+        <cs:ScalarProperty Name="Scale" ColumnName="Scale" />
+        <cs:ComplexProperty Name="Collation">
+          <cs:ScalarProperty Name="CatalogName" ColumnName="CollationCatalog" />
+          <cs:ScalarProperty Name="SchemaName" ColumnName="CollationSchema" />
+          <cs:ScalarProperty Name="Name" ColumnName="CollationName" />
+        </cs:ComplexProperty>
+        <cs:ComplexProperty Name="CharacterSet">
+          <cs:ScalarProperty Name="CatalogName" ColumnName="CharacterSetCatalog" />
+          <cs:ScalarProperty Name="SchemaName" ColumnName="CharacterSetSchema" />
+          <cs:ScalarProperty Name="Name" ColumnName="CharacterSetName" />
+        </cs:ComplexProperty>
+        <cs:ScalarProperty Name="IsMultiSet" ColumnName="IsMultiSet" />
+      </cs:ComplexProperty>
       <cs:ScalarProperty Name="IsIdentity" ColumnName="IsIdentity" />
       <cs:ScalarProperty Name="IsStoreGenerated" ColumnName="IsStoreGenerated" />
+      <cs:ScalarProperty Name="Default" ColumnName="Default" />
     </cs:EntitySetMapping>
-    <cs:EntitySetMapping Name="ViewColumns" StoreEntitySet="SViewColumns" TypeName="Provider.ViewColumn">
+
+    <cs:EntitySetMapping Name="Views" StoreEntitySet="SViews" TypeName="Store.View">
       <cs:ScalarProperty Name="Id" ColumnName="Id" />
+      <cs:ScalarProperty Name="CatalogName" ColumnName="CatalogName" />
+      <cs:ScalarProperty Name="SchemaName" ColumnName="SchemaName" />
       <cs:ScalarProperty Name="Name" ColumnName="Name" />
+      <cs:ScalarProperty Name="ViewDefinition" ColumnName="ViewDefinition" />
+      <cs:ScalarProperty Name="IsUpdatable" ColumnName="IsUpdatable" />
+    </cs:EntitySetMapping>
+
+    <cs:EntitySetMapping Name="ViewColumns" StoreEntitySet="SViewColumns" TypeName="Store.Column">
+      <cs:ScalarProperty Name="Id" ColumnName="Id" />
+      <cs:ScalarProperty Name="Name" ColumnName="Name" />
       <cs:ScalarProperty Name="Ordinal" ColumnName="Ordinal" />
       <cs:ScalarProperty Name="IsNullable" ColumnName="IsNullable" />
-      <cs:ScalarProperty Name="TypeName" ColumnName="TypeName" />
-      <cs:ScalarProperty Name="MaxLength" ColumnName="MaxLength" />
-      <cs:ScalarProperty Name="Precision" ColumnName="Precision" />
-      <cs:ScalarProperty Name="Scale" ColumnName="Scale" />
+      <cs:ComplexProperty Name="ColumnType">
+        <cs:ScalarProperty Name="TypeName" ColumnName="TypeName" />
+        <cs:ScalarProperty Name="MaxLength" ColumnName="MaxLength" />
+        <cs:ScalarProperty Name="Precision" ColumnName="Precision" />
+        <cs:ScalarProperty Name="DateTimePrecision" ColumnName="DateTimePrecision" />
+        <cs:ScalarProperty Name="Scale" ColumnName="Scale" />
+        <cs:ComplexProperty Name="Collation">
+          <cs:ScalarProperty Name="CatalogName" ColumnName="CollationCatalog" />
+          <cs:ScalarProperty Name="SchemaName" ColumnName="CollationSchema" />
+          <cs:ScalarProperty Name="Name" ColumnName="CollationName" />
+        </cs:ComplexProperty>
+        <cs:ComplexProperty Name="CharacterSet">
+          <cs:ScalarProperty Name="CatalogName" ColumnName="CharacterSetCatalog" />
+          <cs:ScalarProperty Name="SchemaName" ColumnName="CharacterSetSchema" />
+          <cs:ScalarProperty Name="Name" ColumnName="CharacterSetName" />
+        </cs:ComplexProperty>
+        <cs:ScalarProperty Name="IsMultiSet" ColumnName="IsMultiSet" />
+      </cs:ComplexProperty>
       <cs:ScalarProperty Name="IsIdentity" ColumnName="IsIdentity" />
       <cs:ScalarProperty Name="IsStoreGenerated" ColumnName="IsStoreGenerated" />
+      <cs:ScalarProperty Name="Default" ColumnName="Default" />
     </cs:EntitySetMapping>
-    <cs:EntitySetMapping Name="FunctionParameters">
-      <cs:EntityTypeMapping TypeName="Provider.FunctionParameter">
-        <cs:MappingFragment StoreEntitySet="SFunctionParameters">
+
+    <cs:EntitySetMapping Name="Functions" TypeName="Store.ScalarFunction" StoreEntitySet="SFunctions">
+      <cs:ScalarProperty Name="Id" ColumnName="Id" />
+      <cs:ScalarProperty Name="CatalogName" ColumnName="CatalogName" />
+      <cs:ScalarProperty Name="SchemaName" ColumnName="SchemaName" />
+      <cs:ScalarProperty Name="Name" ColumnName="Name" />
+      <cs:ComplexProperty Name="ReturnType">
+        <cs:ScalarProperty Name="TypeName" ColumnName="ReturnTypeName" />
+        <cs:ScalarProperty Name="MaxLength" ColumnName="ReturnMaxLength" />
+        <cs:ScalarProperty Name="Precision" ColumnName="ReturnPrecision" />
+        <cs:ScalarProperty Name="DateTimePrecision" ColumnName="ReturnDateTimePrecision" />
+        <cs:ScalarProperty Name="Scale" ColumnName="ReturnScale" />
+        <cs:ComplexProperty Name="Collation">
+          <cs:ScalarProperty Name="CatalogName" ColumnName="ReturnCollationCatalog" />
+          <cs:ScalarProperty Name="SchemaName" ColumnName="ReturnCollationSchema" />
+          <cs:ScalarProperty Name="Name" ColumnName="ReturnCollationName" />
+        </cs:ComplexProperty>
+        <cs:ComplexProperty Name="CharacterSet">
+          <cs:ScalarProperty Name="CatalogName" ColumnName="ReturnCharacterSetCatalog" />
+          <cs:ScalarProperty Name="SchemaName" ColumnName="ReturnCharacterSetSchema" />
+          <cs:ScalarProperty Name="Name" ColumnName="ReturnCharacterSetName" />
+        </cs:ComplexProperty>
+        <cs:ScalarProperty Name="IsMultiSet" ColumnName="ReturnIsMultiSet" />
+      </cs:ComplexProperty>
+      <cs:ScalarProperty Name="IsAggregate" ColumnName="IsAggregate" />
+      <cs:ScalarProperty Name="IsBuiltIn" ColumnName="IsBuiltIn" />
+      <cs:ScalarProperty Name="IsNiladic" ColumnName="IsNiladic" />
+    </cs:EntitySetMapping>
+
+    <cs:EntitySetMapping Name="FunctionParameters" TypeName="Store.Parameter" StoreEntitySet="SFunctionParameters">
+      <cs:ScalarProperty Name="Id" ColumnName="Id" />
+      <cs:ScalarProperty Name="Name" ColumnName="Name" />
+      <cs:ScalarProperty Name="Ordinal" ColumnName="Ordinal" />
+      <cs:ComplexProperty Name="ParameterType">
+        <cs:ScalarProperty Name="TypeName" ColumnName="TypeName" />
+        <cs:ScalarProperty Name="MaxLength" ColumnName="MaxLength" />
+        <cs:ScalarProperty Name="DateTimePrecision" ColumnName="DateTimePrecision" />
+        <cs:ScalarProperty Name="Precision" ColumnName="Precision" />
+        <cs:ScalarProperty Name="Scale" ColumnName="Scale" />
+        <cs:ComplexProperty Name="Collation">
+          <cs:ScalarProperty Name="CatalogName" ColumnName="CollationCatalog" />
+          <cs:ScalarProperty Name="SchemaName" ColumnName="CollationSchema" />
+          <cs:ScalarProperty Name="Name" ColumnName="CollationName" />
+        </cs:ComplexProperty>
+        <cs:ComplexProperty Name="CharacterSet">
+          <cs:ScalarProperty Name="CatalogName" ColumnName="CharacterSetCatalog" />
+          <cs:ScalarProperty Name="SchemaName" ColumnName="CharacterSetSchema" />
+          <cs:ScalarProperty Name="Name" ColumnName="CharacterSetName" />
+        </cs:ComplexProperty>
+        <cs:ScalarProperty Name="IsMultiSet" ColumnName="IsMultiSet" />
+      </cs:ComplexProperty>
+      <cs:ScalarProperty Name="Mode" ColumnName="Mode" />
+      <cs:ScalarProperty Name="Default" ColumnName="Default" />
+    </cs:EntitySetMapping>
+
+    <cs:EntitySetMapping Name="Procedures" TypeName="Store.Procedure" StoreEntitySet="SProcedures">
+      <cs:ScalarProperty Name="Id" ColumnName="Id" />
+      <cs:ScalarProperty Name="CatalogName" ColumnName="CatalogName" />
+      <cs:ScalarProperty Name="SchemaName" ColumnName="SchemaName" />
+      <cs:ScalarProperty Name="Name" ColumnName="Name" />
+    </cs:EntitySetMapping>
+
+    <cs:EntitySetMapping Name="ProcedureParameters" TypeName="Store.Parameter" StoreEntitySet="SProcedureParameters">
+      <cs:ScalarProperty Name="Id" ColumnName="Id" />
+      <cs:ScalarProperty Name="Name" ColumnName="Name" />
+      <cs:ScalarProperty Name="Ordinal" ColumnName="Ordinal" />
+      <cs:ComplexProperty Name="ParameterType">
+        <cs:ScalarProperty Name="TypeName" ColumnName="TypeName" />
+        <cs:ScalarProperty Name="MaxLength" ColumnName="MaxLength" />
+        <cs:ScalarProperty Name="DateTimePrecision" ColumnName="DateTimePrecision" />
+        <cs:ScalarProperty Name="Precision" ColumnName="Precision" />
+        <cs:ScalarProperty Name="Scale" ColumnName="Scale" />
+        <cs:ComplexProperty Name="Collation">
+          <cs:ScalarProperty Name="CatalogName" ColumnName="CollationCatalog" />
+          <cs:ScalarProperty Name="SchemaName" ColumnName="CollationSchema" />
+          <cs:ScalarProperty Name="Name" ColumnName="CollationName" />
+        </cs:ComplexProperty>
+        <cs:ComplexProperty Name="CharacterSet">
+          <cs:ScalarProperty Name="CatalogName" ColumnName="CharacterSetCatalog" />
+          <cs:ScalarProperty Name="SchemaName" ColumnName="CharacterSetSchema" />
+          <cs:ScalarProperty Name="Name" ColumnName="CharacterSetName" />
+        </cs:ComplexProperty>
+        <cs:ScalarProperty Name="IsMultiSet" ColumnName="IsMultiSet" />
+      </cs:ComplexProperty>
+      <cs:ScalarProperty Name="Mode" ColumnName="Mode" />
+      <cs:ScalarProperty Name="Default" ColumnName="Default" />
+    </cs:EntitySetMapping>
+
+    <cs:EntitySetMapping Name="TableConstraints" >
+      <cs:EntityTypeMapping TypeName="IsTypeOf(Store.Constraint)">
+        <cs:MappingFragment StoreEntitySet="SConstraints">
           <cs:ScalarProperty Name="Id" ColumnName="Id" />
           <cs:ScalarProperty Name="Name" ColumnName="Name" />
-          <cs:ScalarProperty Name="Ordinal" ColumnName="Ordinal" />
-          <cs:ScalarProperty Name="TypeName" ColumnName="TypeName" />
-          <cs:ScalarProperty Name="MaxLength" ColumnName="MaxLength" />
-          <cs:ScalarProperty Name="Precision" ColumnName="Precision" />
-          <cs:ScalarProperty Name="Scale" ColumnName="Scale" />
-          <cs:ScalarProperty Name="Mode" ColumnName="Mode" />
+          <cs:ScalarProperty Name="IsDeferrable" ColumnName="IsDeferrable" />
+          <cs:ScalarProperty Name="IsInitiallyDeferred" ColumnName="IsInitiallyDeferred" />
         </cs:MappingFragment>
       </cs:EntityTypeMapping>
+      <cs:EntityTypeMapping TypeName="Store.UniqueConstraint">
+        <cs:MappingFragment StoreEntitySet="SConstraints">
+          <cs:ScalarProperty Name="Id" ColumnName="Id" />
+          <cs:Condition ColumnName="ConstraintType" Value="UNIQUE"/>
+        </cs:MappingFragment>
+      </cs:EntityTypeMapping>
+      <cs:EntityTypeMapping TypeName="Store.CheckConstraint">
+        <cs:MappingFragment StoreEntitySet="SConstraints">
+          <cs:ScalarProperty Name="Id" ColumnName="Id" />
+          <cs:Condition ColumnName="ConstraintType" Value="CHECK"/>
+        </cs:MappingFragment>
+        <cs:MappingFragment StoreEntitySet="SCheckConstraints">
+          <cs:ScalarProperty Name="Id" ColumnName="Id" />
+          <cs:ScalarProperty Name="Expression" ColumnName="Expression" />
+        </cs:MappingFragment>
+      </cs:EntityTypeMapping>
+      <cs:EntityTypeMapping TypeName="Store.PrimaryKeyConstraint">
+        <cs:MappingFragment StoreEntitySet="SConstraints">
+          <cs:ScalarProperty Name="Id" ColumnName="Id" />
+          <cs:Condition ColumnName="ConstraintType" Value="PRIMARY KEY"/>
+        </cs:MappingFragment>
+      </cs:EntityTypeMapping>
+      <cs:EntityTypeMapping TypeName="Store.ForeignKeyConstraint">
+        <cs:MappingFragment StoreEntitySet="SConstraints">
+          <cs:ScalarProperty Name="Id" ColumnName="Id" />
+          <cs:Condition ColumnName="ConstraintType" Value="FOREIGN KEY"/>
+        </cs:MappingFragment>
+        <cs:MappingFragment StoreEntitySet="SForeignKeyConstraints">
+          <cs:ScalarProperty Name="Id" ColumnName="Id" />
+          <cs:ScalarProperty Name="UpdateRule" ColumnName="UpdateRule" />
+          <cs:ScalarProperty Name="DeleteRule" ColumnName="DeleteRule" />
+        </cs:MappingFragment>
+      </cs:EntityTypeMapping>
     </cs:EntitySetMapping>
-    <cs:EntitySetMapping Name="PrimaryKeys" StoreEntitySet="SPrimaryKeys" TypeName="Provider.PrimaryKey">
+
+    <cs:EntitySetMapping Name="ViewConstraints" >
+      <cs:EntityTypeMapping TypeName="Store.UniqueConstraint" >
+        <cs:MappingFragment StoreEntitySet="SViewConstraints">
+          <cs:ScalarProperty Name="Id" ColumnName="Id" />
+          <cs:ScalarProperty Name="Name" ColumnName="Name" />
+          <cs:ScalarProperty Name="IsDeferrable" ColumnName="IsDeferrable" />
+          <cs:ScalarProperty Name="IsInitiallyDeferred" ColumnName="IsInitiallyDeferred" />
+          <cs:Condition ColumnName="ConstraintType" Value="UNIQUE"/>
+        </cs:MappingFragment>
+      </cs:EntityTypeMapping>
+      <cs:EntityTypeMapping TypeName="Store.CheckConstraint" >
+        <cs:MappingFragment StoreEntitySet="SViewConstraints">
+          <cs:ScalarProperty Name="Id" ColumnName="Id" />
+          <cs:ScalarProperty Name="Name" ColumnName="Name" />
+          <cs:ScalarProperty Name="IsDeferrable" ColumnName="IsDeferrable" />
+          <cs:ScalarProperty Name="IsInitiallyDeferred" ColumnName="IsInitiallyDeferred" />
+          <cs:ScalarProperty Name="Expression" ColumnName="Expression" />
+          <cs:Condition ColumnName="ConstraintType" Value="CHECK"/>
+        </cs:MappingFragment>
+      </cs:EntityTypeMapping>
+      <cs:EntityTypeMapping TypeName="Store.PrimaryKeyConstraint" >
+        <cs:MappingFragment StoreEntitySet="SViewConstraints">
+          <cs:ScalarProperty Name="Id" ColumnName="Id" />
+          <cs:ScalarProperty Name="Name" ColumnName="Name" />
+          <cs:ScalarProperty Name="IsDeferrable" ColumnName="IsDeferrable" />
+          <cs:ScalarProperty Name="IsInitiallyDeferred" ColumnName="IsInitiallyDeferred" />
+          <cs:Condition ColumnName="ConstraintType" Value="PRIMARY KEY"/>
+        </cs:MappingFragment>
+      </cs:EntityTypeMapping>
+      <cs:EntityTypeMapping TypeName="Store.ForeignKeyConstraint" >
+        <cs:MappingFragment StoreEntitySet="SViewConstraints">
+          <cs:ScalarProperty Name="Id" ColumnName="Id" />
+          <cs:ScalarProperty Name="Name" ColumnName="Name" />
+          <cs:ScalarProperty Name="IsDeferrable" ColumnName="IsDeferrable" />
+          <cs:ScalarProperty Name="IsInitiallyDeferred" ColumnName="IsInitiallyDeferred" />
+          <cs:ScalarProperty Name="UpdateRule" ColumnName="UpdateRule" />
+          <cs:ScalarProperty Name="DeleteRule" ColumnName="DeleteRule" />
+          <cs:Condition ColumnName="ConstraintType" Value="FOREIGN KEY"/>
+        </cs:MappingFragment>
+      </cs:EntityTypeMapping>
+    </cs:EntitySetMapping>
+
+    <cs:EntitySetMapping Name="TableForeignKeys" StoreEntitySet="SForeignKeys" TypeName="Store.ForeignKey">
       <cs:ScalarProperty Name="Id" ColumnName="Id" />
-      <cs:ScalarProperty Name="Name" ColumnName="Name" />
       <cs:ScalarProperty Name="Ordinal" ColumnName="Ordinal" />
     </cs:EntitySetMapping>
-    <cs:EntitySetMapping Name="Relationships" StoreEntitySet="SRelationships" TypeName="Provider.Relationship">
+
+    <cs:EntitySetMapping Name="ViewForeignKeys" StoreEntitySet="SViewForeignKeys" TypeName="Store.ForeignKey">
       <cs:ScalarProperty Name="Id" ColumnName="Id" />
-      <cs:ScalarProperty Name="Name" ColumnName="Name" />
-      <cs:ScalarProperty Name="IsCascadeDelete" ColumnName="IsCascadeDelete" />
+      <cs:ScalarProperty Name="Ordinal" ColumnName="Ordinal" />
     </cs:EntitySetMapping>
-    <cs:EntitySetMapping Name="RelationshipColumnMaps" StoreEntitySet="SRelationshipColumnMaps" TypeName="Provider.RelationshipColumnMap">
-      <cs:ScalarProperty Name="Id" ColumnName="Id" />
-      <cs:ScalarProperty Name="Ordinal" ColumnName="MapOrdinal" />
-    </cs:EntitySetMapping>
-    <cs:AssociationSetMapping Name="ColumnPrimaryKeys" StoreEntitySet="SPrimaryKeys" TypeName="Provider.ColumnPrimaryKey">
+
+    <cs:AssociationSetMapping Name="TableTableColumns" StoreEntitySet="STableColumns" TypeName="Store.TableOrViewColumn">
+      <cs:EndProperty Name="Parent">
+        <cs:ScalarProperty Name="Id" ColumnName="ParentId" />
+      </cs:EndProperty>
       <cs:EndProperty Name="Column">
         <cs:ScalarProperty Name="Id" ColumnName="Id" />
       </cs:EndProperty>
-      <cs:EndProperty Name="PrimaryKey">
+    </cs:AssociationSetMapping>
+    
+    <cs:AssociationSetMapping Name="ViewViewColumns" StoreEntitySet="SViewColumns" TypeName="Store.TableOrViewColumn">
+      <cs:EndProperty Name="Parent">
+        <cs:ScalarProperty Name="Id" ColumnName="ParentId" />
+      </cs:EndProperty>
+      <cs:EndProperty Name="Column">
         <cs:ScalarProperty Name="Id" ColumnName="Id" />
       </cs:EndProperty>
     </cs:AssociationSetMapping>
-    <cs:AssociationSetMapping Name="RelationshipRelationshipColumnMaps" StoreEntitySet="SRelationshipColumnMaps" TypeName="Provider.RelationshipRelationshipColumnMap">
-      <cs:EndProperty Name="Relationship">
-        <cs:ScalarProperty Name="Id" ColumnName="RelationshipId" />
+
+    <cs:AssociationSetMapping Name="TableTableConstraints" StoreEntitySet="SConstraints" TypeName="Store.TableOrViewConstraint">
+      <cs:EndProperty Name="Parent">
+        <cs:ScalarProperty Name="Id" ColumnName="ParentId" />
       </cs:EndProperty>
-      <cs:EndProperty Name="RelationshipColumnMap">
+      <cs:EndProperty Name="Constraint">
         <cs:ScalarProperty Name="Id" ColumnName="Id" />
       </cs:EndProperty>
     </cs:AssociationSetMapping>
-    <cs:AssociationSetMapping Name="FromColumnRelationshipColumnMaps" StoreEntitySet="SRelationshipColumnMaps" TypeName="Provider.FromColumnRelationshipColumnMap">
+
+    <cs:AssociationSetMapping Name="TableConstraintColumns" StoreEntitySet="SConstraintColumns" TypeName="Store.TableOrViewConstraintColumn">
+      <cs:EndProperty Name="Constraint">
+        <cs:ScalarProperty Name="Id" ColumnName="ConstraintId" />
+      </cs:EndProperty>
       <cs:EndProperty Name="Column">
-        <cs:ScalarProperty Name="Id" ColumnName="FromColumnId" />
+        <cs:ScalarProperty Name="Id" ColumnName="ColumnId" />
       </cs:EndProperty>
-      <cs:EndProperty Name="RelationshipColumnMap">
+    </cs:AssociationSetMapping>
+
+    <cs:AssociationSetMapping Name="TableConstraintForeignKeys" StoreEntitySet="SForeignKeys" TypeName="Store.ConstraintForeignKey">
+      <cs:EndProperty Name="Constraint">
+        <cs:ScalarProperty Name="Id" ColumnName="ConstraintId" />
+      </cs:EndProperty>
+      <cs:EndProperty Name="ForeignKey">
         <cs:ScalarProperty Name="Id" ColumnName="Id" />
       </cs:EndProperty>
     </cs:AssociationSetMapping>
-    <cs:AssociationSetMapping Name="ToColumnRelationshipColumnMaps" StoreEntitySet="SRelationshipColumnMaps" TypeName="Provider.ToColumnRelationshipColumnMap">
+
+    <cs:AssociationSetMapping Name="ToTableForeignKeyColumns" StoreEntitySet="SForeignKeys" TypeName="Store.ToForeignKeyColumn">
+      <cs:EndProperty Name="ForeignKey">
+        <cs:ScalarProperty Name="Id" ColumnName="Id" />
+      </cs:EndProperty>
       <cs:EndProperty Name="Column">
         <cs:ScalarProperty Name="Id" ColumnName="ToColumnId" />
       </cs:EndProperty>
-      <cs:EndProperty Name="RelationshipColumnMap">
+    </cs:AssociationSetMapping>
+
+    <cs:AssociationSetMapping Name="FromTableForeignKeyColumns" StoreEntitySet="SForeignKeys" TypeName="Store.FromForeignKeyColumn">
+      <cs:EndProperty Name="ForeignKey">
         <cs:ScalarProperty Name="Id" ColumnName="Id" />
       </cs:EndProperty>
+      <cs:EndProperty Name="Column">
+        <cs:ScalarProperty Name="Id" ColumnName="FromColumnId" />
+      </cs:EndProperty>
     </cs:AssociationSetMapping>
-    <cs:AssociationSetMapping Name="TableTableColumns" StoreEntitySet="STableColumns" TypeName="Provider.TableTableColumn">
-      <cs:EndProperty Name="Table">
-        <cs:ScalarProperty Name="Id" ColumnName="TableId" />
+
+    <cs:AssociationSetMapping Name="ViewViewConstraints" StoreEntitySet="SViewConstraints" TypeName="Store.TableOrViewConstraint">
+      <cs:EndProperty Name="Parent">
+        <cs:ScalarProperty Name="Id" ColumnName="ParentId" />
       </cs:EndProperty>
+      <cs:EndProperty Name="Constraint">
+        <cs:ScalarProperty Name="Id" ColumnName="Id" />
+      </cs:EndProperty>
+    </cs:AssociationSetMapping>
+
+    <cs:AssociationSetMapping Name="ViewConstraintColumns" StoreEntitySet="SViewConstraintColumns" TypeName="Store.TableOrViewConstraintColumn">
+      <cs:EndProperty Name="Constraint">
+        <cs:ScalarProperty Name="Id" ColumnName="ConstraintId" />
+      </cs:EndProperty>
       <cs:EndProperty Name="Column">
+        <cs:ScalarProperty Name="Id" ColumnName="ColumnId" />
+      </cs:EndProperty>
+    </cs:AssociationSetMapping>
+
+    <cs:AssociationSetMapping Name="ViewConstraintForeignKeys" StoreEntitySet="SViewForeignKeys" TypeName="Store.ConstraintForeignKey">
+      <cs:EndProperty Name="Constraint">
+        <cs:ScalarProperty Name="Id" ColumnName="ConstraintId" />
+      </cs:EndProperty>
+      <cs:EndProperty Name="ForeignKey">
         <cs:ScalarProperty Name="Id" ColumnName="Id" />
       </cs:EndProperty>
     </cs:AssociationSetMapping>
-    <cs:AssociationSetMapping Name="ViewViewColumns" StoreEntitySet="SViewColumns" TypeName="Provider.ViewViewColumn">
-      <cs:EndProperty Name="View">
-        <cs:ScalarProperty Name="Id" ColumnName="ViewId" />
+
+    <cs:AssociationSetMapping Name="ToViewForeignKeyColumns" StoreEntitySet="SViewForeignKeys" TypeName="Store.ToForeignKeyColumn">
+      <cs:EndProperty Name="ForeignKey">
+        <cs:ScalarProperty Name="Id" ColumnName="Id" />
       </cs:EndProperty>
-      <cs:EndProperty Name="ViewColumn">
+      <cs:EndProperty Name="Column">
+        <cs:ScalarProperty Name="Id" ColumnName="ToColumnId" />
+      </cs:EndProperty>
+    </cs:AssociationSetMapping>
+
+    <cs:AssociationSetMapping Name="FromViewForeignKeyColumns" StoreEntitySet="SViewForeignKeys" TypeName="Store.FromForeignKeyColumn">
+      <cs:EndProperty Name="ForeignKey">
         <cs:ScalarProperty Name="Id" ColumnName="Id" />
       </cs:EndProperty>
+      <cs:EndProperty Name="Column">
+        <cs:ScalarProperty Name="Id" ColumnName="FromColumnId" />
+      </cs:EndProperty>
     </cs:AssociationSetMapping>
-    <cs:AssociationSetMapping Name="FunctionFunctionParameters" StoreEntitySet="SFunctionParameters" TypeName="Provider.FunctionFunctionParameter">
-      <cs:EndProperty Name="Function">
-        <cs:ScalarProperty Name="Id" ColumnName="FunctionId" />
+
+    <cs:AssociationSetMapping Name="FunctionFunctionParameters" StoreEntitySet="SFunctionParameters" TypeName="Store.RoutineParameter">
+      <cs:EndProperty Name="Routine">
+        <cs:ScalarProperty Name="Id" ColumnName="ParentId" />
       </cs:EndProperty>
       <cs:EndProperty Name="Parameter">
         <cs:ScalarProperty Name="Id" ColumnName="Id" />
       </cs:EndProperty>
     </cs:AssociationSetMapping>
+
+    <cs:AssociationSetMapping Name="ProcedureProcedureParameters" StoreEntitySet="SProcedureParameters" TypeName="Store.RoutineParameter">
+      <cs:EndProperty Name="Routine">
+        <cs:ScalarProperty Name="Id" ColumnName="ParentId" />
+      </cs:EndProperty>
+      <cs:EndProperty Name="Parameter">
+        <cs:ScalarProperty Name="Id" ColumnName="Id" />
+      </cs:EndProperty>
+    </cs:AssociationSetMapping>
+
   </cs:EntityContainerMapping>
+
 </Mapping>
\ No newline at end of file

Thread
Connector/NET commit: r1311 - trunk/MySql.Data.Entity/Provider/Propertiesrburnett3 Jun