stored procesures

Posted by Pokuri31 under ASP.NET on 10/20/2008 | Views : 1407 | Status : [Member] | Replies : 3
what is stored procedure ? how to write sp ? with one example............




Responses

Posted by: Bubbly on: 2/20/2010 [Member] Bronze

Up
0
Down
Hello,

check this link

http://msdn.microsoft.com/en-us/library/aa214299(SQL.80).aspx

++
Thanks & Regards,
Deepika

Pokuri31, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Amatya on: 5/16/2015 [Member] Bronze | Points: 25

Up
0
Down
Its a subroutine which is used to access the Database.
here is Sample which i have written

USE [Aditya]
GO
/****** Object: StoredProcedure [dbo].[InsertPierType] Script Date: 05/16/2015 15:24:57 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
ALTER PROCEDURE [dbo].[InsertPierType]
(
@PierType varchar(255)
)
AS
BEGIN
SET NOCOUNT OFF;
Declare @dt DateTime
Set @dt = GETDATE()
insert into TblPierType(PierType )

values(@PierType )

END


Feel free to share informations 9731764134
Thanks

Pokuri31, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Raja on: 10/20/2008 [Member] Starter

Up
0
Down
A stored procedure is a group of Transact-SQL statements compiled into a single execution plan.

Writing SP is simple, open SQL Server Management studio, right click Stored Procedures folder and create new. You can write SP in SQL Analyzer or notepad too.

Sample SP code.

CREATE PROCEDURE ExampleStoredProcedure AS

SET ROWCOUNT 10
SELECT Name, Address from MyTable



For more details, visit following links.

http://databases.about.com/od/sqlserver/a/storedprocedure.htm

http://www.sql-server-performance.com/articles/dba/stored_procedures_basics_p1.aspx

http://msdn.microsoft.com/en-us/library/aa174792.aspx

http://www.quackit.com/sql_server/tutorial/sql_server_stored_procedures.cfm



Regards,
Raja, USA

Pokuri31, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response