-
Before you generate data, open the Data menu, point to T-SQL Editor, and click New Query Connection.
-
If a connection exists for the database in your isolated development environment, go to step 7.
-
Click New Connection.
The Connection Properties dialog box appears.
-
In Server name, type or click the name of the database server to which you deployed the database, such as (local)\SQLExpress.
-
In Log on to the Server, click Use Windows Authentication.
-
In Connect to a database, click Select or enter a database name, type AdvWorksSandbox, and click OK.
The connection is created and added to the list in the Connect to Database dialog box.
-
In the Connect to Database dialog box, click the connection string that corresponds to the database in your isolated development environment, and click OK.
The Transact-SQL (T-SQL) editor appears with an active connection to the AdvWorksSandbox database.
-
Click OK.
The Transact-SQL (T-SQL) editor appears.
-
In the T-SQL editor, type the following T-SQL:
DISABLE TRIGGER dEmployee on [HumanResources].[Employee];
DISABLE TRIGGER uEmployee on [HumanResources].[Employee];
GO
-
On the T-SQL editor toolbar, click Execute SQL.
On the Messages tab, the following appears:
/*-----------------------------------------
disable trigger dEmployee on HumanResources.Employee;
disable trigger uEmployee on HumanResources.Employee;
-----------------------------------------*/
-
Click the window that contains the data generation plan.
-
On the Data menu, point to Data Generator, and click Preview Data Generation.
The Data Generation Preview window appears and shows a sample of the data that will be generated. If the data meets the criteria that you specified, continue to the next step. If you have to adjust the data generation plan, make the appropriate changes, and then repeat this step.
-
On the Data menu, point to Data Generator, and click Generate Data.
The Generate Data for Target Database dialog box appears.
-
In Target Database, click the connection to the AdvWorksSandbox database, and click OK.
-
When you are asked "Do you want to clear the contents of the selected tables before inserting new rows?" click Yes.
Data is generated according to your specifications. When generation has completed, a green check mark appears in each row to indicate that all data was generated successfully. If data was not generated, errors appear in the Error List window.
-
Click the T-SQL editor window.
-
In the T-SQL editor, replace the existing statements with the following T-SQL:
ENABLE TRIGGER dEmployee on [HumanResources].[Employee];
ENABLE TRIGGER uEmployee on [HumanResources].[Employee];
GO
-
On the T-SQL editor toolbar, click Execute SQL.
On the Messages tab, the following appears:
/*-----------------------------------------
enable trigger dEmployee on HumanResources.Employee;
enable trigger uEmployee on HumanResources.Employee;
-----------------------------------------*/
The triggers are now enabled.