by Yogesh | Jun 27, 2016 | SQL Server
create function ganesha(@id int) returns int as begin declare @work int select @work=avg(salary) from emp_info where id=@id; return @work; end; declare @my int select dbo.ganesha(1) b) alter function myfun(@date datetime) returns varchar(50) as begin declare @myoutput...
by Yogesh | Jun 25, 2016 | SQL Server
–Self Join select *from emp as p where p.salary=p.gsalary –Equi Join select d.*, e.* from dept as d , emp as e where d.id=e.deptids –Inner Join select d.*, e.* from dept as d inner join emp as e on d.id=e.deptids –Outer Join –Left Outer...
by Yogesh | Jun 24, 2016 | SQL Server
create trigger getid on [login] after insert as select @@identity as mynewid insert into [Login](username ,password) values('aabc','bbcc') disable trigger getid on [login] enable trigger getid on [login] create trigger trig_uppercase on [state] after insert ,update as...
by Yogesh | Jun 16, 2016 | SQL Server
Generally we face a problem when we want to upgrade our sql server management studio version , all the databases are lost. To take all database backup one by one is completely irritating. To overcome this irritating job , our sql provides a great solution to take all...
by Yogesh | Apr 14, 2015 | SQL Server
Stored Procedure: Set of logical group of SQL statements which are grouped to perform a specific task. Benefits of Using the Stored Procedure Reduces the amount of information sent to the database server. Compilation step is required only once when the stored...