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:
01501261
Views:
33
>>>>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.
>
>It should still work fine assuming you didn't have integer values more than 6 digits (and you most likely didn't). I still don't see a problem.

Thank you for clarifying. I thought that even if you have value of 1 in the integer field and use STR(MyField,6) the result will be "******".
"The creative process is nothing but a series of crises." Isaac Bashevis Singer
"My experience is that as soon as people are old enough to know better, they don't know anything at all." Oscar Wilde
"If a nation values anything more than freedom, it will lose its freedom; and the irony of it is that if it is comfort or money that it values more, it will lose that too." W.Somerset Maugham
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform