By using listi.net you agree to our cookie policy, We and our partners operate globally and use cookies, for multiple purposes

listi.net

 


Creating SQL statements using Excel

Today I received a list of data from a colleague in an Excel spreadsheet. I needed to take this information and retrieve other information from a database.

On the spreadsheet data is in column A. In column B put the following:

="insert into #tmp value ('"&A1&"')"

Then fill down the data

in your SQL app

Create table #tmp (
f1 varchar(20)
)

copy and paste the SQL statements and run. You now have a temp table that can be used to extract other information from your database.
blog comments powered by Disqus
   
Home | About | Feedback| Privacy | Terms of Service | @alecberg | FAQ | | Copyright © 2022 All Rights Reserved. Edit
This site uses cookies. If you don't want cookies and who doesn't want them as they're yummy, then leave.