When I just run this command from query windows it works fine.[code="sql"]restore database test from DISK='\\share\dumps\test.bak ' with replace[/code]Now I am trying,[code="sql"]DECLARE @sqlcmd nvarchar(1000) DECLARE @Result intSET @sqlcmd = 'restore database test from DISK='\\share\dumps\test.bak ' with replace'PRINT @sqlcmdEXEC @Result = xp_cmdshell @sqlcmd ;[/code]And getting error as 'restore' is not recognized as an internal or external command,I tried various options with quotes around restore database but no luck. I need help with syntax and quotes. Thanks.
↧