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.
Author |
Topic |
ashishmishra81
Starting Member
5 Posts |
Posted - 2008-04-22 : 08:43:26
|
hello friends,i want to create a store procedure that automatically create a table ,i want that it before creating a table it check whether a that table is exist or notplease help me as soon as posiblesonu |
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2008-04-22 : 08:52:47
|
SELECT * FROM INFORMATION_SCHEMA.TABLES E 12°55'05.25"N 56°04'39.16" |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2008-04-22 : 09:08:51
|
quote: Originally posted by ashishmishra81 hello friends,i want to create a store procedure that automatically create a table ,i want that it before creating a table it check whether a that table is exist or notplease help me as soon as posiblesonu
Why do you want to create tables automatically?MadhivananFailing to plan is Planning to fail |
|
|
ashishmishra81
Starting Member
5 Posts |
Posted - 2008-04-22 : 09:33:52
|
quote: Originally posted by madhivanan
quote: Originally posted by ashishmishra81 hello friends,actually i want to make a chat utility where each user want to do chat.if they wish to chat then at that moment a message table(table name is user's id in master table)is created dynamicallyi want to create a store procedure that automatically create a table ,i want that it before creating a table it check whether a that table is exist or notplease help me as soon as posiblesonu
Why do you want to create tables automatically?MadhivananFailing to plan is Planning to fail
sonu |
|
|
tosscrosby
Aged Yak Warrior
676 Posts |
Posted - 2008-04-22 : 16:23:32
|
Again, why do you want to create tables automatically??Terry |
|
|
X002548
Not Just a Number
15586 Posts |
|
chandan_joshi80
Starting Member
30 Posts |
Posted - 2008-04-24 : 07:42:07
|
alter PROCEDURE general_select1 ( @col1 varchar(20) ) ASDECLARE @sql nvarchar(4000)SELECT @sql = 'CREATE TABLE K('+@col1+' VARCHAR(20) )'EXEC sp_executesql @sql exec general_select1 'orderid'ACTUALLY I HAVE CREATED IT DYNAMICALLYchandan Joshi |
|
|
|
|
|