Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 88
Default how do I import data in excel form SQL server?

Hello All,

I've been trying to import data into excel from our SQL server. I have
the sql script yielding the results. The real problem is when I use the data
connectivity wizard, it only allows you to select one table from the database
in your SQL server. However, my script involves two tables with a join. Any
ideas would be helpful

Thanks,

Mitch
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1,081
Default how do I import data in excel form SQL server?

Asuming you have rights on the Server, convert your 'script' (by which you
probably mean query?) into a view. If you don't have adequate rights, then
use MS Query to connect to SQL Server and use your query text there.

"Mitch" wrote:

Hello All,

I've been trying to import data into excel from our SQL server. I have
the sql script yielding the results. The real problem is when I use the data
connectivity wizard, it only allows you to select one table from the database
in your SQL server. However, my script involves two tables with a join. Any
ideas would be helpful

Thanks,

Mitch

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 88
Default how do I import data in excel form SQL server?

Thanks Duke. Im really new to SQL. I have here a Server Management studio
and an SQL query analyzer. Which one should I use. Both could give me
results to grid. How do I change it into view? After this, what do I do to
connect the results to Excel(import)?

"Duke Carey" wrote:

Asuming you have rights on the Server, convert your 'script' (by which you
probably mean query?) into a view. If you don't have adequate rights, then
use MS Query to connect to SQL Server and use your query text there.

"Mitch" wrote:

Hello All,

I've been trying to import data into excel from our SQL server. I have
the sql script yielding the results. The real problem is when I use the data
connectivity wizard, it only allows you to select one table from the database
in your SQL server. However, my script involves two tables with a join. Any
ideas would be helpful

Thanks,

Mitch

  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1,081
Default how do I import data in excel form SQL server?

Well, you're asking a lot.

You can use SQL Management Studio to convert your query into a view by using

Create View [viewname] as
and then paste in your query

then you execute that query and, if all goes well, you'll have a view. A
view is nothing more than a virtual table.

Alternatively, use your query in Excel. What version of Excel are you
using? In 2007, on the data tab, under From Other Sources you can find MS
Query. In 2003 it's under the Data menu somewhere. Use that to connect to
SQL and follow the prompts. Select one of your tables to get past the early
steps. Toward the end there is an option to edit the thing in MS Query. When
you get there, click on the SQL button and delete what is there, replacing it
with your query. Follow the steps to run the query and return the data to
your worksheet

"Mitch" wrote:

Thanks Duke. Im really new to SQL. I have here a Server Management studio
and an SQL query analyzer. Which one should I use. Both could give me
results to grid. How do I change it into view? After this, what do I do to
connect the results to Excel(import)?

"Duke Carey" wrote:

Asuming you have rights on the Server, convert your 'script' (by which you
probably mean query?) into a view. If you don't have adequate rights, then
use MS Query to connect to SQL Server and use your query text there.

"Mitch" wrote:

Hello All,

I've been trying to import data into excel from our SQL server. I have
the sql script yielding the results. The real problem is when I use the data
connectivity wizard, it only allows you to select one table from the database
in your SQL server. However, my script involves two tables with a join. Any
ideas would be helpful

Thanks,

Mitch

  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1,081
Default how do I import data in excel form SQL server?

Here's a link, too, that might help. Go all the way to the bottom of the
page to read about MS Query

http://www.nickhodge.co.uk/gui/datam...taexamples.htm


"Mitch" wrote:

Thanks Duke. Im really new to SQL. I have here a Server Management studio
and an SQL query analyzer. Which one should I use. Both could give me
results to grid. How do I change it into view? After this, what do I do to
connect the results to Excel(import)?

"Duke Carey" wrote:

Asuming you have rights on the Server, convert your 'script' (by which you
probably mean query?) into a view. If you don't have adequate rights, then
use MS Query to connect to SQL Server and use your query text there.

"Mitch" wrote:

Hello All,

I've been trying to import data into excel from our SQL server. I have
the sql script yielding the results. The real problem is when I use the data
connectivity wizard, it only allows you to select one table from the database
in your SQL server. However, my script involves two tables with a join. Any
ideas would be helpful

Thanks,

Mitch



  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 88
Default how do I import data in excel form SQL server?

Got an error message that read " changed database context to [table name
inside the data base]. What does this mean?

"Duke Carey" wrote:

Well, you're asking a lot.

You can use SQL Management Studio to convert your query into a view by using

Create View [viewname] as
and then paste in your query

then you execute that query and, if all goes well, you'll have a view. A
view is nothing more than a virtual table.

Alternatively, use your query in Excel. What version of Excel are you
using? In 2007, on the data tab, under From Other Sources you can find MS
Query. In 2003 it's under the Data menu somewhere. Use that to connect to
SQL and follow the prompts. Select one of your tables to get past the early
steps. Toward the end there is an option to edit the thing in MS Query. When
you get there, click on the SQL button and delete what is there, replacing it
with your query. Follow the steps to run the query and return the data to
your worksheet

"Mitch" wrote:

Thanks Duke. Im really new to SQL. I have here a Server Management studio
and an SQL query analyzer. Which one should I use. Both could give me
results to grid. How do I change it into view? After this, what do I do to
connect the results to Excel(import)?

"Duke Carey" wrote:

Asuming you have rights on the Server, convert your 'script' (by which you
probably mean query?) into a view. If you don't have adequate rights, then
use MS Query to connect to SQL Server and use your query text there.

"Mitch" wrote:

Hello All,

I've been trying to import data into excel from our SQL server. I have
the sql script yielding the results. The real problem is when I use the data
connectivity wizard, it only allows you to select one table from the database
in your SQL server. However, my script involves two tables with a join. Any
ideas would be helpful

Thanks,

Mitch

  #7   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 88
Default how do I import data in excel form SQL server?

Duke,

am using Excel 2003. In the edit query window, do I erase everything? the
connection text etc, select SQL as command type and then paste my
script/query on teh bottom dialog box? I get an error like the context was
changed, or it indicates that the table I selected from the database is
invalid and such.

"Duke Carey" wrote:

Well, you're asking a lot.

You can use SQL Management Studio to convert your query into a view by using

Create View [viewname] as
and then paste in your query

then you execute that query and, if all goes well, you'll have a view. A
view is nothing more than a virtual table.

Alternatively, use your query in Excel. What version of Excel are you
using? In 2007, on the data tab, under From Other Sources you can find MS
Query. In 2003 it's under the Data menu somewhere. Use that to connect to
SQL and follow the prompts. Select one of your tables to get past the early
steps. Toward the end there is an option to edit the thing in MS Query. When
you get there, click on the SQL button and delete what is there, replacing it
with your query. Follow the steps to run the query and return the data to
your worksheet

"Mitch" wrote:

Thanks Duke. Im really new to SQL. I have here a Server Management studio
and an SQL query analyzer. Which one should I use. Both could give me
results to grid. How do I change it into view? After this, what do I do to
connect the results to Excel(import)?

"Duke Carey" wrote:

Asuming you have rights on the Server, convert your 'script' (by which you
probably mean query?) into a view. If you don't have adequate rights, then
use MS Query to connect to SQL Server and use your query text there.

"Mitch" wrote:

Hello All,

I've been trying to import data into excel from our SQL server. I have
the sql script yielding the results. The real problem is when I use the data
connectivity wizard, it only allows you to select one table from the database
in your SQL server. However, my script involves two tables with a join. Any
ideas would be helpful

Thanks,

Mitch

  #8   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1,081
Default how do I import data in excel form SQL server?

Use the link to Nick Hodge's site. Nearly at the bottom of that page he
shows you how to get t0 MS Query. You don't change any of the connection
info or any of the preliminary screens.

When you get to the screen that allows you to Edit in MS Query, be sure to
choose that option and click Finish. Now you'll be in the actual query
designer and that is where you click on the SQL button on the toolbar. In
the window that pops up you replace all THAT TEXT with your query text from
SQL Server Mgt Studio. Then follow the rest of Nick's instructions

"Mitch" wrote:

Duke,

am using Excel 2003. In the edit query window, do I erase everything? the
connection text etc, select SQL as command type and then paste my
script/query on teh bottom dialog box? I get an error like the context was
changed, or it indicates that the table I selected from the database is
invalid and such.

"Duke Carey" wrote:

Well, you're asking a lot.

You can use SQL Management Studio to convert your query into a view by using

Create View [viewname] as
and then paste in your query

then you execute that query and, if all goes well, you'll have a view. A
view is nothing more than a virtual table.

Alternatively, use your query in Excel. What version of Excel are you
using? In 2007, on the data tab, under From Other Sources you can find MS
Query. In 2003 it's under the Data menu somewhere. Use that to connect to
SQL and follow the prompts. Select one of your tables to get past the early
steps. Toward the end there is an option to edit the thing in MS Query. When
you get there, click on the SQL button and delete what is there, replacing it
with your query. Follow the steps to run the query and return the data to
your worksheet

"Mitch" wrote:

Thanks Duke. Im really new to SQL. I have here a Server Management studio
and an SQL query analyzer. Which one should I use. Both could give me
results to grid. How do I change it into view? After this, what do I do to
connect the results to Excel(import)?

"Duke Carey" wrote:

Asuming you have rights on the Server, convert your 'script' (by which you
probably mean query?) into a view. If you don't have adequate rights, then
use MS Query to connect to SQL Server and use your query text there.

"Mitch" wrote:

Hello All,

I've been trying to import data into excel from our SQL server. I have
the sql script yielding the results. The real problem is when I use the data
connectivity wizard, it only allows you to select one table from the database
in your SQL server. However, my script involves two tables with a join. Any
ideas would be helpful

Thanks,

Mitch

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Import data from Excel to SQL Server 2005 [email protected] Excel Discussion (Misc queries) 0 January 22nd 09 11:29 PM
import data into SQL Server from Excel Rachel[_2_] Excel Discussion (Misc queries) 1 October 27th 08 02:35 AM
Import text from Word Form to Excel CBER Excel Discussion (Misc queries) 1 September 13th 07 04:52 PM
How to import data from SQL Server amit Excel Discussion (Misc queries) 0 January 15th 07 05:35 AM
Excel 2003 Error Cannot Locate the Internet Server or Proxy Server Seabee Excel Discussion (Misc queries) 0 November 20th 05 12:03 AM


All times are GMT +1. The time now is 11:04 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"