Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

could a sql select statement be equal to an array

Posted on 2010-01-06
5
Medium Priority
?
386 Views
Last Modified: 2012-05-08
for example

select * from names where nameid = a[]

where a[] is the array


a[] is 7, 8, 9

how to loop through
0
Comment
Question by:rgb192
5 Comments
 
LVL 60

Accepted Solution

by:
chapmandew earned 500 total points
ID: 26197211
No. You'd have to use XML
0
 
LVL 4

Assisted Solution

by:apexpert
apexpert earned 500 total points
ID: 26197331
no but you can use this as......

select * from names where nameid in (1,2,3,4,5,6,7,8)
0
 
LVL 41

Assisted Solution

by:Sharath
Sharath earned 500 total points
ID: 26197366
How are you passing array values? ultimately you should build a query like this.

select * from names where nameid in (7,8,9)

Let us know how are you passing the array values.
0
 
LVL 10

Assisted Solution

by:Rakesh Jaimini
Rakesh Jaimini earned 500 total points
ID: 26197405
you can check
How to pass a list of values or array to SQL Server stored procedure?
http://vyaskn.tripod.com/passing_arrays_to_stored_procedures.htm
0
 
LVL 1

Author Closing Comment

by:rgb192
ID: 31673870
thanks
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

I am showing a way to read/import the excel data in table using SQL server 2005... Suppose there is an Excel file "Book1" at location "C:\temp" with column "First Name" and "Last Name". Now to import this Excel data into the table, we will use…
Use this article to create a batch file to backup a Microsoft SQL Server database to a Windows folder.  The folder can be on the local hard drive or on a network share.  This batch file will query the SQL server to get the current date & time and wi…
Integration Management Part 2
Whether it be Exchange Server Crash Issues, Dirty Shutdown Errors or Failed to mount error, Stellar Phoenix Mailbox Exchange Recovery has always got your back. With the help of its easy to understand user interface and 3 simple steps recovery proced…

577 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