Posts

Showing posts with the label Unique key constraint

BAPI for material storage location Add

 We can add material storage location plant wise using third party app or web. BAPI names : BAPI_MATERIAL_MAINTAINDATA_RT Import parameters: HEADDATA: Material Tables: STORAGELOCATIONDATA: Material: Plant: STGE_LOC:   STORAGELOCATIONDATAX: Material: Plant: STGE_LOC:   use below code after completing steps. CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'.        

Unique key constraint

Unique key constraint: We use UNIQUE constraint to enforce uniqueness of a column i.e the column shouldn't allow any duplicate values. We can add a Unique constraint thru the designer or using a query. To add a unique constraint using SQL server management studio designer: 1. Right-click on the table and select Design 2. Right-click on the column, and select Indexes/Keys... 3. Click Add 4. For Columns, select the column name you want to be unique. 5. For Type, choose Unique Key. 6. Click Close, Save the table. To create the unique key using a query: Alter Table Table_Name Add Constraint Constraint_Name Unique (Column_Name) Both primary key and unique key are used to enforce, the uniqueness of a column. So, when do you choose one over the other? A table can have, only one primary key. If you want to enforce uniqueness on 2 or more columns, then we use unique key constraint. What is the difference between Primary key constraint and Unique key constraint? ...