Snitz Forums 2000
Snitz Forums 2000
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Community Forums
 Code Support: ASP (Non-Forum Related)
 Select *
 New Topic  Topic Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

Dan Martin
Average Member

USA
528 Posts

Posted - 13 June 2001 :  14:25:52  Show Profile  Visit Dan Martin's Homepage  Send Dan Martin an AOL message  Send Dan Martin an ICQ Message  Send Dan Martin a Yahoo! Message
I am curious, Snitz NEVER uses "Select *". Yet I always do myself. It certainly makes adding things easier.

Is there a good reason Snitz never uses Select *?

-Dan

redbrad0
Advanced Member

USA
3725 Posts

Posted - 13 June 2001 :  14:39:28  Show Profile  Visit redbrad0's Homepage  Send redbrad0 an AOL message
it all depends. if you use * it returns all columns. what id you just want 2 columns and not the other 48? the less data your database has to deal with the better it is with performance. i try to never use * even if i call data from all the columns in the table. the reason for this is what if i add another column into the database later? then the sql statements that use the * will start to send that data to the server to process. so just to say again, its just a performance issue

Brad
Go to Top of Page

Dan Martin
Average Member

USA
528 Posts

Posted - 13 June 2001 :  14:50:30  Show Profile  Visit Dan Martin's Homepage  Send Dan Martin an AOL message  Send Dan Martin an ICQ Message  Send Dan Martin a Yahoo! Message
Good to know. Wish my SQL class had mentioned that. They usually used SELECT * in the class!

Now....I get to go alter about 100 source files!

Go to Top of Page

redbrad0
Advanced Member

USA
3725 Posts

Posted - 13 June 2001 :  14:54:18  Show Profile  Visit redbrad0's Homepage  Send redbrad0 an AOL message
now thats just what i was told, but it also makes alot of since, so im pretty sure im right :O)

quote:

Wish my SQL class had mentioned that. They usually used SELECT * in the class!


i just wish i could take a sql class, im stuck just farting around hoping to learn things

Brad
Go to Top of Page

tilttek
Junior Member

Canada
333 Posts

Posted - 13 June 2001 :  15:04:20  Show Profile  Visit tilttek's Homepage
quote:

now thats just what i was told, but it also makes alot of since, so im pretty sure im right :O)
i just wish i could take a sql class, im stuck just farting around hoping to learn things



It easy to test... And yes it is faster.
In fact, if you want faster site, you might want to use:

ex:
select c_id, c_name for client;

instead of:
ClientID = rs("c_id")
ClientName = rs("c_name")

you can use
ClientID = rs(0)
ClientName = rs(1)

But then, it's very usefull when having 1000 of query at the same time.



Philippe Gamache
http://www.tilttek.com
http://www.lapageamelkor.com
Go to Top of Page

redbrad0
Advanced Member

USA
3725 Posts

Posted - 13 June 2001 :  15:18:45  Show Profile  Visit redbrad0's Homepage  Send redbrad0 an AOL message
yea but is this really that much faster? i wouldnt think this would help as much

quote:

quote:

now thats just what i was told, but it also makes alot of since, so im pretty sure im right :O)
i just wish i could take a sql class, im stuck just farting around hoping to learn things



It easy to test... And yes it is faster.
In fact, if you want faster site, you might want to use:

ex:
select c_id, c_name for client;

instead of:
ClientID = rs("c_id")
ClientName = rs("c_name")

you can use
ClientID = rs(0)
ClientName = rs(1)

But then, it's very usefull when having 1000 of query at the same time.



Philippe Gamache
http://www.tilttek.com
http://www.lapageamelkor.com



Brad
Go to Top of Page

Deleted
deleted

4116 Posts

Posted - 13 June 2001 :  17:07:16  Show Profile
quote:

...
the reason for this is what if i add another column into the database later? then the sql statements that use the * will start to send that data to the server to process.
...



And if we are talking about Snitz, this is usually the case if you have MODs installed. This time it is also not possible to use rs(n) syntax, because you will not know which one is installed first. Same applies for successive releases of the main forum database.

Think Pink
Go to Top of Page

tilttek
Junior Member

Canada
333 Posts

Posted - 14 June 2001 :  09:52:02  Show Profile  Visit tilttek's Homepage
quote:

And if we are talking about Snitz, this is usually the case if you have MODs installed. This time it is also not possible to use rs(n) syntax, because you will not know which one is installed first. Same applies for successive releases of the main forum database.



Yes your right. And it's only usefull when doing 1000's call at a time...


Philippe Gamache
http://www.tilttek.com
http://www.lapageamelkor.com
Go to Top of Page

MorningZ
Junior Member

USA
169 Posts

Posted - 14 June 2001 :  13:50:14  Show Profile  Visit MorningZ's Homepage  Send MorningZ an AOL message
the other thing is, there is a "bug" of sorts with SQL where sometimes when you pull back an nText field, if you don't specifically "declare" the field, it may come back blank

the "problem" is outlined here: http://www.aspfaqs.com/aspfaqs/ShowFAQ.asp?FAQID=80



Go to Top of Page

HuwR
Forum Admin

United Kingdom
20600 Posts

Posted - 14 June 2001 :  13:54:27  Show Profile  Visit HuwR's Homepage
quote:

the other thing is, there is a "bug" of sorts with SQL where sometimes when you pull back an nText field, if you don't specifically "declare" the field, it may come back blank

the "problem" is outlined here: http://www.aspfaqs.com/aspfaqs/ShowFAQ.asp?FAQID=80




This is absolutely correct, as I have mentioned many times. It is however a bug with ADO and not with SQL

Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Topic Locked
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.38 seconds. Powered By: Snitz Forums 2000 Version 3.4.07