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)
 Dynamically creating the table

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2005-12-20 : 08:00:33
Arif writes "Hello,
My requirement is to dynamically create a table in stored procedure. The table name should have at the end an ID (unique identifier coming from other table)
Example

create table TB_CON_'123-1231-34-3423231212' (name varchar .....blaw blaw....)

Now i want the table name to be

TB_CON_123-1231-34-3423231212"

mr_mist
Grunnio

1870 Posts

Posted - 2005-12-20 : 08:11:14
This smacks of poor database design. Anyway you would need to use dynamic SQL to do it. Do a search on here, it's been done.

-------
Moo. :)
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2005-12-20 : 08:42:23
Why do you want to do?

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page

Frank Kalis
Constraint Violating Yak Guru

413 Posts

Posted - 2005-12-20 : 09:58:30
http://www.sommarskog.se/dynamic_sql.html


--
Frank Kalis
Microsoft SQL Server MVP
http://www.insidesql.de
Heute schon gebloggt? http://www.insidesql.de/blogs
Go to Top of Page
   

- Advertisement -