SQL*XL: Excel SQL Server Query

SQL*XL
home

Quering SQL Server databases from Excel is easy. In most cases you can simply type select * from my_table;

If you suspect that the table may be large (larger than a few thousand records) you may wish to restrict the query. You can use the following syntax to just retrieve 10 rows (an arbitrary 10):

select top 10 * from my_table;

To retrieve the top 10% of a table you can use the following syntax

select top 10 percent * from my_table;

Table Names and column names:
To find out which tables you can query please use the Database Objects section of the SQL editor.

Alternatively use the following queries to retrieve database information:

To quickly dump a list of tables/views or their content in the spreadsheet right click the tables/views or schema item in the Database Objects section of the SQL editor.


See also: