If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > Microsoft SQL Server > Strange View!!!

Reply
 
LinkBack Thread Tools Display Modes
  #16 (permalink)  
Old 05-24-04, 12:37
Brett Kaiser Brett Kaiser is offline
SQLTeam Scrub
 
Join Date: Nov 2002
Location: Jersey
Posts: 9,976
Ahem.....

NEVER USE SELECT *

Sorry for yelling....
__________________
Brett
8-)

It's a Great Day for America everybody!
My Blog
My SQL Blog dbforums Yak CorralRadio 'Rita
dbForums Member List SQLTeam Member List
It's 5:00 Somewhere Pearls
The physical order of data in a database has no meaning.
Reply With Quote
  #17 (permalink)  
Old 05-24-04, 12:39
GDMI. GDMI. is offline
Registered User
 
Join Date: Apr 2004
Location: LA, CA
Posts: 125
NO MIRACLES !!!!!!!!!!!!!!

(see point number 8 in Brett's list)

Last edited by GDMI.; 06-14-04 at 19:17.
Reply With Quote
  #18 (permalink)  
Old 05-24-04, 12:43
MCrowley MCrowley is online now
Wage drone 24601
 
Join Date: Jan 2003
Location: Massachusetts
Posts: 4,782
Here is a little test of why I don't let any of the developers here play with select * in views. It may be that something related may be happening to you. Is the front end application calling for values by place, or by name? If they are calling by place, then I think we have your answer.
Code:
set nocount on
go
create table test1 (col1 int)
go
insert into test1 (col1) values (1)
go
create view vwtest1 as
select * from test1
go
print "First run of the view"
select *
from vwtest1
go
alter table test1 add col2 varchar(10)
go
insert into test1 values (2, 'hello')
go
print "First the table"
select *
from test1
print "Then the view"
select *
from vwtest1

go
drop view vwtest1
drop table test1
Reply With Quote
  #19 (permalink)  
Old 05-24-04, 12:44
GDMI. GDMI. is offline
Registered User
 
Join Date: Apr 2004
Location: LA, CA
Posts: 125
NO MIRACLES !!!!!!!!!!!!!!

(see point number 8 in Brett's list)

Last edited by GDMI.; 06-14-04 at 19:17.
Reply With Quote
  #20 (permalink)  
Old 05-24-04, 12:46
Brett Kaiser Brett Kaiser is offline
SQLTeam Scrub
 
Join Date: Nov 2002
Location: Jersey
Posts: 9,976
Quote:
Originally Posted by MCrowley
Maybe you should replace the "*" with the field list? If you can prove it out, then Brett can add this to his list of reasons to not use "select *".

GOOD POINT!

Added

http://weblogs.sqlteam.com/brettk/ar...4/22/1272.aspx
__________________
Brett
8-)

It's a Great Day for America everybody!
My Blog
My SQL Blog dbforums Yak CorralRadio 'Rita
dbForums Member List SQLTeam Member List
It's 5:00 Somewhere Pearls
The physical order of data in a database has no meaning.
Reply With Quote
  #21 (permalink)  
Old 05-24-04, 12:55
GDMI. GDMI. is offline
Registered User
 
Join Date: Apr 2004
Location: LA, CA
Posts: 125
NO MIRACLES !!!!!!!!!!!!!!

(see point number 8 in Brett's list)

Last edited by GDMI.; 06-14-04 at 19:17.
Reply With Quote
  #22 (permalink)  
Old 05-24-04, 13:24
blindman blindman is offline
World Class Flame Warrior
 
Join Date: Jun 2003
Location: Ohio
Posts: 11,556
Using "Select *" is perfectly acceptable, once one understands that it is shorthand for "Select 'I am too freakin lazy to code clearly or I had all my fingers chopped off in a lawnmower accident and I type with my big toe.'"
__________________
If it's not practically useful, then it's practically useless.

blindman
www.chess.com: "sqlblindman"
Reply With Quote
  #23 (permalink)  
Old 05-24-04, 13:25
Brett Kaiser Brett Kaiser is offline
SQLTeam Scrub
 
Join Date: Nov 2002
Location: Jersey
Posts: 9,976
Look,

I've obviously succeeded in p-ssing you off...

Not my intent...

And when I say miracle...it's because I deal with developers all day, who never belive it's their code...hence the miracle....

You mention that you "see" the bit value and it should be varchar and you don't know why

Where do you "see" it?

You then mention that a column was added that you didn't know about...(miracle solved?)

Now, ALL of this, is just my opinion...you don't have to take it

Sorry if you took ANY of this personal...it's just business

MOO
__________________
Brett
8-)

It's a Great Day for America everybody!
My Blog
My SQL Blog dbforums Yak CorralRadio 'Rita
dbForums Member List SQLTeam Member List
It's 5:00 Somewhere Pearls
The physical order of data in a database has no meaning.
Reply With Quote
  #24 (permalink)  
Old 05-24-04, 13:27
Brett Kaiser Brett Kaiser is offline
SQLTeam Scrub
 
Join Date: Nov 2002
Location: Jersey
Posts: 9,976
Quote:
Originally Posted by blindman
Using "Select *" is perfectly acceptable, once one understands that it is shorthand for "Select 'I am too freakin lazy to code clearly or I had all my fingers chopped off in a lawnmower accident and I type with my big toe.'"

Well, so much for not being personal....

Yo blind dude...any bridges left in your life?
__________________
Brett
8-)

It's a Great Day for America everybody!
My Blog
My SQL Blog dbforums Yak CorralRadio 'Rita
dbForums Member List SQLTeam Member List
It's 5:00 Somewhere Pearls
The physical order of data in a database has no meaning.
Reply With Quote
  #25 (permalink)  
Old 05-24-04, 13:34
GDMI. GDMI. is offline
Registered User
 
Join Date: Apr 2004
Location: LA, CA
Posts: 125
GOD DAMN IT!!! NO MIRACLES !!!!!!!!!!!!!!

(see point number 8 in Brett's list)

Last edited by GDMI.; 06-14-04 at 19:18.
Reply With Quote
  #26 (permalink)  
Old 11-08-07, 14:53
Brett Kaiser Brett Kaiser is offline
SQLTeam Scrub
 
Join Date: Nov 2002
Location: Jersey
Posts: 9,976
__________________
Brett
8-)

It's a Great Day for America everybody!
My Blog
My SQL Blog dbforums Yak CorralRadio 'Rita
dbForums Member List SQLTeam Member List
It's 5:00 Somewhere Pearls
The physical order of data in a database has no meaning.
Reply With Quote
  #27 (permalink)  
Old 11-08-07, 23:19
hmscott hmscott is offline
Registered User
 
Join Date: Dec 2002
Posts: 1,245
Quote:
Originally Posted by Brett Kaiser
Wow...stumbling into this thread is like taking a stroll through Rod Sterling's backyard.

I kept looking around to see if I had missed something.

hmscott
__________________
Have you hugged your backup today?
Reply With Quote
  #28 (permalink)  
Old 11-09-07, 00:40
a-dam a-dam is offline
Registered User
 
Join Date: Dec 2006
Location: Momence, IL USA
Posts: 56
Nothing useful to add, but...

I think his name was Rod Serling.
__________________
Don't Bogart That Squishee!
Reply With Quote
  #29 (permalink)  
Old 11-09-07, 05:51
ivon ivon is offline
Registered User
 
Join Date: Nov 2002
Posts: 272
Interesting thread, this one.

I have a meeting later today about the progress (or lack thereof) of a certain project.
I think I'll just shout 'NO MIRACLES!!!' all the time.
Reply With Quote
  #30 (permalink)  
Old 11-09-07, 06:50
pootle flump pootle flump is offline
King of Understatement
 
Join Date: Feb 2004
Location: One Flump in One Place
Posts: 14,905
This was mentioned in the ANSI forum recently. Apparently it is ANSI standard behaviour rather than simply some SQL Server quirk.
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On