Showing posts with label learning. Show all posts
Showing posts with label learning. Show all posts

Thursday, March 22, 2012

ASP page to connect to SQL Server - please help

I don't know if this is the right forum or not, but it seemed like it might be the most appropriate, sorry if it is not:

I am learning about websites and I have a database that was created in access and then converted to sql server and is going to be hosted on a windows server running sql server 2000. I want to make a basic query so if I wanted to search for say buildings, I could retrieve everything in the buildings column, or if I wanted to do a seach for empire state building, I would get all hits displayed.

What type of connection string would I need to use? Do I have to configure the database itself at all?

Any help would be greatly appreciated, I am a complete novice with this type of stuff.There's a lot of information on tutorials section on these forums. Please check it out.sql

Wednesday, March 7, 2012

as a beginner

How do i learn SQL server 2000...I'm new to development, and need to get my basics right before i proceed further.

Do give me your feedback / learning tips.

start with this link

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/startsql/getstart_4fht.asp

Friday, February 24, 2012

Array of Value

I'm learning T-SQL, and I want to know what are the various ways to represent an array of values. For example, I might like to have an array of record IDs, which I feed to an "IN" clause. My guess is that such an "array" would be implemented by using a RecordSet. If yes, thats good - but what are the other ways (if any)? If no, then what other kinds of variables or parameters allow me to do something like that?You can use subquery for that like in:

WHERE SomeColumn IN (SELECT SomeColumn From SomeTable)

HTH, Jens K. Suessmeyer.

http://www.sqlserver2005.de|||

Search the forums for "split function". You can then pass values into a stored procedure with a varchar like "2,34,67,98" and have that string split into a set that can be used in an IN clause. These split functions basically break the string up and puts the CSVs into a temporary table and then (similar to the above suggestion) selects the values from the table.

|||But what about doing a select that has results stored in a (single-column) RecordSet? I've not tried it, but can't that RecordSet be passed around as a parameter, and then fed "as is" into an "IN" clause? Is that not a common/popular thing to do? If not, why not?|||

>>Is that not a common/popular thing to do?<<

Funny way to put this. Common? Yes. Popular? Yes. Natively supported in SQL Server? Nope.

The "classic" paper on the subject is here: http://www.sommarskog.se/arrays-in-sql.html

You can do it with a table variable, but sadly, you cannot pass this around as a parameter.