Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Pass database name as parameter

Status
Not open for further replies.

neemi

Programmer
May 14, 2002
519
GB

is it possible to write a macro/procedure/function to insert data to a particular table with the database name of where the data is coming from as a parameter to the macro.


CREATE MACRO InsertData (pDB as varchar(25))
(
INSERT INTO DestinationTable
SELECT column1, colum2 FROM [pDB].TableForInsert;
)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top