Solved

SQL Server Stored Procedures and Transaction Questions

Posted on 2007-11-21
3
561 Views
Last Modified: 2008-02-02
Hello Experts!
Stored Procedures:
Is it possible to pass an array of parameters object directly to a stored procedure? I mean I don;t want to pass each parameter individualy, but pass a single array containing all pre-configured paramentes to the stored procedure.
I would like to see an example using C#.

Transactions:
The SqlTransaction object has the IsolationLevel property. I understand perfectly the ReadUncomminted, ReadComminted, RepeatableRead and Serializable isolation levels, but I have no idea about what the Unspecified level is. When, how and what for is it used?

Thanks!
0
Comment
Question by:andrepires
3 Comments
 
LVL 18

Accepted Solution

by:
Yveau earned 167 total points
Comment Utility
Stored Procedures:
No, there is not an array type in SQL Server. Alternatives is passing a parameter of type table or passing a string like: 'parm1=value1, parm2=value2, ...'

Transactions:
... unspecified is probably the 'use whatever the server is using at this moment, don't worry about it, just run the SQL code!' option. Not sure on this one ...

Hope this helps ...
0
 
LVL 75

Assisted Solution

by:Aneesh Retnakaran
Aneesh Retnakaran earned 167 total points
Comment Utility
>Is it possible to pass an array of parameters object directly to a stored procedure?
Eventhough there is no array datatype, we can pass those values as CSV (Comma separated values). The logic should be implemented inside the sp to handle these.


0
 
LVL 12

Assisted Solution

by:kselvia
kselvia earned 166 total points
Comment Utility
Here are a couple of examples of using csv values as stores procedure arguments

http://vyaskn.tripod.com/passing_arrays_to_stored_procedures.htm#top

http://www.sommarskog.se/arrays-in-sql-2005.html
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Join & Write a Comment

It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
Ever needed a SQL 2008 Database replicated/mirrored/log shipped on another server but you can't take the downtime inflicted by initial snapshot or disconnect while T-logs are restored or mirror applied? You can use SQL Server Initialize from Backup…
Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…
Viewers will learn how to use the UPDATE and DELETE statements to change or remove existing data from their tables. Make a table: Update a specific column given a specific row using the UPDATE statement: Remove a set of values using the DELETE s…

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now