Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Creating a table named from an input parameter

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2001-06-05 : 21:34:37
Andy writes "I have a site where each member has their own column and their own table in the DB, but i need to automatically create a new table with the users name everytime i add a new member ie. I add a member called Member1 and all the relevent information is taken from a web form and added to the Users table with a stored procedure.

CREATE PROCEDURE sp_AddNewUser
(
@UserName nvarchar(25),
@Password nvarchar(14),
@Email nvarchar(100)
)
AS

INSERT INTO Users
(UserName, Password, Email)
VALUES (@UserName, @Password, @Email)

Is it possible for me to create a new table with the name contained in @UserName within this stored procedure or should i have a trigger on the Users table that fires on a insert?"
   

- Advertisement -