Author |
Topic  |
|
Dan Martin
Average Member
  
USA
528 Posts |
Posted - 13 June 2001 : 14:25:52
|
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
|
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 |
 |
|
Dan Martin
Average Member
  
USA
528 Posts |
Posted - 13 June 2001 : 14:50:30
|
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! 
|
 |
|
redbrad0
Advanced Member
    
USA
3725 Posts |
Posted - 13 June 2001 : 14:54:18
|
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 |
 |
|
tilttek
Junior Member
 
Canada
333 Posts |
Posted - 13 June 2001 : 15:04:20
|
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 |
 |
|
redbrad0
Advanced Member
    
USA
3725 Posts |
Posted - 13 June 2001 : 15:18:45
|
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 |
 |
|
Deleted
deleted
    
4116 Posts |
Posted - 13 June 2001 : 17:07:16
|
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 |
 |
|
tilttek
Junior Member
 
Canada
333 Posts |
Posted - 14 June 2001 : 09:52:02
|
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 |
 |
|
MorningZ
Junior Member
 
USA
169 Posts |
Posted - 14 June 2001 : 13:50:14
|
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
 |
 |
|
HuwR
Forum Admin
    
United Kingdom
20600 Posts |
Posted - 14 June 2001 : 13:54:27
|
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
|
 |
|
|
Topic  |
|