?
Solved

Executing SQL PROCEDURE USING Microsoft Access 2010.

Posted on 2013-05-25
6
Medium Priority
?
23 Views
Last Modified: 2016-04-01
Is there you can execute SQL Store Proc sp_rename function from Microsoft Access ?

If so, then can anyone provide a simple snippet of what the syntax would look like.
0
Comment
Question by:ldcray
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
6 Comments
 
LVL 75

Accepted Solution

by:
Anthony Perkins earned 1000 total points
ID: 39197206
What object are you trying to rename?  From MS Access you can use some ADO code to execute the sp_rename system Stored Procedure.
0
 
LVL 14

Expert Comment

by:Bill Ross
ID: 39197646
Hi,

Create a new query...

Do not add any tables.

Select Pass-Through as query type in Design Tools.

Make the query text:

EXEC sp_YourSPName;

Open Properties wide.

Set ODBC Connect String to:

ODBC;Driver={SQL Server Native Client 10.0};Server=YourSQLServer;DATABASE=YourDatabasName;Trusted_Connection=True"

Save as SPPassThru and run the query as needed.

Note:  You can build a connection string using the ODBC wizard and/or you can modify the string per:

http://msdn.microsoft.com/en-us/library/ms130822.aspx

Regards,

Bill
0
 

Author Comment

by:ldcray
ID: 39197766
I'm trying to rename table objects on a SQL 2008 R2 database.
0
 
LVL 14

Assisted Solution

by:Bill Ross
Bill Ross earned 1000 total points
ID: 39197806
Hi,

Change the EXEC line above:

From:
EXEC sp_YourSPName;

To:
EXEC sp_rename 'YourExistingTableName', 'YourNewTableName';

Regards,

Bill
0

Featured Post

Migrating Your Company's PCs

To keep pace with competitors, businesses must keep employees productive, and that means providing them with the latest technology. This document provides the tips and tricks you need to help you migrate an outdated PC fleet to new desktops, laptops, and tablets.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The Windows Phone Theme Colours is a tight, powerful, and well balanced palette. This tiny Access application makes it a snap to select and pick a value. And it doubles as an intro to implementing WithEvents, one of Access' hidden gems.
Recently we ran in to an issue while running some SQL jobs where we were trying to process the cubes.  We got an error saying failure stating 'NT SERVICE\SQLSERVERAGENT does not have access to Analysis Services. So this is a way to automate that wit…
In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.
Viewers will learn how the fundamental information of how to create a table.
Suggested Courses

765 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question