Triggers are special kind of stored procedures that get
executed automatically when an INSERT, UPDATE or DELETE operation takes place
on a table. . It can be used to maintain referential integrity. A trigger can call
stored procedure.
Showing posts with label Triggers. Show all posts
Showing posts with label Triggers. Show all posts
how to get the column names and corresponding datatypes in particular table using SQL Server
SELECT column_name 'Column Name',
data_type 'Data Type',
character_maximum_length 'Maximum Length'
FROM information_schema.columns
SQL SERVER Ranking Functions - RANK, DENSE_RANK, NTILE, ROW_NUMBER SQL query to delete duplicate rows SQL Server CTE(Common Table Expression) and Recursive Queries CTE Recursive query for data hierarchy(Parent Child hierarchy) Different methods of SQL queries to insert data in tables SQL query to display all columns with datatypes for a given Table name SQL query to check two tables have identical data SQL query to search a string in database Schema SQL query to display total number of rows for each table in database SQL query to delete duplicate rows
Create a table EmpDtl1 with some duplicate rows as shown below to to understand different methods of delete duplicate rows
create table EmpDup(empid int,name varchar(20))Using SQL Data Definition Language (DDL) to Create Data Tables and Other Database Objects
Using the CREATE TABLE Statement to Create Tables
Tables are the primary structures used to hold data in a
relational database. In a typical multi-user environment, the database
administrator (dba) creates the tables that serve as the data stores for the organization's data. Users normally create
their own temporary tables used to store data extracted from the main
organizational tables.
Benefits of Stored Procedures
| Benefit | Explanation of benefit |
|---|---|
| Modular programming | You can write a stored procedure once, then call it from multiple places in your application. |
Subscribe to:
Posts (Atom)