• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 202
  • Last Modified:

Altering Collumn Values and data type properties (SQL Server 2005)

I have undertaken a Data Warehousing project. I am using the SQL Server Business Intelligence 2005 and Visual Studio 2005 to achieve my goals.

As of now, I have managed to extract data from a few flat files and loaded them in a relational table by mapping collumns from the flat files to the output table.

I have the following questions:

1) How do you update a certain collumn with new values by replacing the old ones simply by referencing the specific row numbers that I can visually see. For example I would like to replace all values from the collumn "name" and row number 1-23 with "Barry". Can this be done using a simple SQL "Update" statement.

2) Can I alter the properties of a collumn. For example, I would like change the data type of collumn from VARCHAR(50) to integer, decimal or float.

3) Can I use regular expressions in SQL statements to change the structure of data within certain collumns. This is a transformation process.

If you are getting a drift of what I am trying to accomplish from the above description, please feel free to suggest better and more efficient ways to accomplish the same task. However, I would like to accomplish everything within the SQL Server Business Intelligence tool 2005 and Visual Studio 2005 environment.

Thanks.



 
0
scarface7
Asked:
scarface7
1 Solution
 
SjoerdVerweijCommented:
1) Have a look at Row_Number(). Note that this is a Bad Idea.

2) Alter Table ... Alter Column ... Int / Dec / Float

3) http://www.microsoft.com/downloads/details.aspx?familyid=C16F11AD-150A-4091-B3A2-83D21D3E0973&displaylang=en
0

Featured Post

Free Backup Tool for VMware and Hyper-V

Restore full virtual machine or individual guest files from 19 common file systems directly from the backup file. Schedule VM backups with PowerShell scripts. Set desired time, lean back and let the script to notify you via email upon completion.  

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