SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 SQL Server 2000 Forums
 Transact-SQL (2000)
 find the table existanc before creating table
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

ashishmishra81
Starting Member

India
5 Posts

Posted - 04/22/2008 :  08:43:26  Show Profile  Visit ashishmishra81's Homepage  Reply with Quote
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 not
please help me as soon as posible

sonu

SwePeso
Patron Saint of Lost Yaks

Sweden
30281 Posts

Posted - 04/22/2008 :  08:52:47  Show Profile  Visit SwePeso's Homepage  Reply with Quote
SELECT * FROM INFORMATION_SCHEMA.TABLES



E 12°55'05.25"
N 56°04'39.16"
Go to Top of Page

madhivanan
Premature Yak Congratulator

India
22769 Posts

Posted - 04/22/2008 :  09:08:51  Show Profile  Send madhivanan a Yahoo! Message  Reply with Quote
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 not
please help me as soon as posible

sonu


Why do you want to create tables automatically?

Madhivanan

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

ashishmishra81
Starting Member

India
5 Posts

Posted - 04/22/2008 :  09:33:52  Show Profile  Visit ashishmishra81's Homepage  Reply with Quote
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 dynamically




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 not
please help me as soon as posible

sonu


Why do you want to create tables automatically?

Madhivanan

Failing to plan is Planning to fail



sonu
Go to Top of Page

tosscrosby
Aged Yak Warrior

USA
676 Posts

Posted - 04/22/2008 :  16:23:32  Show Profile  Reply with Quote
Again, why do you want to create tables automatically??

Terry
Go to Top of Page

X002548
Not Just a Number

15586 Posts

Posted - 04/22/2008 :  17:01:24  Show Profile  Reply with Quote
quote:
Originally posted by tosscrosby

Again, why do you want to create tables automatically??

Terry



Because s/he's a rocket scientist



Brett

8-)

Hint: Want your questions answered fast? Follow the direction in this link
http://weblogs.sqlteam.com/brettk/archive/2005/05/25/5276.aspx

Add yourself!
http://www.frappr.com/sqlteam



Go to Top of Page

chandan_joshi80
Starting Member

India
30 Posts

Posted - 04/24/2008 :  07:42:07  Show Profile  Reply with Quote
alter PROCEDURE general_select1
(
@col1 varchar(20)
)
AS
DECLARE @sql nvarchar(4000)
SELECT @sql = 'CREATE TABLE K('+@col1+' VARCHAR(20) )'
EXEC sp_executesql @sql


exec general_select1 'orderid'

ACTUALLY I HAVE CREATED IT DYNAMICALLY

chandan Joshi
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.07 seconds. Powered By: Snitz Forums 2000