C# Tutorials and offshore development in India
    Tutorials   Resources   Forum   Communities   Interview   Jobs   Projects   Offshore Development    
Silverlight Tutorials | Mentor | Code Converter | Articles | Code Factory | Computer Jokes | Members | Peer Appraisal | IT Companies | Bookmarks | Revenue Sharing |


Prizes & Awards
My Profile



Active Members
TodayLast 7 Days more...

New Feature: Community Sites: Create your own .NET community website and start earning from Google AdSense ! It's Free !




storedprocedure,trigger,cursor,index


Posted Date: 25 Jul 2008      Total Responses: 1

Posted By: sheeba Angela       Member Level: Gold     Points: 1


hi

in my table Example contain username ,password address,state,city.

Now i want to apply stored procedure,trigger,cursor,index concepts.
plz send me the codings.




Responses

Author: Jeeva G    25 Jul 2008Member Level: BronzeRating:     Points: 6
Stored Procedure:
Pre-Compiled set of SQL Statments..
Increases Performance
Reduces Network Traffic

Syntax:
Create Procedure Proc_name(param list)
As
Begin
// SQL Statements
End


Trigger:
Equivalent to event raising, ie, doing certain action based on events like insert, update...

syntax:
create trigger trg_name
As
begin
// sql statements
end

Cursor:
cursors are used when row by row processing is needed.
syntax
DECLARE cur_name CURSOR
FOR
SELECT username
FROM table

OPEN cur_name

FETCH NEXT FROM cur_name
INTO @usrID

WHILE @@FETCH_STATUS = 0
BEGIN

FETCH NEXT FROM cur_nmae
INTO @usrID

END

CLOSE cur_name
DEALLOCATE cur_name

Index:
to save loading time



Post Reply
You must Sign In to post a response.
Next : What is Deadlock?
Previous : System Stored Procedures
Return to Discussion Forum
Post New Message
Category: SQL Server

Related Messages



dotNet Slackers   BizTalk Adaptors    Web Design

it support

Contact Us    Privacy Policy    Terms Of Use