I'm trying to run the DDL command below that creates the table I need, but even not returning error the table is not created, would anyone have any idea where I'm going wrong?
public const string scriptCriacao = " if exists(select * from sys.objects as o where o.type =N'u' and o.name = N'Tuss_temp')"+
" drop table Tuss_temp "+
" Create Table Tuss_temp ( "+
" competencia nvarchar(30), "+
" codigoTerminologia float, "+
" nomeTerminologia nvarchar(256), "+
" codigoTermo nvarchar(30), "+
" termo nvarchar(256), "+
" dtInicioVigencia datetime, "+
" dtFimVigencia datetime, "+
" dtFimImplementacao datetime, "+
" tipoAcao nvarchar(256), " +
")";
String connectionString = "Data Source=1.1.1.1;Initial Catalog=PortalTISS_v3;Persist Security Info=True;User ID=sa;Password=teste";
SqlConnection SqlConn = new SqlConnection(connectionString);
SqlConn.Open();
SqlCommand cmd = new SqlCommand(scriptCriacao, SqlConn);
cmd.CommandType = CommandType.Text;
cmd.ExecuteNonQuery();