469,913 Members | 1,947 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,913 developers. It's quick & easy.

Exporting SQL column to excel

Hello. For my first post, I will admit I'm a SQL Newb. I don't know alot, but I am learning as fast as possible. My access to SQL databases in previous positions has been limited, but not here.

I have a list of database users which I'd like to change the passwords for across the board. The SQL writers have requested an Excel file with two columns (username and password to be), but I don't know how to export the single column in either a notepad document or into excel. Any help would be appreciated.

Jul 27 '07 #1
2 1283
There are literally dozens of ways to do this. For a one time deal I'll usually just copy past the columns out of Enterprise Manager or Query Analyzer. It will paste right into Excel no problem.

If you want to get a little more fancy with it you can use an Excel query. Excel is capable of connecting directly to SQL Server and pulling down data. Check out this little article that explains the basics.
Aug 2 '07 #2
112 100+
Use query analyzer

Type the following code:

Select dbo.tablename.field1, dbo.tablename.field2 from tablename

tablename as ur tablename which contain the information u required. Field1 is ur fild name.

Example: If the database has user table and it has field like employeeid, employeename, employeepassword, employeemail.

you can select ur records by the following code

Select employeename, employeepassword from user

Run this code and copy ur result to excel sheet.

or you can use Queryanalyzer--->Query Menu---->Result to fle (Then run the code and save the file.
Aug 3 '07 #3

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

3 posts views Thread by | last post: by
6 posts views Thread by Kevin Humphreys | last post: by
6 posts views Thread by Opa | last post: by
4 posts views Thread by Tom | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.