if you do Textmerge you need to realize that the string is parsed literally. Therefore the correct usage of inline Textmerge would be:
ALTER TABLE <<tcTableName>> ALTER COLUMN <<tcFieldName>> varchar(max) <<iif(tlNull, 'NOT NULL', 'NULL')>>
>UPDATE. Found solution. Simply store the value into a variable.
>
>cNullValue = 'NOT NULL'
>ALTER TABLE <<tcTableName>> ALTER COLUMN <<tcFieldName>> varchar(max) <<cNullValue>>
>
>Works.
>
>Hi,
>
>I created a procedure in my VFP 9 program that changes the column of the SQL Server DB from Text to Varchar(max) (Thanks to Borislav Borissov!). It works.
>I am trying to make this procedure more generic so that it receives a parameter indicating if the column should allow NULL or not.
>Instead of writing two scripts, I would like to incorporate the passed parameter into the VFP code. Here is the snippet of the code:
>
>lparameter tlNull
>ALTER TABLE <<tcTableName>> ALTER COLUMN <<tcFieldName>> varchar(max) NOT NULL
>
>The code above is for NOT NULL only. How do I change the NOT NULL to use the Parameter tlNull?
>
>This is what I tried:
>
>ALTER TABLE <<tcTableName>> ALTER COLUMN <<tcFieldName>> varchar(max) <<iif(tlNull, NOT NULL, NULL)>>
>
>
>But the above produces NULL with two periods, one before and one after. Why?
>
>TIA
Christian Isberner
Software Consultant