473,748 Members | 5,429 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

probleum in changing the data type of column

198 New Member
hello expert
can any one help me by providing the method how can i change the data type of column in sql server
originally my column data type is numeric and i want to change it into integer
i use the covert command but it is not changing the data type of column

please provide some help
thanks in advance
Dec 20 '07 #1
5 2174
vksingh24
21 New Member
hello expert
can any one help me by providing the method how can i change the data type of column in sql server
originally my column data type is numeric and i want to change it into integer
i use the covert command but it is not changing the data type of column

please provide some help
thanks in advance
You can chage it this way

Expand|Select|Wrap|Line Numbers
  1. ALTER TABLE <TABLE_NAME> 
  2. ALTER COLUMN <COLUMN_NAME> NUMERIC
Dec 20 '07 #2
veer
198 New Member
hello expert
it is not working
it is producing the syntax error near keyword alter


You can chage it this way

Expand|Select|Wrap|Line Numbers
  1. ALTER TABLE <TABLE_NAME> 
  2. ALTER COLUMN <COLUMN_NAME> NUMERIC
Dec 21 '07 #3
debasisdas
8,127 Recognized Expert Expert
Here is the complete syntax.

ALTER TABLE <table>
{ [ ALTER COLUMN <column_name>
{ <new_data_typ e> [ ( <precision> [ , <scale> ] ) ]
Dec 21 '07 #4
veer
198 New Member
HELLO EXPERT
PLEASE CONVERT THIS SYNTAX INTO EXAMPLE
MY TABLE NAME IS "OUTPUT"
MY COLUMN NAME IS "ENTRY"
COLUMN DATA TYPE IS NUMERIC


THANKS IN ADVANCE




Here is the complete syntax.

ALTER TABLE <table>
{ [ ALTER COLUMN <column_name>
{ <new_data_typ e> [ ( <precision> [ , <scale> ] ) ]
Dec 22 '07 #5
debasisdas
8,127 Recognized Expert Expert
Try This

alter Table Output Alter Column Entry Numeric (5,2)
Dec 24 '07 #6

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

Similar topics

1
6515
by: iporter | last post by:
Hi - I am changing a field from type nvarchar to type text, given that I need to store strings longer than 255 characters. To do this I change the data type in SQL Server, then I change the parameter code in the calling procedure, as per below: cmd.Parameters.Append(cmd.CreateParameter("@title", adVarWChar, adParamInput, 255, title)); becomes:
1
2239
by: Geoff Jones | last post by:
Hi Is it possible to change the type of data a column holds in DataTable at runtime? For example, suppose that the table column originally holds Strings, can we, at runtime, change it to Integers? I'm also interested in changing the date/time that may be held in a column. That is, if the date and time are held in a column of DataTable, how can we change it so it only has the time?
2
1446
by: EricaLRivera | last post by:
Hi Y'all I was hoping someone out there might be able to help me. I have an access program that needs to change the data types programatically. I have tried to do an alter column to change the original data type from binary to text, but that did not work. The current section of code I have is the following: Public Function ChangeColumnType(ByVal StrgTableName As String, _ strgColumnName As String, StrgNewDataType) As Boolean
2
1333
by: veer | last post by:
hello expert i made a website which opens in ie6 and works fine but when i open it in ie7 it creates probleum the probleum is that i have a footer in my webpage , it automatically moves in the middle of webpage but when i open the same webpage in ie6 it opens fine please provide help
3
1494
by: veer | last post by:
Hi i run this query it works fine Select Yp1VOp,count(*) as instrec into instrec from " & txttablename & " where Yp1EOp=Yp1VOp Group By Yp1EOp,Yp1Vop Order By Yp1EOp,Yp1VOp but when i put a column name Yp1EOp = " " it produce the error the qeury like this Select Yp1VOp,count(*) as instrec into instrec from " & txttablename & " where Yp1EOp=Yp1VOp OR Yp1EOp = " " Group By Yp1EOp,Yp1Vop Order By Yp1EOp,Yp1VOp but i want Yp1EOp...
7
1338
by: veer | last post by:
Hi i have a mdb table in which i want to access the data from mdb table into new table i,e Operator but the condition is if the data in first row of column say "operator_code" is "alfred" . The name alfred is inserted into operator OK and when i move to the next row in the column i,e "operator_code" lets assume it is empty in that case the value of previous row i,e "alfred" must be inserted into the empty row i create a loop but it is not...
4
1472
by: veer | last post by:
hi i have programe in which works fine for seaching the data from a file but when the i want to seach the word like" mögen ". In this word " ö " has some other kind of shap and my programe did not searh it please tell me how i will remove this probleum varinder
2
1280
by: veer | last post by:
Hi i made a programe in which i want to calculate the total time from a column but when i declare a variable having datatype is "date" then the default value in this variable is "12:00:00: and when the calculation is less than 1 hour just like 38 minutes 56 sec it creates the probleum and shows like 12:38:56 i searched on net but im not getting a proper idea can you give me some idea so that this 12 should be replaced in to "00" ...
3
1456
by: veer | last post by:
Hi i have some probleum in reading the data from .val extension file when i manually open the file in notepad and just click on file option -> save -> close the txt file and then read the data from vb.net coding it works fine but when i read the data from the selected file directly from coding it reads only first two characters what is this means i use the following coding sPathName = txtpath.Text & "\" & sFolderArray(icount) &...
0
8826
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9534
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9366
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9241
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6793
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6073
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4597
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
3303
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2777
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.