Yes, there is if you have Access as well.
You can declare your Excel spreadsheet a data source in Access and then query using SQL.
To do that, create a new DB and select Insert --> Table --> Link Table. Change "File of type" to show all files and select your Excel spreadsheet. Follow the wizard and you'll have a link to the sheet and can query it as if it were a table in access.
However I doubt you really need that. Excel's functions should be a match for most queries.
Can you give a sample of what you try to query (or why you want the SQL queries?
An expert who has achieved level 2 by getting 100 points
An expert that got 5 achievements.
An expert whose answer got voted for 20 times.
An expert who has answered 20 questions.
Re: Running SQL queries on Excel
If you just want to do criteria-based queries, you can get a reasonable approximation to a "SELECT ... WHERE ..." kind of query by using the VLOOKUP function in Excel. Then you don't need to use a database, although you may need to specially format your excel data - just read the help file about VLOOKUP.
- If you need clarification, ask it in the comment box above.
- Better answers use proper spelling and grammar.
- Provide details, support with references or personal experience.
Tell us some more! Your answer needs to include more details to help people.You can't post answers that contain an email address.Please enter a valid email address.The email address entered is already associated to an account.Login to postPlease use English characters only.
Tip: The max point reward for answering a question is 15.
'declare the SQL statement that will query the database SQL = "SELECT * FROM TABLE_NAME"
'create an instance of the ADO connection and recordset objects Set Connection = Server.CreateObject("ADODB.Connection") Set Recordset = Server.CreateObject("ADODB.Recordset") 'Open the connection to the database Connection.Open ConnString
'Open the recordset object executing the SQL statement and return records Recordset.Open SQL,Connection
'first of all determine whether there are any records If Recordset.EOF Then Response.Write("No records returned.") Else 'if there are records then loop through the fields Do While NOT Recordset.Eof Response.write Recordset("FIRST_FIELD_NAME") Response.write Recordset("SECOND_FIELD_NAME") Response.write Recordset("THIRD_FIELD_NAME") Response.write "<br>" Recordset.MoveNext Loop End If
'close the connection and recordset objects to free up resources Recordset.Close Set Recordset=nothing Connection.Close Set Connection=nothing
severals solution : - save file as text separated by comma and use sqloader from oracle - use function in excel to concatenate insert order : "insert into TABLE_NAME (field1,...,fieldn) values (A1,B1,...,??n);". Save file as text with sql extension. Connect against roacle db and execute file previously saved. - use ODBC from MicroSoft
Two ways to access your server. First, make sure the SQL Server Service is running. Start | Run | Services.msc | Enter. Look for Microsoft SQL Server Service and that it's running. Or Look for the SQL Service Broker icon by the clock and see that it's running. The default instance of SQL Server uses the Hostname. Start | Run | Cmd | Enter. The type hostname. This will be the name to access to server. Then type IPCONFIG, this is then the IP address that you could also use to access it.
SQL Server runs on port 1433, so any firewall has to have it open.
Open Query Analyzer, type in the hostname or ip of the local box, type in "sa" and the password for sa (if setup in mixed mode) or Windows Authentication.
Once you login in, you should now see the databases in the Tree on the left side under the Server | Databases node.
Your description though states "SQL Server won't work on my laptop". TO answer this, the only two SQL Editions that work on anything other than "SERVER" software is SQL Professional and SQL Developer. All others have to be on a "SERVER" platform.
Are you familiar with "Linking" tables in Access?
In Access: File --> Get External Data --> Link Tables.
This will bring up a dialog box which allows you to browse to your SQL server and select the table you want.