Hi,
I was just wondering if anybody could help me out with the correct syntax to run a stored procedure from one server to create a table on a different server. The problem I'm having is that the server, database name and table name are going to vary everytime so I'm passing variables through.
DECLARE @TableName AS varchar(100)
SET @TableName = Map_'+LTRIM(RTRIM(REPLACE(REPLACE(REPLACE(REPLACE(@PortNum, ' ',''),'+',''),',',''),'&','')))
CREATE TABLE @ServerName.@DBName.@TableName
(
ID VARCHAR(10) NULL,
COUNTRY VARCHAR(2) NULL,
CRESTA VARCHAR(5) NULL,
TSIUSD FLOAT NULL,
TSI FLOAT NULL,
MrkTSI FLOAT NULL,
Mshare FLOAT NULL
)
Is this syntax correct?
Thanks in advance