If I have a SQL 2000 database with a table that is using 2 Ntext fields with a lot of data in them, can I convert them to VarChar(8000) fields safely? Will there be data loss? Would it best be done through Enterprise Manager?
I am converting an Access Database system to SQL Server. I am experiencing the following with an ntext field. It was converted to this from memo using the upsizing wizard.
If I change from adOpenForwardOnly to adOpenStatic it works fine and both writes show the contents of the ntext field. Can anyone give me some insight into this?
I have a field "Description", varchar2(100). When I try to show it on the HTML/ ASP page from a recordset, it appears as "word+word+word", nevertheless I have no "+" in the field.
I m updating a table which contains a field with datatype=ntext. I use a stored procedure to insert/update data in it. SP's parameter's data type is ntext. Following is the code in which i created the parameter.
Code: SET objParam1 = objComm.CreateParameter("@xmltempSrc",adLongVarChar,adParamInput,1073741823,txtXmlConte nt) objComm.Parameters.Append objParam1
when i execute it, it give error as : Microsoft OLE DB Provider for ODBC Drivers error '80040e07' [Microsoft][ODBC SQL Server Driver][SQL Server]Error converting data type text to ntext.
Because I needed to store more than 4,000 characters, I decided to convert one field in SQL Server Database from nvarchar to ntext...now the field holds many more characters without a problem as I examined in my online manager.
But when I tried to display it on my asp page with Code:
<%=rs("Text")%>
, nothing showed up, and there is no error message. It cannot be null because i checked in the manager...
I'm using SQL Server and I decided to convert one of the fields from nvarchar to ntext. The transition in the manager was all right, but my ASP pages wouldn't display the ntext and there is no error message. I use Code:
I keep optimizing my fields down to the minimum character length necessary i.e., varchar(15), then I find out a month later its gotta get bigger, then a few months later, bigger again, etc. Nowadays on sql server 2005 and on, how bad is it really to use varchar(max)? Is there really a big performance or storage hit or is it negligible?
My data input page uses a id generator which includes dashes, and the corresponding column in the db is set up as varchar to handle that. There is a problem, however, when the value in the varchar column is compared to the string from the URL, and the following error message occurs:
"Syntax error converting the varchar value '071-213' to a column of data type int."
<%strSQL = "SELECT * FROM AMS where MinutesID = " & Request ("id")%>
Would it be possible to CAST the request string to varchar?
ive got a form which takes in someone's age. request.form("Age")
and then using a stored procedure i want to stick that age into a table in my DB (SQL server) The data type of the table where age goes is type int. So when i run my script to grab the age from the form it tells me :
I was wondering if any one could help, I've been looking on the net and can't seem to find any. how do you convert varchar to int, I'm trying to do an sql statement and it chucks up errors.
I have a problem with submitting data from one form to db in sql server. Data type of that field in DB table is money (the other is for varbinary data type) and in asp I have an textfield <input type='text'....>. After submitting I get the next error message:
"Implicit conversion from data type varchar to money (or varbinary) is not allowed. Use the CONVERT function to run this query."
I need to compare two values. one from a text field 'bid' and the other from a field in an sql server database 'maxbid'.
The problem is the column in the database has decimal as its data type and i'm getting a type mismatch. does anyone know how to convert 'bid' into decimal from varchar? the field datatype doesnt necessarily have to be decimal although i need two decimal places so it cant be an int.
The problem I am having is that I am trying to insert data from a form into a DB, but I cannot figure out how to change the form value (varchar) to the db value (money).
I am updating information in an SQL database through a form and I need to convert my varchar string into the money datatype in my database. Can anyone help me with the syntax? Here is the code....
I need to use varchar(max) for my out parameter (@resultText) from the 4000 length it is currently using. When i change the length to -1 or drop it altogether i get an error, how can i fix this issue? Code:
I am repeatedly getting the error message 'error converting datatype varchar to bit'. I am passing a varchar variable to a stored procedure (where it is also a varchar) and then trying to write it to a table (where it is also a varchar).
I'm using ASP, VBScript, ADO for SQL server 2000. I have a stored procedure that I'm trying to use to insert a row using parameters. One of the field is date. Here is the parameter for that. Code:
Set param = cmd.CreateParameter("theDate", adDBTimeStamp, adParamInput, Date()) cmd.Parameters.Append param
But I'm getting this error. Error converting data type varchar to datetime.
When I execute this code, I receive this error on line 314: [Microsoft][ODBC SQL Server Driver][SQL Server]Error converting data type varchar to int. Line 314 is the classComm.Execute line. All the datatypes in my stored procedure those specified in the parameter declararations, and they all match with the datatypes in the DB. Other than the strings that are integer (strClassID) or date (strOccurDate), everything is a varchar.
I have no idea why this error is occurring. I have a similar stored procedure that adds the records in the same way and it kicks out the same error at the same time.
there is an old asp application that is moved from one machine to the other.On the one machine its working fine, but on the new one, when trying to insert from the asp page(variables from the asp page), i get this error, Error converting data type varchar to datetime.
I have tried almost everything, from checking the order of variables, but still get the error. When the proc is executed on SQL it runs fine, am i maybe missing something?
I have migrated ASP pages and SQL SERVER database from a development server to the Live SERVER the regional settings are fine both set to use UK date dd/mm/yyyy. But I have that stupid error when I try to run a stored procedure EXEC sp_add_user 1,'28/08/2004 10:00:00'.... on the live server and not on the development one. I dont want to redevelop all my stored procedures.
I have read that there can be a periodic problem when reading large varchar or text fields from SQL server (or memo fields from Access)--they can sometimes come up as empty strings.
What I have been unable to find out is whether this problem is still around in recent versions of MDAC (>= 2.8). Does anyone know whether this problem still occurs--is it still necessary to follow the steps in that aspfaq article?
I have a 3 page set that searches a database for users, displays the user information in a form and updates the data in the database. The first 2 pages work fine, the third page doesn't. What is annoying is that these pages are a copy of another set of pages that edit news articles (basically the same thing) and they work perfectly.
This is ASP with SQL and VB Script.
Quote: Error Type: Microsoft OLE DB Provider for ODBC Drivers (0x80040E07) [Microsoft][ODBC SQL Server Driver][SQL Server]Syntax error converting the varchar value '6, 6' to a column of data type int. /d1intranet/useredited.asp, line 72
So this message is saying that it is unable to UPDATE the field 'UserName' (which has data type INT) with the variable in the SQL code which is default as VARCHAR. Here is line 72: Code:
I am using a Relational database for my site and i have the following tables:
FIXTURES, GAMEDATES
the fields in FIXTURES are:
GameDate Home Away
(All of the above are numerical fields)
the fields in GAMEDATES are:
DateID(integer) GameDate(#Date Field#)
What i have done is in the GAMEDATE field in the FIXTURES table i have used the ID number of the date that i wish to assign to that record - using a LEFT JOIN to display the actual date that is pulled from the GAMEDATES table (That which corresponds to the relevant id used in Fixtures)
The problem is that in some of my code i want to display records using sql and sometimes in the where clause i use the following:
WHERE Fixtures.GameDate<=(Date())
obviously meaning WHERE GAMEDATE is LESS THAN or EQUAL to TODAY.
The thing is when i use the join it does not use the where clause and displays all of the records in the FIXTURES table.
Does any one know how to get around this, i have not received any error messages it just isnt displaying the right data
Im comparing values in a field while doing a loop if sAct<>myData(5,i) then At the end of the loop I make the value of sAct equal the current myData
This will work when comparing other fields withing my recordset (so I know the statement works) but it will not work for the field I want to compare. The only difference with this field is that it has null values. Could this be the problem? if so, how do I deal with nulls?
I have a input form with 5 fields. One of the fields is MajorNo and the other is named Description.
I have a reference table in my MS Access database (tblMajor)that lists the major numbers and their descriptions.
I would like to have the description field in my ASP automatically filled based on the major number entered on the form, so the user will only need to input the major number when submitting to the Access table (tblSalesTotal).
I am trying to pass a hidden field value on a form into another field on the form so that it can then be inserted in the database, to enable me then to reference that number at a later date.
(The hidden value (1 for example) would then automatically get passed to the other input field.)
The code for the text field that allows users to type an number into it for submission to the db is below, but what code do i need within the hidden field to populate this text field below so that users do not have to type the number in? Code:
I have being working with making an edit field over the past few days. The edit function is now working fine. The edit fields that i have are for id, subject, notes, timedate.
All of the edit screens are one line text screens. What I want to do now is increase the size of the notes box to a larger textarea type box to make it easier to edit notes. The notes field in the db is a textarea field. Code: