DBHawk Tutorials

This section contains the features and various tutorials to show how to do various database tasks with DBHawk

SQL Server Add Foreign Key Constraints

DBHawk includes an Add Foreign Key Constraints feature.

After creating SQL Server Table, you may want to add Primary and Foreign Key constraints.

The add column part in the wizard let me add the default constraints, but I want a foreign key from ManagerID to EmployeeID.   Checked the ‘Options’ drop down and found what I needed.

First, add new Primary Key Constraint.

sql-server-add-constraints

SQL Server Add Constraints

Clicked on the ‘Constraints’ menu and up popped the ‘New Constraint’ wizard.  Created a primary key on EmployeeID and then created a foreign key from ManagerID to EmployeeID.  The tool went ahead and created a unique clustered index on the primary key.

sql-server-add-foreign-key

SQL Server Add Foreign Key

For more details about how to create foreign key relationships visit MS SQL Document

Tutorials:
SQL Server Create Table SQL Server Add Foreign Key SQL Server alter table add column Export data from SQL server Step-by-Step Guide to Connect DBHawk with MongoDB Atlas database Tutorial

Many Databases, Single Tool, No Client Software

Get started for free. Sign Up to see how DBHawk provides zero trust database access and development across all databases.
Get Started Free
No Credit card required!