Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

SQL Server Stored Procedures and Transaction Questions

Posted on 2007-11-21
3
Medium Priority
?
583 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 668 total points
ID: 20330658
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 668 total points
ID: 20332544
>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 664 total points
ID: 20337177
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

Get your Conversational Ransomware Defense e‑book

This e-book gives you an insight into the ransomware threat and reviews the fundamentals of top-notch ransomware preparedness and recovery. To help you protect yourself and your organization. The initial infection may be inevitable, so the best protection is to be fully prepared.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Why is this different from all of the other step by step guides?  Because I make a living as a DBA and not as a writer and I lived through this experience. Defining the name: When I talk to people they say different names on this subject stuff l…
In part one, we reviewed the prerequisites required for installing SQL Server vNext. In this part we will explore how to install Microsoft's SQL Server on Ubuntu 16.04.
Using examples as well as descriptions, and references to Books Online, show the documentation available for datatypes, explain the available data types and show how data can be passed into and out of variables.
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…

972 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