Why SQLMetal.exe produces different results for SQL Compact 3.5 and SQL Express 2008 (foreign keys are missing)

Here's the story: I created a SQL Compact 3.5 database and used SQLMetal.exe to create a DataContext for it. It worked fine, but I soon realized that it just wasn't right for my needs, so I decided to go for SQL Express 2008. I ran the same SQL script that I used for Compact to create the schema, and then activated SQLMetal. exe. I did not expect the generated DataContext to be different, but for some reason I lacked all the relationships.

The SQL Compact command line is used here:

SQlMetal.exe /code:MyCode.cs MyDatabase.sdf

And here is SQL Express 2008:

SQlMetal.exe /code:MyCode.cs /server:MyServer /database:MyDatabase

Any ideas?

+3
1

SQL Server 2005. .

+1

Source: https://habr.com/ru/post/1714242/


All Articles