Solved

GUI/DDL/SSIS application

Posted on 2010-09-03
3
476 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

Free learning courses: Active Directory Deep Dive

Get a firm grasp on your IT environment when you learn Active Directory best practices with Veeam! Watch all, or choose any amount, of this three-part webinar series to improve your skills. From the basics to virtualization and backup, we got you covered.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
SQL Script to Remove Data from Two Joined Tables 1 19
SQL Quer 4 21
SQL Group By Question 4 18
Where is the Help Section? 8 21
JSON is being used more and more, besides XML, and you surely wanted to parse the data out into SQL instead of doing it in some Javascript. The below function in SQL Server can do the job for you, returning a quick table with the parsed data.
Ever wondered why sometimes your SQL Server is slow or unresponsive with connections spiking up but by the time you go in, all is well? The following article will show you how to install and configure a SQL job that will send you email alerts includ…
Via a live example, show how to extract insert data into a SQL Server database table using the Import/Export option and Bulk Insert.
Viewers will learn how to use the INSERT statement to insert data into their tables. It will also introduce the NULL statement, to show them what happens when no value is giving for any given column.

809 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