Results 1 to 5 of 5
  1. #1
    Join Date
    Apr 2004
    Location
    Holland
    Posts
    18

    Smile Unanswered: Change the Column_Name – Data Type with a query? Possible?

    Hi everyone,

    I’ve got a small question: Is it possible to change the Column_Name – Data Type from a SQL table with a query?

    I want to do this with a query.

    The Data Type ‘ntext’ must be changed to ‘text’

    Thanks in advance!
    Last edited by Pedr0; 04-06-04 at 04:33.

  2. #2
    Join Date
    Feb 2004
    Location
    Poland
    Posts
    96
    i"m not shure what you want


    BEGIN TRANSACTION
    CREATE TABLE dbo.Tmp_table1
    (
    kolnew text,
    )
    GO
    IF EXISTS(SELECT * FROM dbo.table1)
    EXEC('INSERT INTO dbo.Tmp_table1 (kol)
    SELECT CONVERT(text, kolnew) FROM dbo.table1 TABLOCKX')

    GO
    DROP TABLE dbo.tabla1
    GO
    EXECUTE sp_rename N'dbo.Tmp_table1', N'table1', 'OBJECT'
    commit transaction

  3. #3
    Join Date
    Apr 2004
    Location
    Holland
    Posts
    18
    Here you have a screenshot from what I mean: (Edited out - not usefull anymore!)
    Last edited by Pedr0; 04-06-04 at 06:33.

  4. #4
    Join Date
    Feb 2004
    Location
    Poland
    Posts
    96
    so you have the answer

  5. #5
    Join Date
    Apr 2004
    Location
    Holland
    Posts
    18
    THX! I'm gonna try it....

    I hope it works!!

    I asked this because off topic 'Euro symbol appears like a '?' instead '€'

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •