ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   MS Query automatically fully qualifying SQL Select Statement (https://www.excelbanter.com/excel-programming/309754-ms-query-automatically-fully-qualifying-sql-select-statement.html)

grubstar

MS Query automatically fully qualifying SQL Select Statement
 
Hi,

MS Query is fully qualifying my SQL Select statement which I am manually
creating using the Get External data function in Excel to get data from SQL
Server

e.g. select * from person changes to select * from dbo.databasename.person
person

Is it possible to stop this happening or is there a different way I can use
the Get External Data function to get data from SQL Server?

I want to distribute the xls file with the queries but the database name may
not be the same on other client machines. Table structure / login is always
the same.

Thanks




No Name

MS Query automatically fully qualifying SQL Select Statement
 
Hi,
if you distribute the file, the file paths might be
different meaning you would have to modify the query for
each user. to do .. on the external data tool bar, click
edit query. when the wizard come up got to page 3. click
veiw query edit query in microsoft query. the the query
comes up in design mode, click viewSQL. you can edit the
query including file path here.
but i might suggest that instead of distributing the file,
put the file on a public access drive.(if possible) This
way all would have access to the file and you would on
have 1 file to update.

-----Original Message-----
Hi,

MS Query is fully qualifying my SQL Select statement

which I am manually
creating using the Get External data function in Excel to

get data from SQL
Server

e.g. select * from person changes to select * from

dbo.databasename.person
person

Is it possible to stop this happening or is there a

different way I can use
the Get External Data function to get data from SQL

Server?

I want to distribute the xls file with the queries but

the database name may
not be the same on other client machines. Table

structure / login is always
the same.

Thanks



.



All times are GMT +1. The time now is 07:15 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com