Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 495
  • Last Modified:

GUI/DDL/SSIS application

If we were to change the datatype of a field of a table, please advise which of the following to use:

1) SSMS GUI
2) DDL T-SQL code
3) SSIS

Thanks.
0
ksfok
Asked:
ksfok
2 Solutions
 
Dale BurrellCommented:
Dunno what all those acronyms are :) firstly is changing the datatype going to affect the data and/or the application using the data?

Assuming all is OK to change the datatype then you can either open the table definition for design in Management Studio or run the T-SQL from Query Analyser e.g.

alter table MyTable alter column MyColumn NewDataType -- and you can set null/not null etc as well here

If there is a default associated with the column you will probably have to drop that first.
0
 
AmmarRCommented:
dale_burrell: has covered every thing

so you can use SSMS GUI or DDL T-SQL code both will work.

and you dont need SSIS to change a field datatype.

in many cases if there is data in the table already,  SSMS GUI, will not work and wont allow you to change the datatype, so you will be left with T-sql only.

but you need to make sure from what datatype to what datatype are you changing, because if you do a wrong conversion you might lose your data.

Regards
0
 
ksfokAuthor Commented:
OK
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now