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
E-mail: http://cerbermail.com/?QugbLEWINF


"Merlin" <evalua@xxxxxxxxxxxxxxxx> wrote in message
news:B68C7754-785E-48FC-AA53-9B52137EF36B@xxxxxxxxxxxxxxxx
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
window.
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?
Thanks

"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
E-mail: http://cerbermail.com/?QugbLEWINF


"Merlin" <evalua@xxxxxxxxxxxxxxxx> wrote in message
news:9FB38536-5ADB-4C97-8DA3-38F43E033293@xxxxxxxxxxxxxxxx
If I have a TSQL script to create a table (for example), is there some
way
I
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
to
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 ...
    (microsoft.public.access.queries)
  • 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: ...
    (microsoft.public.access.queries)
  • 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 ...
    (microsoft.public.access.formscoding)
  • 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. ...
    (comp.databases.ms-access)
  • 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. ...
    (microsoft.public.access.queries)