SQL Querry

How can I insert a single value into a single column by specifying the where clause?
pauledwardianAsked:
Who is Participating?
 
Jim HornConnect With a Mentor Microsoft SQL Server Developer, Architect, and AuthorCommented:
-- 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
0
 
AielloJCommented:
pauledwardian:

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

AielloJ
0
 
pauledwardianAuthor Commented:
by the way, do you guys know how can I replace comma in access with -in a particualr column? Like an access querry?
0
Improve Your Query Performance Tuning

In this FREE six-day email course, you'll learn from Janis Griffin, Database Performance Evangelist. She'll teach 12 steps that you can use to optimize your queries as much as possible and see measurable results in your work. Get started today!

 
Jim HornMicrosoft SQL Server Developer, Architect, and AuthorCommented:
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.
0
 
Jim HornMicrosoft SQL Server Developer, Architect, and AuthorCommented:
Still need some more details from you (AielloJ's comment), whether you are creating new records (INSERT) or changing existing records (UPDATE).
0
 
awking00Commented:
Perhaps you can provide us with what you have and what you want to help clarify what it is you're trying to accomplish.
0
 
Anthony PerkinsCommented:
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.
0
 
pauledwardianAuthor Commented:
0
 
pauledwardianAuthor Commented:
Thanks!
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.