probleum in changing the data type of column

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • veer
    New Member
    • Jul 2007
    • 198

    probleum in changing the data type of column

    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
  • vksingh24
    New Member
    • Dec 2007
    • 21

    #2
    Originally posted by veer
    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

    Code:
    ALTER TABLE <TABLE_NAME> 
    ALTER COLUMN <COLUMN_NAME> NUMERIC

    Comment

    • veer
      New Member
      • Jul 2007
      • 198

      #3
      hello expert
      it is not working
      it is producing the syntax error near keyword alter


      Originally posted by vksingh24
      You can chage it this way

      Code:
      ALTER TABLE <TABLE_NAME> 
      ALTER COLUMN <COLUMN_NAME> NUMERIC

      Comment

      • debasisdas
        Recognized Expert Expert
        • Dec 2006
        • 8119

        #4
        Here is the complete syntax.

        ALTER TABLE <table>
        { [ ALTER COLUMN <column_name>
        { <new_data_typ e> [ ( <precision> [ , <scale> ] ) ]

        Comment

        • veer
          New Member
          • Jul 2007
          • 198

          #5
          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




          Originally posted by debasisdas
          Here is the complete syntax.

          ALTER TABLE <table>
          { [ ALTER COLUMN <column_name>
          { <new_data_typ e> [ ( <precision> [ , <scale> ] ) ]

          Comment

          • debasisdas
            Recognized Expert Expert
            • Dec 2006
            • 8119

            #6
            Try This

            alter Table Output Alter Column Entry Numeric (5,2)

            Comment

            Working...