My original flow would've been to:
- use Server Explorer in Visual Studio to create tables, views and stored procs.
- Create the .xsd model 'from database' instead of by hand.
The xsd really is the model for how the data is shaped in the application, rather than in storage at the database.
Unsure if there is a way to explicitly export/create SQL scripts from your .xsd designer. If it was enough of a time-saver, you could:
- create a new TSQL query, copy paste the XSD into a
varchar(max)
variable.
- use OPENXML to get a set of the names of the tables & their columns.
- create SQL statements for
CREATE TABLE