We help IT Professionals succeed at work.

We've partnered with Certified Experts, Carl Webster and Richard Faulkner, to bring you two Citrix podcasts. Learn about 2020 trends and get answers to your biggest Citrix questions!Listen Now

x

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

scarface7
scarface7 asked
on
Medium Priority
236 Views
Last Modified: 2008-02-01
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.



 
Comment
Watch Question

Top Expert 2004
Commented:
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

Not the solution you were looking for? Getting a personalized solution is easy.

Ask the Experts
Access more of Experts Exchange with a free account
Thanks for using Experts Exchange.

Create a free account to continue.

Limited access with a free account allows you to:

  • View three pieces of content (articles, solutions, posts, and videos)
  • Ask the experts questions (counted toward content limit)
  • Customize your dashboard and profile

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.