Solved

GUI/DDL/SSIS application

Posted on 2010-09-03
3
469 Views
Last Modified: 2012-05-10
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
Comment
Question by:ksfok
3 Comments
 
LVL 21

Accepted Solution

by:
Dale Burrell earned 250 total points
ID: 33601529
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
 
LVL 15

Assisted Solution

by:AmmarR
AmmarR earned 250 total points
ID: 33616795
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
 

Author Closing Comment

by:ksfok
ID: 33746100
OK
0

Featured Post

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
back end of ssas cube views or tables? 2 27
SLQ View not updating 10 47
MS SQL Backup 24 70
combine an MS SQL string in Idera DM 9 31
In this article—a derivative of my DaytaBase.org blog post (http://daytabase.org/2011/06/18/what-week-is-it/)—I will explore a few different perspectives on which week today's date falls within using Microsoft SQL Server. First, to frame this stu…
Having an SQL database can be a big investment for a small company. Hardware, setup and of course, the price of software all add up to a big bill that some companies may not be able to absorb.  Luckily, there is a free version SQL Express, but does …
Via a live example, show how to setup several different housekeeping processes for a SQL Server.
Viewers will learn how to use the SELECT statement in SQL to return specific rows and columns, with various degrees of sorting and limits in place.

758 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now