Showing posts with label Triggers. Show all posts
Showing posts with label Triggers. Show all posts

What are triggers? How to invoke a trigger on demand?


               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.

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

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


BenefitExplanation of benefit
Modular programming

You can write a stored procedure once, then call it from multiple places in your application.