Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How can varchar(max) cause this issue?
Message
 
General information
Forum:
Visual FoxPro
Category:
Other
Environment versions
Visual FoxPro:
VFP 9 SP1
Miscellaneous
Thread ID:
01479846
Message ID:
01479853
Views:
66
>Hi,
>
>I have come across the following problem, which duplicated in multiple tests.
>
>First a little background for those who have not seen my other thread. In order to update Identity column in the cursor created with a CursorAdapter I use the following method. I have the following code in the BeforeInsert method of the CA:
>
>
> cInsertCmd = cInsertCmd + ;  
>	        "; DECLARE @id int; SELECT @id = SCOPE_IDENTITY()" + ;  
>	        "; EXEC Get_identity_Value @id, ?@" + ;  
>	        this.Alias + "." + ALLTRIM(this.IDENTITY_FIELD) 
>
>
>The above code is suppose to set value of the identity column to the value of scope_identity(). And it work UNLESS one of the columns where entry is made is of type VARCHAR(MAX) NULL. That is, if I leave the editbox control empty and let SQL Server set NULL as the value in the VARCHAR(MAX) column, the above code sets the value to the identity column in the cursor to the identity value from the SQL Server. But if I make any entry into the editbox control, the value in the identity column of the cursor is 0 (zero).
>
>What could be happening here? TIA.

Did you try firing profiler and inspect exact commands sent to SQL Server?
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