473,327 Members | 2,118 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,327 software developers and data experts.

change the datatype of a field

137 100+
hi,
can i change the datatype of any field from numeric to varchar, or any other type..
i have a field 'id' which is numeric type,
but now i have to change it to varchar(20),
is it possible to do.
thanx in advance.
May 23 '08 #1
1 3075
rski
700 Expert 512MB
Try this
Expand|Select|Wrap|Line Numbers
  1. alter table q alter column i type varchar(20);
  2.  
it works if there are no numbers in i column which has more than 20 digits.
May 23 '08 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Steve | last post by:
Hi; I have a table with a TEXT datatype. Its a comment field. Right now the users who put in singlequotes are killing the web front end. The programmer responsible is fixing this issue but...
4
by: J.C. Flores | last post by:
Hello all, First of all, I must state that I'm new to SQL Server, but have been a long-time software guy for quite some time. Please excuse the potential simplicity of the solution to my...
14
by: Elias Farah | last post by:
Hi All, What are people's experience in timing Query Performance? I have tried in vain, but get many unpredictable results, with execution proceeding in the background and problems of timing...
1
by: Meelis Lilbok | last post by:
Hi Still cant resolve problem, how to get datatype and properties for field. If if fill DataSet from SQL Database how can i a) Get DataType for specified field b) Get Allow null (if i read...
7
by: dotnetnoob | last post by:
i keep getting Object references not set to an instance of an object from this code: Private Sub EqBinding() Dim x As Integer x = 0 Do If CStr(arlsType.Item(x)) = "Bacnet Point" Then Dim...
4
by: Orchid | last post by:
How can I change a Date datatype to a Number datatype? For example, I want a date 10/31/2006 to show 1031 as Number datatype. But I don't want it becomes 39021. What formula should I use? ...
2
by: remya1000 | last post by:
i'm using VB.NET. and its a windows application. in my program i need to display a table in datagrid. so i created the table using DataTable and i'm calling that dataTable to dataGrid. and its...
15
by: =?Utf-8?B?UGhpbCBKb2huc29u?= | last post by:
Hi, This is being called in a C# loop within an ado.net transaction from C# 1.1 code. It is used to write large file data to a SQL Server database in chunks, rather than in one go. I had the...
7
JustJim
by: JustJim | last post by:
Hi If all you can do with ALTER TABLE....ALTER COLUMN is change the datatype/size then how do I change the name of a field? I have several database files spread all over the state and some of...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.