How Do I Translate My Access Programs to SQL?

xljunkie

Board Regular
Joined
May 20, 2011
Messages
92
So I'm a long time user of Access, and I know some SQL. I have Access programs that run many different queries, manipulate the data, and I might end up with a singular table that is the result of many different tables' results and data transformations.

When I go to SQL, there is space for me to write a SELECT FROM WHERE statement which would give me one table of results. If I wanted to perform two different SELECT statements in the same process in a logical flow of a program, how do I do that? If I hit F5 in SSMS in a query that contains two SELECT statements, I'll get an error.

I'm trying to connect how I normally write a program in Access to how I can achieve the same in SQL. Do I need to look into stored procedures? Or is there something else I need to research?
 

Excel Facts

How to total the visible cells?
From the first blank cell below a filtered data set, press Alt+=. Instead of SUM, you will get SUBTOTAL(9,)
How are you writing the separate queries?

Each one needs to be terminated with a semi-colon.
 
Upvote 0
You don’t get an error running multiple selects in smss, I do it all the time - nor do you need to terminate with semi colons, though it’s good practice.

I fear that you may misunderstand the difference between Access and SQL server. One isn’t usually a direct replacement for the other, access offers a programming environment, macros, forms etc and is a user facing tool. SQL server is not, it’s only part of the equation and you need something else as well to generally write a program or provide something to end users.
 
Upvote 0
So I'm a long time user of Access, and I know some SQL. I have Access programs that run many different queries, manipulate the data, and I might end up with a singular table that is the result of many different tables' results and data transformations.

Generally you can do this easily in SQL server in a proc or even in a single script that runs like a query. As stated - you certainly can run two or more sql queries in one script, create and use temp tables as well, so a lot is possible.
 
Upvote 0
your question is confusing to me

MS Access allows you to write queries using a language called SQL
you can write queries normally in Access using Design View, but then you can do sql view and see the actual sql

SQL Server is a Microsoft product that is "kid of similar" to Access but MUCH more advanced
SQL Server also uses the language called SQL

SSMS is SQL Server Management Studio, also a Microsoft product

SQL Server is the product that stores the tables and data and queries (these queries are known as stored procedures)
SMSS is the product that connects to SQL Server and allows you to create tables and queries using SQL or a point and click user interface

Access can also connect to SQL Server and you can use SQL to create tables and queries
Access is not SSMS

so, where does your data live ?
in Access or in SQL Server ?
are you trying to write SQL in Access or in SSMS ?
 
Upvote 0

Forum statistics

Threads
1,214,551
Messages
6,120,156
Members
448,948
Latest member
spamiki

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top