Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
ALTER TABLE won't drop DEFAULT with objref
Message
 
 
To
22/07/2007 16:13:27
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
01242635
Message ID:
01242638
Views:
24
Shouldn't it be?
cmdstr=[alter table ]+lctable+[ alter column ]+lcfld+[ DROP DEFAULT ]
>I inherited a DBC full of tables that have default values set at the table level. Generally this is something I don't do since I use views exclusively to insert records, but normally within my framework the values being there is no problem.
>
>But some of the DEFAULT values are object references like
>
>This.oapplication.osecurity.cuserid
>
>Make sense in the context of a VFE app but not a good thing for my conversion program as I massage and upsize the data for SQL Server.
>
>Okay, so I want to get rid of the default values for all fields in all the tables.
>
>In a prg I cycle through the tables and fields, and for each field I do
>
>cmdstr=[alter table ]+lctable+[ alter column ]+lcfld+[ DEFAULT ]
>&cmdstr
>
>If the table contains any default values with This. I get an error the first time I try to run this ( even if that field isn't the one that has the objref default value ) saying I can only use "This" inside a method. Of course I am not trying to use it, just drop it. Seems alter table should be smart enough to know that ...
>
>Am I using the ALTER TABLE syntax wrong to clean out a default value?
>
>I could a class, I guess, and run this stuff as a method etc so obj ref would make sense but seems like there should be a way to do this without that.
>
>Thoughts?
>
>TIA
--sb--
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform