Tuesday, 12 June 2012

How to create a procedure

how to create a procedure in sql server

friends today i will tell you how to create a procedure
syntax of  creating procedure-- create procedure procedure name
Example --suppose you create a table which name is fee and its fields name is name,age,class,city and you want to see only name and city fields in output
you right following query
to create a procedure 
--create procedure ravi
 as begin
select name,city from fee
end
Then you press f5--
To execute store procedure you right following query
exec ravi
Then press f5
Thank you

Tuesday, 5 June 2012

How to create a view in a sql server

How to create a view in a sql server

friends today i will tell you how to create a view and what is the use of view ..when we fire select statement in a table the query doesn't save but when we create a view the query save in a view folder ....
friend suppose you create a table employee and you want to see data many time and you don't want to write select query in many time the better option is create a view on a table....
syntax-create view view-name statement
example--create view cc select * from employee

Thank you