Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > SQL Server > SQL Server 2000 > SQL Server 2000
Password Reminder
| FAQ | Members List | Search | Today's Posts | Mark Forums Read
SQL Server 2000 General discussion of Microsoft SQL Server -- for topics that don't fit in one of the more specific SQL Server forums. version 2000 only. There's a new forum for SQL Server 2005.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the SQL Server 2000 section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old January 14th, 2005, 11:55 AM
ea ea is offline
Registered User
Join Date: Nov 2004
Location: New York, NY, USA.
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Default UDF: allowed in one DB but not another???

Can someone help on this.

I've got a UDF Scalar Function that works fine in on database, but when I try to copy the same UDF to another database I get syntax error messages.

The function is:
ALTER FUNCTION dbo.GetDateFilled
    @dateAt1 datetime,
    @dateAt2 datetime,
        @dateEndActual datetime
RETURNS datetime
    Declare @dateFilled datetime
    If @dateAt1 Is Not Null And @dateAt2 Is Null
        set @dateFilled = @dateAt1
        If @dateAt1 Is Null And @dateAt2 Is Not Null
        set @dateFilled = @dateAt2
        If @dateAt1 Is Null And @dateAt2 Is Null
        set @dateFilled = @dateEndActual
            Set @dateFilled = @dateAt1
    RETURN @dateFilled

And this isn't the only UDF I can't import from one DB to another. It seems that I can't import any???

Any ideas would be greatly appreciated:


Reply With Quote
  #2 (permalink)  
Old January 16th, 2005, 04:05 AM
Friend of Wrox
Join Date: Nov 2003
Location: Lehigh Acres, FL, USA.
Posts: 625
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to jemacc

What is your syntax error message. Is the owner of the function the same owner on both databases.

Jaime E. Maccou
Reply With Quote
  #3 (permalink)  
Old January 18th, 2005, 03:14 PM
ea ea is offline
Registered User
Join Date: Nov 2004
Location: New York, NY, USA.
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts

What I did was try to import the function through an Access ADP. So the function owner should be the same.

Any other ideas on this? I'm really stumpted and I owe this to a client.

Otherwise, would you have a work-around?


Reply With Quote

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
UDF references DavidReese BOOK: Excel 2007 VBA Programmer's Reference ISBN: 978-0-470-04643-2 0 November 2nd, 2008 11:04 AM
trying to run an udf miguel.ossa SQL Server 2005 7 July 22nd, 2007 11:12 AM
how can i execute SQL in UDF vinod_mnr SQL Server 2000 1 March 18th, 2005 12:51 PM
Returning a result from a db function not allowed? treycarroll Beginning PHP 2 March 17th, 2004 07:53 PM
UDF and Stored Procedures hrishimusale SQL Server 2000 1 November 4th, 2003 12:07 PM

All times are GMT -4. The time now is 03:43 PM.

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.