Within an SQL stored procedure, I would like to have the ability to construct a table name and create it.
Example: I just logged into my database under company 03 and a
You would need to use dynamic SQL eg:
DECLARE @company_id char(2) SET @company_id = '02' EXEC('CREATE TABLE CUSTOMER' + @company_id + ' (id int PRIMARY KEY)')
(tested)