Sqlcmd not recognised


#1

Hi,

I need to restore database in sql server2008 r2 after installation,it installs successfully and transfer a backup db to a target machine but it shows this error

“sql command not recognised as internal or external command,operable program or batch file”

Also i restart a service using resource :

my code is here:

cookbook_file node[‘sqlstd’][‘dbpath’] do
puts "enters"
source node[‘sqlstd’][‘dbsrc’]
action :create
end

service node[‘sqlstd’][‘targetservice’] do

  action :restart

end

batch “sql restore db” do
code <<-EOH

      cd "#{node['sqlstd']['setdbpath']}"
      sqlcmd -E -S "#{node['sqlstd']['dbserver']}" -Q "#{node['sqlstd']['dbrestore']}"
   
 EOH

end

Thanks,
Indra