SQLUSA

Microsoft SQL Server 2000 Best Practices

 

How to avoid using SELECT * FROM?

 

It is undesirable to include select * from in your code or stored procedure because if a column is added or deleted, you can expect a sure bug.

With sp_help TableX you can easily get a column list. Just cut and paste it, add commas and you have the select with the explicit column list.

You can also do this from the Object Browser in Query Analyzer.

 

Best in the World in SQL Server Training
 
SQLUSA.com Home Page