Win Surprise Gifts!!!
Top 5 Contributors of the Month
Post New Question
Subscribe to Interview Questions
What is a Stored Procedure?
Posted By :
Posted Date :
October 03, 2008
Its nothing but a set of T-SQL statements combined to perform a single task of several tasks. Its basically like a Macro so when you invoke the Stored procedure, you actually run a set of statements.
You can also find related Interview Question to
What is a Stored Procedure?
How to deal with return value of stored procedure when you are using DataReader ?
To deal with such scenario, you can find "ParameterDirection.ReturnValue" in .net
You can use this parameter direction to read the return value of the stored procedure.
Following example can make it more clearer.
In case, you have following or similar type of return statement somewhere in your stored procedure.
To read this value, following code works,
Dim result As Integer = 0
Dim retValParam As New SqlClient.SqlParameter("@RETURN_VALUE", SqlDbType.Int)
retValParam.Direction = ParameterDirection.ReturnValue
result = retValParam.Value ' here the result must contain the returned value. In this case, it will be -999
Which stored procedure will you be running to add a linked server? -
What is the difference between "dynamic SQL" and "stored procedure" ?
Dynamic sql is the bunch of statements that dynamically constructed at run time and not stored in database.
Where as Stored procedures are stored in data base in complied form.
Which stored procedure will you be running to add a linked server?
what is the use of sp_who System Stored procedure In Sql Server?
Provides information about current MicrosoftÃÂ® SQL ServerT users and processes
Can we Execute stored procedure in another stored procedure?
Yes, We can Execute stored procedure in another stored procedure...
Difference between Function and Stored Procedure?
UDF can be used in the SQL statements anywhere in the WHERE/HAVING/SELECT section where as Stored procedures cannot be.
UDFs that return tables can be treated as another rowset. This can be used in JOINs with other tables.
Inline UDF's can be though of as views that take parameters and can be used in JOINs and other Rowset operations.
How will you prevent the user from viewing the text of the Stored Procedure?
We can use with Encryption in the Stored Procedure.
CREATE PROC MySample
SELECT * FROM Employee
EXEC sp_helptext MySample
Here is the result set:
The object's Comments have been encrypted.
What are the process involved in Pre-compilation of a Stored Procedure?
Sql Server will go through a Five Step Process
they are ;
4) Compile and
What is Difference between Function and Stored Procedure?
UDF can be used in the SQL statements anywhere in the WHERE/HAVING/SELECT section where as Stored procedures cannot be. UDFs that return tables can be treated as another rowset. This can be used in JOINs with other tables. Inline UDF's can be thought of as views that take parameters and can be used in JOINs and other Rowset operations.
What are the different type of objects fetched by the sp_tables catalog stored procedure?
This catalog SP returns objects of type: Tables and Views. This includes system tables as well.
Can a stored procedure call itself or recursive stored procedure? How many level SP nesting possible?
Yes. Because Transact-SQL supports recursion, you can write stored procedures that call themselves. Recursion can be defined as a method of problem solving wherein the solution is arrived at by repetitively applying it to subsets of the problem. A common application of recursive logic is to perform numeric computations that lend themselves to repetitive evaluation by the same processing steps.
Stored procedures are nested when one stored procedure calls another or executes managed code by referencing a CLR routine, type, or aggregate. You can nest stored procedures and managed code references up to 32 levels.
How many databases can access in single stored procedure and if we access limit level , what will happen..?
A)more than 8 databases and receive an error
B)No Limtit and without getting Error.
C)Both A and B incorrect.
Answer: A)more than 8 databases and receive an error
Database: Define Stored Procedure
.A stored proceduer is a named group of sql statements that have been previously created and stored in server database.
Quick Links For Interview Questions Categories:
Find questions, FAQ's and their answers related to .NET, C#, Vb.Net, Sql Server and many more.
Now you can find lots of .NET, C#, Vb.Net, SQL Server,Windows, ASP.Net related Questions and their Answers here at www.dotnetspark.com. Our aim is to help you pass your certification Exams (MCP, MCSD, MCAD etc.,) with flying scores and get good name in your company.
So, Start looking our
section daily and improve your .NET Skills. You can also help others by posting Interview Questions and their Answers in this section.
Hall of Fame
Terms of Service
Tell A Friend