I'm getting some unusual behaviour with the system stored procedure
sp_columns in SQL Anywhere 5.5.05. It returns the columns descriptions
for a table but it is not returning them in the col id order as I expect
it to. (It does in MS SQL 6.5). Has anyone else noticed this or is it
just me? Or better still does anyone have a workaround which will allow
me to return the columns in colid order as my customers are beginning to
moan again ... :-(
Thanks
Mark
Jason Hinsperger
Product Quality
Adaptive Server Anywhere
Mark
In Sybase Central, Use Tools | Connection Profiles and create a profile
for your database server.
Open the little icon that represents your db server, and locate your
database. Right mouse click on the cylinder for your db and choose
Filter Objects. Place checkmarks in the users/groups called dbo and SYS.
Press OK.
Expand the listing under the cylinder, and open the folder called
Procedures & Functions. In there you will find all of your procs, dbo
procs and system procs. Including sp_columns. Double-click on sp_columns
and your ORDER BY statement. Save the change. Return to ISQL and see if
it does what you want it to do.
HTH,
Kathleen
Thanks for that it works fine, it seems a bit strange that the results from
sp_columns are not ordered. I looked at MS SQL servers sp_columns and that does
have the order by in it. My next problem now though is how do I reflect this
change in all of my customers databases? Most of them do not have the knowledge
or the inclination to do what you suggested, is there any way I can do this
programmatically through SQL so that I can just send them a script to run?
Regards
Mark
Thanks to all
Mark
If it were me, I would copy the contents of sp_columns into a new
procedure and modify that. That way, you'll always know you're working
with our homegrown version, and won't have problems if you upgrade the
database, possibly reinstating the original version of the proc.
Kathleen