CPU and memory resource governance is available since SQL server 2008, However the IO resource governance is new in SQL server 2014.
Here is - a very good blog about "IO Resource Governance in SQL Server 2014"
"By configuring the IO settings on the Resource Pools we can control the resources we want to provide for each tenant. This allows us to guarantee predictable performance regardless of the activity from other tenants or even provide differentiation in SLA for the Database Service based on the amount of the resources customers sign up to reserve.
Another scenario that many of you might find applicable is isolating your OLTP workload from any maintenance operations that need to run in the database. Rebuilding an index, for example, is a common operation that can trigger a large number of IO requests, as it needs to scan the whole index or table. By using IO Resource Governance we can limit the number of IO operations these tasks can perform and guarantee predictable performance for concurrent OLTP workload."
Sunday, November 10, 2013
Saturday, March 9, 2013
automated way to generate classes from a database
Problem:
Is there a quick way to generate classes based on DB schema by a few clicks in Visual Studio?
This seems a common enough problem to worth having an automated solution.
Solution: Turned out Microsoft has something to offer already. Its DBContext generator in ADO.Net entity data model does exactly what I am looking for.
Pr-requisites:
- create your relational database first on a SQL server, and apply physical foreign keys (FK). With FKs, the generator would add child collections in their parent classes. Below is my sample db schema.
- have DBContext generator template activated in your VS. If not, find it by searching online templates.
Steps:
1. Create a new class library project, and add a new item: "Data" - "ADO.Net entity data model".
2. Follow through a few prompts, and connect to the above database and select all tables.
3. Under the model ".edmx" branch, expand your ".tt" file to see the auto-generated classes.
Interestingly, the class name is changed from "Parents" plural to "Parent" singular. But, didn't bother to change "Children" to Child. Obviously Microsoft didn't invest money here to use an English dictionary. Lol.
4. Here you go - the nice and neat auto-generated code. Null-able types stay as null-able.
Very cool. Happy coding by not coding too much!
Is there a quick way to generate classes based on DB schema by a few clicks in Visual Studio?
This seems a common enough problem to worth having an automated solution.
Solution: Turned out Microsoft has something to offer already. Its DBContext generator in ADO.Net entity data model does exactly what I am looking for.
Pr-requisites:
- create your relational database first on a SQL server, and apply physical foreign keys (FK). With FKs, the generator would add child collections in their parent classes. Below is my sample db schema.
- have DBContext generator template activated in your VS. If not, find it by searching online templates.
Steps:
1. Create a new class library project, and add a new item: "Data" - "ADO.Net entity data model".
2. Follow through a few prompts, and connect to the above database and select all tables.
3. Under the model ".edmx" branch, expand your ".tt" file to see the auto-generated classes.
Interestingly, the class name is changed from "Parents" plural to "Parent" singular. But, didn't bother to change "Children" to Child. Obviously Microsoft didn't invest money here to use an English dictionary. Lol.
4. Here you go - the nice and neat auto-generated code. Null-able types stay as null-able.
Very cool. Happy coding by not coding too much!
Subscribe to:
Comments (Atom)




