# In SQL Server, it's possible to insert into a table using a SELECT statement

**URL:** <https://community.auth0.com/t/in-sql-server-its-possible-to-insert-into-a-table-using-a-select-statement/8229>\
**Category:** Get Help\
**Tags:** sql\
**Created:** [September 18, 2017, 7:26pm UTC](https://community.auth0.com/t/in-sql-server-its-possible-to-insert-into-a-table-using-a-select-statement/8229 "2017-09-18T19:26:15Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![iamsaanvig](https://upload.wikimedia.org/wikipedia/commons/thumb/7/7c/User_font_awesome.svg/768px-User_font_awesome.svg.png) [@iamsaanvig](https://community.auth0.com/u/iamsaanvig)\
**Post date:** [September 18, 2017, 7:26pm UTC](https://community.auth0.com/t/in-sql-server-its-possible-to-insert-into-a-table-using-a-select-statement/8229/1 "2017-09-18T19:26:15Z")

</div>

INSERT INTO Table (col1, col2, col3)  
SELECT col1, col2, col3  
FROM other\_table  
WHERE sql = ‘cool’  
Is it also possible to update via a SELECT? I have a temporary table containing the values, and would like to update another table using those values. Perhaps something like this:

UPDATE Table SET col1, col2  
SELECT col1, col2  
FROM other\_table  
WHERE sql = ‘cool’  
WHERE Table.id = other\_table.id

Thank you  
[Saanvi Sharma](https://mindmajix.com/ssis-training)

---

<div class="post-metadata">

**Author:** ![jmangelo](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/jmangelo/32/7923_2.png) [@jmangelo](https://community.auth0.com/u/jmangelo)\
**Post date:** [September 27, 2017, 2:54pm UTC](https://community.auth0.com/t/in-sql-server-its-possible-to-insert-into-a-table-using-a-select-statement/8229/2 "2017-09-27T14:54:36Z")

</div>

This community is aimed at providing answers to questions related to the Auth0 service and/or authentication/authorization in general.

The question you have is very out of scope and better answered in a more general technical community forum like StackOverflow where there’s also a great probability of it already being answered.

* * *

LMGTFY: [sql - Insert into ... values ( SELECT ... FROM ... ) - Stack Overflow](https://stackoverflow.com/questions/25969/insert-into-values-select-from)

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/auth0/original/3X/b/5/b560f266932fcce5d57f09a6595bd50518cae3f3.jpeg) [@system](https://community.auth0.com/u/system)\
**Post date:** [March 2, 2018, 5:56am UTC](https://community.auth0.com/t/in-sql-server-its-possible-to-insert-into-a-table-using-a-select-statement/8229/3 "2018-03-02T05:56:33Z")

</div>


