Re: Running T_SQL scripts form Access

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance

Maybe you can try to edit a Query in design Mode, switch to the SQL view and
then use the Run command. You can also put your stuff in a Stored Procedure
and run it.

However, the best way to design your database would be to no use Access.
Enterprise Manager 2000 or its successor SSMS 2005 are much more powerful
client tools (altough some people seems to not be atonished by the speed of
SSMS). You can also find many other tools on the web.

Sylvain Lafontaine, ing.
MVP - Technologies Virtual-PC

"Merlin" <evalua@xxxxxxxxxxxxxxxx> wrote in message
Thanks, that worked.
Is there a nicer way though?
Scripts can be quite big and I had to put it all on one line in the debug
It also wouldn't accept 'GO', so if there is more than one step you would
have to do each one separately.
Is there no window you can just run scripts from?

"Sylvain Lafontaine" wrote:

Try with CurrentProject.Connection.Execute

Probably that you can run it from the Immediate Window (also known as the
debug window) but I never tried.

In VBA code, it will be either with the above call or using ADO objects.

Sylvain Lafontaine, ing.
MVP - Technologies Virtual-PC

"Merlin" <evalua@xxxxxxxxxxxxxxxx> wrote in message
If I have a TSQL script to create a table (for example), is there some
can can I run it against a SQL Server database from Access?
I assumed I could just paste it into a Query window, but I can't get it
work that way.


Relevant Pages

  • Re: Calculated Mean
    ... you have been posting my SQL ... Let's start with a brand new query. ... window. ... >>> did the exactly as I did yesterday and I got the exact error messages ...
  • Re: Calculated Mean
    ... As I have asked a number of times, you need to copy what you have in the SQL ... window and paste it back here in a message. ... On the Query screen, I clicked New, then> Design View, then SQL. ... I tried it again this>>> morning and got the following error messages: ...
  • Re: One or Multiple Criteria Search Form
    ... The query window is much better for debugging SQL statements because you get ... Then, when the code stops at the breakpoint, examine strWhere in the ...
  • Re: add hint in access query
    ... With the query design grid that opens, a pop up window entitled "Show Table" appears. ... Close the pop up without choosing anything and on the Query menu select SQL SPecific -> Pass-Through. ... Wei, not sure how clear I was on this, but the SQL written in any pass-through query would be the Oracle dialect you are used to working with. ...
  • Re: Calculated Mean
    ... I tried to create a new query. ... Design View, then SQL. ... > window. ... >> Check the subquery's syntax and enclose the subquery in parentheses. ...