We help IT Professionals succeed at work.

SQL Querry

Medium Priority
637 Views
Last Modified: 2012-08-21
How can I insert a single value into a single column by specifying the where clause?
Comment
Watch Question

Commented:
pauledwardian:

Is there only 1 column in the table?  Does the row already exist?

AielloJ
SQL Server Data Dude
CERTIFIED EXPERT
Most Valuable Expert 2013
Author of the Year 2015
Commented:
-- If you're creating new rows...
INSERT INTO TableA (column1)
SELECT VALUES('banana')


-- If you're changing values in existing rows
UPDATE TableA
SET column1 = 'banana'
WHERE SomeOtherColumn = SomeValue

Author

Commented:
by the way, do you guys know how can I replace comma in access with -in a particualr column? Like an access querry?
Jim HornSQL Server Data Dude
CERTIFIED EXPERT
Most Valuable Expert 2013
Author of the Year 2015

Commented:
In Access VBA, if we're talking a string value, then use replace:

Dim str As String
str = "123,456"

MsgBox Replace(str, ",", "-")

Open in new window


If something else, let us know.
Jim HornSQL Server Data Dude
CERTIFIED EXPERT
Most Valuable Expert 2013
Author of the Year 2015

Commented:
Still need some more details from you (AielloJ's comment), whether you are creating new records (INSERT) or changing existing records (UPDATE).
awking00Information Technology Specialist
CERTIFIED EXPERT

Commented:
Perhaps you can provide us with what you have and what you want to help clarify what it is you're trying to accomplish.
CERTIFIED EXPERT
Top Expert 2012

Commented:
Topics: MS SQL Server, Databases Miscellaneous, SQL Server 2008
Since you are using an MS Access database you should request that the MS SQL Server and SQL Server 2008 topics be replaced with the more appropriate MS Access topic.

Author

Commented:
Thanks!

Explore More ContentExplore courses, solutions, and other research materials related to this topic.