So to ensure that you include related tables into your select queries, views are a good medium.What are views Views are nothing but a virtual table (note that a table is not created for a view).You can think of a view as a lens looking at one or more tables.
CREATE TRIGGER TRGI_VW_PAYMENT ON VW_LAST_PAYMENT_DETAILS INSTEAD OF INSERT AS BEGIN INSERT INTO STUDENT_PAYMENT SELECT STD_ID, PAY_AMT, PAY_DATE FROM INSERTED END This Code working fine.
But Instead of static field i want dynamic field here, like i want to retrieve column name from information_schema.columns.
Sometimes coming up with a short descriptive name for your view is easier said than done. You can also see that we have take the birth date column and calculated age.
The example below shows all of the code from the view.
The column names in an expanded column list are enclosed in quote marks to account for the possibility that the columns of the base object were originally entered with quotes and require them for the query to be syntactically correct.
As an example, assume that the statement, the database can create the view even if the defining query of the view cannot be executed.
Mullins Views are a very useful feature of relational technology in general, and Microsoft SQL Server specifically.
They are wonderful tools that ease data access and system development when used prudently.
Furthermore, views are simple to create and implement.