spAddField is the proc I use to add all fields to the db in our upgrade scripts. With this proc, you pass it the tablename, fieldname, datatype, and null or not null. This will call spGetFieldsExists and see if the fields exists or not. If it does, spAddField will drop that column. Then it readds it. This allows me to execute a field add script over and over and not ever error because the field exists. It drops the field, assuming that the new version is different.
Side effects of this is that the position of the field will change, if it exists already. But usually its a new field, and its ok to run it over an over, since its adding it at the end anyway.
Another script from DOS but shows alerts
Like the one posted before, the use of the SP is like this: proc_alerts 1,18. This will show the first 18 alerts on the system. OR proc_alerts 20,35 will show from 20 to 35. This lets you manage the list without letting go out of the screen.
2001-11-03
1,041 reads