DATABASE: monotest ========================== TABLE : numeric_family ================================== TABLE: numeric_family id int PRIMARY KEY NOT NULL type_bit bit NULL type_tinyint tinyint NULL type_smallint smallint NULL type_int int NULL type_bigint bigint NULL type_decimal decimal (38, 0) NULL type_numeric numeric (38, 0) NULL type_money money NULL type_smallmoney smallmoney NULL DATA: insert into numeric_family values (1,1,255,32767,2147483647,9223372036854775807,1000,1000,922337203685477.5807,214748.3647); insert into numeric_family values (2,0,0,-32768,-2147483648,-9223372036854775808,-1000,-1000,-922337203685477.5808,-214748.3648); insert into numeric_family values (3,0,0,0,0,0,0,0,0,0); insert into numeric_family values (4,null,null,null,null,null,null,null,null,null); go ========================== END TABLE : numeric_family =============================== ========================== TABLE : binary_family ==================================== TABLE: binary_family id int PRIMARY KEY NOT NULL type_binary binary NULL type_varbinary varbinary (255) NULL type_blob image NULL type_tinyblob image NULL type_mediumblob image NULL type_longblob_image image NULL insert into binary_family values (1, convert (image, '555555'), convert (image, '0123456789012345678901234567890123456789012345678901234567890123456789'), convert (image, '66666666'), convert (image, '777777'), convert (image, '888888'), convert (image, '999999')); --insert into binary_family values (2, --insert into binary_family values (3, insert into binary_family values (4,null,null,null,null,null,null); ========================== END TABLE : binary_family ================================ =================================== TABLE: EMPLOYEE ================================ TABLE : employee id int PRIMARY KEY NOT NULL fname varchar (50) NOT NULL lname varchar (50) NULL dob datetime NOT NULL doj datetime NOT NULL email varchar (50) NULL insert into employee values (1, 'suresh', 'kumar', '1978-08-22', '2001-03-12', 'suresh@gmail.com'); insert into employee values (2, 'ramesh', 'rajendran', '1977-02-15', '2005-02-11', 'ramesh@yahoo.com'); insert into employee values (3, 'venkat', 'ramakrishnan', '1977-06-12', '2003-12-11', 'ramesh@yahoo.com'); insert into employee values (4, 'ramu', 'dhasarath', '1977-02-15', '2005-02-11', 'ramesh@yahoo.com'); =============================== END TABLE: EMPLOYEE ================================ =============================== STORED PROCEDURE : sp_clean_employee_table ========= SP : sp_clean_employee_table NAME: sp_clean_employee_table PROCESS: delete from employee where id > 6000; ============================ END STORED PROCEDURE : sp_clean_employee_table ========= ============================ STORED PROCEDURE : sp_get_age ========================== NAME: procedure sp_get_age PARAMETER : NAME : fname TYPE: varchar (50) DIRECTION : in NAME : age TYPE: int DIRECTION : out PROCESS: select age = datediff (day, dob, getdate ()) from employee where fname like fname; return age; =================================== END PROCEDURE : sp_get_age =====================