General purpose queries: Query 1: Retrieve List of All Database EXEC sp_helpdb Query 2: Display Text of Stored Procedure, Trigger, View exec sp_helptext @objname = 'Object_Name' Query 3: Get All Stored Procedure Relate To Database SELECT DISTINCT o. name , o.xtype FROM syscomments c INNER JOIN sysobjects o ON c.id=o.id WHERE o.xtype= 'P' To retrieve the View use “V” instead of “P” and for functions use “FN. Query 4: Get All Stored Procedure Relate To Table SELECT DISTINCT o. name , o.xtype FROM syscomments c INNER JOIN sysobjects o ON c.id=o.id ...
Popular posts from this blog
DML OPERATIONS: Data Manipulation Language is a one of the Subset of SQL. These SQL commands are used to store, modify, and delete data from database tables. In this category we have INSERT, UPDATE, and DELETE commands. Different DML statements are • Select • Insert • Update • Delete Select: The SELECT statement is used to select data from a database. The result is stored in a result table, called the result-set. The SELECT command is the most commonly used command in SQL. It allows database users to retrieve the specific information they desire from an operational database. Syntax: SELECT column_name(s) FROM table_name and SELECT * FROM table_name Example: consider the table student_details. To select the first name of all the students the query would be SELECT first_name FROM student_details; If we want to select all the columns from the table, we use the following SELECT statement: SELECT * FROM student_details; Insert: The ...
Comments
Post a Comment