varchar limit | SQL Server Performance Forums

SQL Server Performance Forum – Threads Archive

varchar limit

Hi there,
I have a table with a varchar colum in the length of 1024. Inside it, I have a text in the size of 500 characters. My problem is that when I fetch the data in my "C" code, the text gets cut out to 256 characters. I defined my "C" variable as char [4000].
I use SQL server 2000. Please help
Check out set textsize. (I think that’s what you are looking for)
Do you know how to set it up in a ‘C’ code ? Thanks
post your c code on this matter,
i dod not recall ever seeing code that limits the text size to 256
do you know how to run profiler?
do so with the default template, filter for the hostname of your app,
when it opens a connections, look for an entry like: SQL:BatchCompletedSET TEXTSIZE 64512 the relevent c code should look something like: SQLCHAR SalesPerson[11];
SQLINTEGER SalesPersonLenOrInd, CustIDInd; SQLBindCol(hstmt, 1, SQL_C_CHAR, SalesPerson, sizeof(SalesPerson), &SalesPersonLenOrInd);

There is my code, what SQL sentence should I include ? I don’t know what ‘profile’ is.<br />Thanks, Eli<br /><br />EXEC SQL BEGIN DECLARE SECTION;<br />charpcHolesPos[4000] = "";<br />EXEC SQL END DECLARE SECTION;<br />EXEC SQL SET OPTION LOGINTIME 10;<br />EXEC SQL SET OPTION QUERYTIME 100;<br />EXEC SQL SET CURSORTYPE CUR_BROWSE;<br />EXEC SQL DECLARESEL_M_TEMP_CUR CURSOR FOR <br />SELECTholes_pos<br />FROMM_TEMP<br />ORDER by template_id;<br />EXEC SQL OPEN SEL_M_TEMP_CUR;<br />for(i = 0 ; SQLCODE == 0 ; i++)<br />{<br />EXEC SQL FETCH SEL_M_TEMP_CUR INTO<img src=’/community/emoticons/emotion-4.gif’ alt=’:p‘ />cHolesPos;<br /><br />if(SQLCODE == 0)<br />{<br />strcpy(psMTLocalArrayPtr<i>.cHolesPos,pcHolesPos);<br />}<br />else if(SQLCODE != 100)<br />{<br />// Error …<br />}<br /> }<br />}<br />EXEC SQL CLOSE SEL_M_TEMP_CUR;<br />