473,395 Members | 1,885 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Adding attributes in a query

32
Hi,

I have a table that needs extra attributes added to it after a certain amount of processing has been completed.

For example Table A has two fields x and y.

A
x y

And now, I need to add a new attribute z. Is this possible using a query? I need to add this attribute and fill in the same value for every record. I was thinking an Update query would work but I've had no success so far.

Thanks,
Jason
Feb 29 '08 #1
2 2078
JKing
1,206 Expert 1GB
Here's an example of how to add a new column to a table through SQL.

Expand|Select|Wrap|Line Numbers
  1. ALTER TABLE myTable ADD COLUMN myField TEXT (255)
  2.  
This will create a new field called "myField" in table "myTable" that is of the type text and 255 characters in length.

Once this field is created you could run an update query to fill them all in with the same value.

Expand|Select|Wrap|Line Numbers
  1. UPDATE myTable
  2. SET myField = 'Test'
  3.  
Hope this helps.
Jking
Feb 29 '08 #2
jkwok
32
Hey Jking,

This is great actually, I think this will help me out quite a bit!

Thanks,
Jason
Feb 29 '08 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: Tryfon Gavriel | last post by:
Hi all I recently noticed when trying to optimise a major query of a chess website I am the webmaster of, that adding an order by for "gamenumber" which is a clustered index field as in for...
4
by: DotNetJunky | last post by:
I have built a control that runs an on-line help system. Depending on the category you selected via dropdownlist, it goes out and gets the child subcategories, and if there are any, adds a new...
0
by: Paul Rees | last post by:
I am wondering if anyone has encountered a similar problem to the one that I am having. I have an ASP.NET page which has a table and a dropdownlist that was added at design time. The majority of...
1
by: darrel | last post by:
On some of my pages I add a javascript call dynamically to the BODY tag: pageBody.Attributes.add("onload", "dothis();") Since this adds an actual attribute, trying to call this multiple times...
3
by: J'son | last post by:
Guys, I have created a custom class that derives from DataList so that I can add some custom client side functionality into each new item row (<td>). Heres the class in its simplest form: ...
1
by: Dhruba Bandopadhyay | last post by:
I know that JavaScript lets us add: ondragenter, ondragover, ondragleave, ondrop events to normal HTML table td tags. This lets us do highlighting of table cells/rows, and capture drag & drop...
2
by: Ken Fine | last post by:
In code, I'm adding javascript attributes to form elements on an ASP.NET page: body.Attributes.Add("onClick", "highlight(event);"); body.Attributes.Add("onKeyUp", "highlight(event);");...
5
by: Bob B. | last post by:
I've been playing with descriptors lately. I'm having one problem I can't seem to find the answer to. I want to assign a descriptor to a list of attributes. I know I should be able to add these...
0
by: jeoffh | last post by:
Background: I am trying to "merge" some attributes into an existing XML column in my MS SQL 2005 database. The general idea is that I have an XML column in a table and I would like to update/delete...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.