Stored Procedures that converts a table's column data type from char to nchar and varchar to nvarchar

  • As i said i have to create a MS SQL Server stored procedure that converts a tables column data type from char to nchar or varchar to nvarchar. The stored procedure should take a table name as a parameter.

    alter table [tablename] alter column [column name + data type]

    Sample: ALTER TABLE DWT40001_ORD_HDR ALTER COLUMN ORD_CTGRY_CD nvarchar(50);

    I have a script for this. I just want to know whether this is correct or not

    Can someone explain me what the issue is here?

    Just explain please

  • Please don't double-post. You already posted this question in another forum on this same site.

    - Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
    Property of The Thread

    "Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon

  • No replies to this thread please. Direct replies to: http://www.sqlservercentral.com/Forums/Topic826906-8-1.aspx

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply