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

Wednesday, 30 May 2012

How to delete table from database

How to delete table from database

friends today i will tell you how to delete a table from database some time we want to delete
table so we use following query to delete  a table from database ..
Structure .. Drop Table-name
Example...Suppose you create a table fee and you want to delete this table so you use following query
to delete a table from  database
Drop fee
Thank you

How to delete data in a table

How to delete data in a table 

Friends today i will tell you how to delete a data in a table. some time we want to delete a data in a table
So we will use following structure  to delete data in a table
Structure-delete table_name
Example -Suppose you create a table Admission and you want to delete a data of this table so you use following query
deleter Admission
Thank you

How to add field in a table

how to add field in a table 

friends today i will tell you how to add field in a table
suppose you create a table which name is student_fee And you include name ,age city field in a table and you want to add mobile no field in a table to perform this task you will need to this query
alter table  student_fee add mobile_no numeric(15)
Thank you

Friday, 18 May 2012

how to rename a database

friends today i tell you how to rename a database
syntax of rename a database --- sp_rename old database name  new database name
example- sp_renamedb rahul ankit
Thank you



Thursday, 17 May 2012

How to create a database in sql

how to create a database in sql server

friends today i will tell you how to create a database in sql
you right following code in query editor 
syntax of  creating a database .....
create keyword  database keyword database name 
example of creating a database 
create database Aman
Thank you