SQL Server Compatibility Mode Issue  
Author Message
Pookie





PostPosted: Thu Mar 15 15:36:15 CDT 2007 Top

SQL Server >> SQL Server Compatibility Mode Issue

My app uses a user defined function which isn't allowed in SQL Server 7.

Is there a way to conditionally create a function based on the compatibility
mode?

Here's what I have so far. I keep getting syntax errors.









begin
create function here...
end

SQL Server92  
 
 
Tibor





PostPosted: Thu Mar 15 15:36:15 CDT 2007 Top

SQL Server >> SQL Server Compatibility Mode Issue CREATE function need to be alone in a batch. Consider putting the whole CREATE FUNCTION statement in
a variable then execute that string:


--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://sqlblog.com/blogs/tibor_karaszi




> My app uses a user defined function which isn't allowed in SQL Server 7.
>
> Is there a way to conditionally create a function based on the compatibility mode?
>
> Here's what I have so far. I keep getting syntax errors.
>


>

>

>

> begin
> create function here...
> end
>

 
 
Isaac





PostPosted: Thu Mar 15 17:37:31 CDT 2007 Top

SQL Server >> SQL Server Compatibility Mode Issue


> CREATE function need to be alone in a batch. Consider putting the whole
> CREATE FUNCTION statement in a variable then execute that string:

>

That worked perfectly. Thanks.