>hi
>
>my question is:
>
>If I have a store procedure where I have someting like "select * from [Server].[database].[dbo].table".
>how can I do to give like parameters, the server and database to store procedure.
You must use dynamic SQL if you pass Server and Database as parameters:
CREATE PROCEDURE MyTest
(
@ServerName varchar(500),
@DataBaseName varchar(500)
)
AS
BEGIN
DECLARE @MySql varchar(8000)
SET @MySql = 'SELECT * FROM '+@ServerName+'.'+@DataBaseName+'.dbo.Table'
EXEC (@MySql)
END
Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
The only thing normal about database guys is their tables.