File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes General Computing and the fly likes Transact-SQL CREATE TABLE Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Engineering » General Computing
Bookmark "Transact-SQL CREATE TABLE" Watch "Transact-SQL CREATE TABLE" New topic
Author

Transact-SQL CREATE TABLE

Jimmy Clark
Ranch Hand

Joined: Apr 16, 2008
Posts: 2187
With a stored procedure, I want to create a table when a user registers with the application. I want to use an argument passed in the stored procedure call as part of the table name.

Example:

createUserTable '1987';

So, the CREATE statement would look like:

CREATE TABLE [dbo].[@arg_expense_record]

...

This should create a new table named: 1987_expense_record

I haven't figure out if this is possible. I keep creating a table with the @arg string in the table name instead of the value. I'm not sure if this can be done with the CREATE TABLE command in Transact-SQL.

Any help is greatly appreciated.

Thanks.
 
jQuery in Action, 2nd edition
 
subject: Transact-SQL CREATE TABLE
 
Similar Threads
getting ResultSet from Java Stored Procedure
Searching for a Design Pattern
JDBC Callable Statement JConnect2 Returning null resultset
Create procedure for inserting record into table : Table name dynamically as an Param
Create stored procedure in hssql