Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Changing Num type to Int
Message
 
General information
Forum:
Visual FoxPro
Category:
Other
Environment versions
Visual FoxPro:
VFP 9 SP1
Miscellaneous
Thread ID:
01501221
Message ID:
01501266
Views:
36
>>>Hi,
>>>
>>>I am planning to change a field type in one of the tables from NUM 6,0 to INT. The reason is that when I make this database in SQL Server I would want this field/column to be Identity column. So in SQL Server it would have to be Int type. I currently use this field (in VFP) just like an Identity. I have a routine that sets and gets the latest value in a PK table. So each record in the table has a unique value. And no decimal is used.
>>>
>>>My question is (and I realize that not knowing the application it is difficult for anybody to answer definitively) is there a place in the code that such change would have a negative effect? Any suggestions would be greatly appreciated.
>>
>>IMHO, except for being careful with the changes, I don't see any side effects. It should make your queries to run faster and indexes smaller and tables smaller.
>
>I will probably do it (convert from NUM to INT) at some point. But what Sergey said about STR(myfield,6) could be a problem for me. I have used it a lot. And right now I don't have time to hunt it and change. So, as long as I can start with making NUM to be Identity it will work. And I will improve it later. Thank you.

BTW, re-read what Sergey said:

If you have STR(myfiedl, 6) somewhere in your code, it will return '******' in case when value exceeds 6 digits (INT).
If it's not broken, fix it until it is.


My Blog
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform