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
 General SQL Server Forums
 New to SQL Server Programming
 T-SQL...Compiler Directives....

Author  Topic 

ZarrinPour
Yak Posting Veteran

66 Posts

Posted - 2007-10-19 : 13:18:10
Hi all
I want to know is there any way to use ompiler Directives in T-Sql Codes as the same as High level Programming Languages to enable or disable compilation of certain code at run-time?

Thanks in advance.
Kind Regards.

spirit1
Cybernetic Yak Master

11752 Posts

Posted - 2007-10-19 : 13:20:49
can you give an example?

_______________________________________________
Causing trouble since 1980
blog: http://weblogs.sqlteam.com/mladenp
SSMS Add-in that does a few things: www.ssmstoolspack.com
Go to Top of Page

KenW
Constraint Violating Yak Guru

391 Posts

Posted - 2007-10-19 : 14:40:30
Spirit,

ZarrinPour is asking about something like:

#ifdef SOMECONDITION
<some SQL here>
#endif

ZarrinPour:

No.
Go to Top of Page

spirit1
Cybernetic Yak Master

11752 Posts

Posted - 2007-10-19 : 14:45:19
well addin for ssms i created provides debug sections like in visual studio.
look into my signature.

but ZarrinPour should specify more clearly what would he like to do exactly.. maybe there's another way to do it.

_______________________________________________
Causing trouble since 1980
blog: http://weblogs.sqlteam.com/mladenp
SSMS Add-in that does a few things: www.ssmstoolspack.com
Go to Top of Page

ZarrinPour
Yak Posting Veteran

66 Posts

Posted - 2007-10-19 : 15:32:24
quote:
Originally posted by spirit1

well addin for ssms i created provides debug sections like in visual studio.
look into my signature.

but ZarrinPour should specify more clearly what would he like to do exactly.. maybe there's another way to do it.

_______________________________________________
Causing trouble since 1980
blog: http://weblogs.sqlteam.com/mladenp
SSMS Add-in that does a few things: www.ssmstoolspack.com



Hi
yes i mean exactly some thing like this:
#ifdef SOMECONDITION
<some SQL here>
#endif

Thnaks.
Go to Top of Page

spirit1
Cybernetic Yak Master

11752 Posts

Posted - 2007-10-19 : 15:42:12
no there is no such thing by default since sql doesn't really get compiled.

_______________________________________________
Causing trouble since 1980
blog: http://weblogs.sqlteam.com/mladenp
SSMS Add-in that does a few things: www.ssmstoolspack.com
Go to Top of Page
   

- Advertisement -