SQL Step by Step
SQL Step by Step
SQL Step by Step
FILEGROUPS
Add a Filegroup to a Database
Click Start, and then click SQL Server Management Studio.
The Connect to Server dialog box appears. Click Connect.
In the Object Explorer pane, expand Databases, and then click your database.
Right-click your database, and then click Properties.
The Database Properties dialog box appears. In the Select a page pane, click Filegroups.
Click Add.
In the Name field, type SecondaryFilegroup.
Set the Filegroup to Read-only
Select the Read-Only check box.
Click OK.
DATABASES
Page 1
Add a schema
In the Object Explorer pane, expand AdventureWorksDemo, and then click Tables.
Right-click Tables, and then click New Table.
In the Properties pane, in the name field, type DemoTable.
In the Schema list, click SchemaDemo.
In the Column Name field, type FirstColumn.
On the toolbar, click Save DemoTable.
POLICY MANAGEMENT
Define the New Custom Policy
Click Start, and then click SQL Server Management Studio.
The Connect to Server dialog box appears. Click Connect.
In the Object Explorer pane, navigate to NY-SQL-01 | Management | Policy Management | Facets | Table.
Right-click Table and then click New Condition.
The Create New Condition window opens. In the Name field, type Table Condition.
In the Expression box, in the Field list, click @HasIndex.
Make sure that the Operator list is set to =.
In the Value list, click True.
Click OK.
In the Object Explorer pane, right-click Policies, and then click New Policy.
The Create New Policy window opens. In the Name field, type Table Policy.
In the Check condition list, click Table Condition.
In the Against targets box, in the Every Database list, click New condition.
The Create New Condition window opens. In the Name field, type AdventureWorks2008.
In the Expression box, in the Field list, click @Name.
Make sure that the Operator list is set to =.
In the Value field, type 'AdventureWorks2008'.
Click OK.
In the Execution Mode list, click On schedule.
Click Pick and then click OK.
Select the Enabled check box.
In the Server restrictions list, make sure the option is set to None.
Click OK.