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
 Transact-SQL (2000)
 Problem: Execute String in function

Author  Topic 

bubix
Starting Member

24 Posts

Posted - 2005-11-15 : 11:06:28
Hello,

I'm a new member of this forum. I come from Switzerland and I'm 22.

Sorry, if there are mistakes in my questions.


My question :
Can we have an Execute Statement in a function?

Because i try to do that but i have an error when i 'm executing this statement :


create function myFunct()
as
begin
exec ('Create table client ( clt_num)')

end
go

Can someone help me??

Thanks

spirit1
Cybernetic Yak Master

11752 Posts

Posted - 2005-11-15 : 11:10:41
no you can't.
you can have them in stored procedures.

Go with the flow & have fun! Else fight the flow
Go to Top of Page

bubix
Starting Member

24 Posts

Posted - 2005-11-15 : 11:15:27
Thanks a lot,

I didn't know that members are so fast to answer.

I'll try with a stored procedure

Bye
Go to Top of Page

spirit1
Cybernetic Yak Master

11752 Posts

Posted - 2005-11-15 : 11:41:07
welocme to THE TEAM!
we have the fastest response time in the known internet


Go with the flow & have fun! Else fight the flow
Go to Top of Page

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2005-11-15 : 22:30:02
Yes. and the SQLTeam works 24 hours round the clock

[KH]
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2005-11-16 : 00:50:01
Why do you want to create table dynamically?

Madhivanan

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

- Advertisement -