SQL Query to combine to text fields

I want to run a query that will append the Item.SubDescription1 field to the Item.Description.

Something like this: UPDATE Item SET Description = Description + ", " + SubDescription1

Is this possible? What would be the proper syntax?

Thank you, Tom

Reply to
Terrible Tom
Loading thread data ...

Tom,

UPDATE i SET Description = SUBSTRING(i.Description + ', ' + i.SubDescription1, 0, 31) FROM Item i

- Evan Culver New West Technologies

Terrible Tom wrote:

Reply to
Evan Culver

Thank you, Mr. Culver.

I presume that "i" represents a specific item in the example you provided. If I use "Item" where you have "i" will this query update all items?

I'm hoping to apply this to every item in my database

Thanks aga> Tom,

Reply to
Terrible Tom

Tom,

In the query it says "From Item i," which means that wherever there's an "i" it means item. So the "i.*" means "Item.*" Just a shortcut, that's all.

Hope this helps,

Matt

Reply to
Matt

Tom,

That query will update every item in your database -- 'i' is just used as an alias for the 'Item' table.

- Evan Culver New West Technologies

Terrible Tom wrote:

Reply to
Evan Culver

It worked! Thanks for the help.

Tom

"Evan Culver" wrote:

Reply to
Terrible Tom

BeanSmart website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.