A stored procedure is a set of SQL commands that has been compiled and stored on the databaseserver.Once the stored procedure has been "stored", client applications can execute the stored procedureover and over again without sending it to the database server again and without compiling itagain.Stored procedures improve performance by reducing network traffic and CPU load.
Stored procedures are precompiled database queries that improve thesecurity, efficiency and usability of database client/server applications. Developersspecify a stored procedure in terms of input and output variables. They thencompile the code on the database platform and make it available to aplicationdevelopers for use in other environments, such as web applications. All of the majordatabase platforms, including Oracle, SQL Server and MySQL support storedprocedures. The major benefits of this technology are the substantial performancegains from precompiled execution, the reduction of client/server traffic,development efficiency gains from code reuse and abstraction and the securitycontrols inherent in granting users permissions on specific stored proceduresinstead of the underlying database tables.SQL Server Data types
Character strings:Data typeDescriptionStorage
char(n)Fixed-length character string. Maximum 8,000 charactersnvarchar(n)Variable-length character string. Maximum 8,000 charactersvarchar(max)Variable-length character string. Maximum 1,073,741,824characters textVariable-length character string. Maximum 2GB of text data
RDBMS stands for Relational Database Management System.RDBMS is the basis for SQL, and for all modern database systems like MS SQL Server, IBMDB2, Oracle, MySQL, and Microsoft Access.The data in RDBMS is stored in database objects called tables.A table is a collections of related data entries and it consists of columns and rows.
SQL PRIMARY KEY Constraint
The PRIMARY KEY constraint uniquely identifies each record in a database table.Primary keys must contain unique values.A primary key column cannot contain NULL values.Each table should have a primary key, and each table can have only one primary key.