I want to write a Stored procedure...which will create a ta开发者_JS百科ble with xyz name ...but when i call the SP for very second time it will give the error bcoz table already exist...I want to take table name as input..and want table to be created with that name... How to archive this..... Asp.net ---Mysql
delimiter //
CREATE PROCEDURE CreateTable (IN name VARCHAR(100))
BEGIN
SET @q = CONCAT('CREATE TABLE ', name ,' (...)');
PREPARE s FROM @q;
EXECUTE s;
DEALLOCATE PREPARE s;
END//
精彩评论