0

Hello :)

I'm trying to create web application. I followed the tutorial given in this site :
http://aspsnippets.c...-in-ASPNet.aspx

My problem now, after I create a table and the UI. Next step show about stored procedure.
What is stored procedure use for? Do I need this even though I had a table in my database?

I'm using SQL Server Management Studio 2008 as my database platform.

Thank you :)

2
Contributors
2
Replies
16
Views
2 Years
Discussion Span
Last Post by nimz143
0

Hi

That link points back to this page so not sure which tutorial you are currently following.

In terms of what is a stored procedure, it is simply a prepared SQL statement that can be executed multiple times. For example, imagine that you have a table storing contact information (ID, Name, Age, Address etc.). If you want to get a record by ID you could write a straightforward SELECT statement such as: SELECT Name, Age, Address From ContactsTable WHERE ID = @IDParameter. Or you could create a stored procedure such as:

CREATE PROCEDURE GetContactByID
@ID int
AS
SELECT Name, Age, Address From ContactsTable WHERE ID=@ID

and then simply execute the stored procedure passing the parameter value using Exec GetContactByID 1.

Stored procedures are useful when your queries are quite complex such as using cursors or temporary tables. For basic stuff, simple SQL is sufficient. There is also a potential performance gain with stored procedures as they can be cached, but from what I understand, SQL Server has been caching the execution plans of standard queries for some time now so this may be an invalid point.

0

Hi djjeavons.

Thank you for your response. Actually, i'm following this tutorial Click Here.

Ok, now i get a basic view about this stored procedure and i will try the solution that you had suggested to me. Later on i tell the feedback about this.

Again, thanks :)

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.