Hello,
to create a table for an mssql server, using ADO.net, I can make it with or without exec:
or with 'exec',Code:string sqlstament = "CREATE TABLE [dbo]. newTable" + " ([RID][int] NOT NULL PRIMARY KEY CLUSTERED, [Contact][nvarchar](3) NULL," + "[Company][nvarchar](40) NULL) ON [PRIMARY]"; mySQlCommand.Commandtext = sqlstament; mySQlCommand.ExecuteNonQuery;
both works fine.Code:string sqlstament = "EXEC ('CREATE TABLE [dbo]. newTable" + " ([RID][int] NOT NULL PRIMARY KEY CLUSTERED, [Contact][nvarchar](3) NULL," + "[Company][nvarchar](40) NULL) ON [PRIMARY]')"; mySQlCommand.Commandtext = sqlstament; mySQlCommand.ExecuteNonQuery();
But I have no idea what I win if I use exec?




Reply With Quote
