Wrox Programmer Forums
Go Back   Wrox Programmer Forums > SQL Server > SQL Server 2000 > SQL Server 2000
|
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 software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old May 29th, 2006, 06:31 AM
Authorized User
 
Join Date: May 2006
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to Arunachalam
Default Sql Server Function Creation

Dear All

  I face the following Problem in sql server
  I install Sql Server 2000 in windows 2000 server ,All the query and procedure run successfully , my Problem is EnterPrise manager Database could not display the UserDefined function menu,

 Why the Sql Server not display (user Defined Function)

  i any permission will be need

 How to configure , if any one know it please Replay me


 
Old May 30th, 2006, 05:50 AM
Authorized User
 
Join Date: Nov 2005
Posts: 44
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to joxa83 Send a message via Yahoo to joxa83
Default

I have same problem since I moved from sql2000 to 2005.I use Query Analyser (sql server 2000)for manipulationg with functions.

 
Old May 31st, 2006, 05:23 AM
Authorized User
 
Join Date: May 2006
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to Arunachalam
Default

 I type the following function in query analyser (Sql server 2000),
Query Analyser also generate an error

CREATE FUNCTION SalesByStore (@storeid varchar(30))
RETURNS TABLE
AS
RETURN (SELECT title from Suar )

Error message
   in correct syntax near Function

how to solve this problem

Regards
Arun



Quote:
quote:Originally posted by joxa83
 I have same problem since I moved from sql2000 to 2005.I use Query Analyser (sql server 2000)for manipulationg with functions.

 
Old May 31st, 2006, 05:44 AM
Authorized User
 
Join Date: Mar 2006
Posts: 31
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi Aruanachalam!

Did you upgrade from 7.0 to SQL Server 2000 or you just installed SQL Server 2000 only ?
Upto 7.0 there was no concept of functions. It was introduced in SQL Server 2000.
To avoid this -
[1] Detach databases
[2] Uninstall older version (7.0/6.5)
[3] Install SQL Server 2000
[4] Attach databases

For 2005 too, the same concept is applicable. Although, upgrades work fine but, some in some cases you find such troubles.

I hope this may help you.

-Som Dutt

 
Old May 31st, 2006, 06:27 AM
Friend of Wrox
 
Join Date: May 2006
Posts: 246
Thanks: 0
Thanked 0 Times in 0 Posts
Default

The syntax is correct. Sometimes, depending on your technical platform and history, you have to add owner to the object as written below.
Quote:
quote:Originally posted by Arunachalam
  I type the following function in query analyser (Sql server 2000),
Query Analyser also generate an error

CREATE FUNCTION SalesByStore (@storeid varchar(30))
RETURNS TABLE
AS
RETURN (SELECT title from Suar )

Error message
in correct syntax near Function

how to solve this problem

Regards
Arun
CREATE FUNCTION dbo.SalesByStore (@storeid varchar(30))
RETURNS TABLE
AS
RETURN (SELECT title from Suar )
 
Old May 31st, 2006, 10:10 AM
Registered User
 
Join Date: May 2006
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to deepakgnair
Default

I have run the same script and it worked. Problem is not with the Syntax!!






Similar Threads
Thread Thread Starter Forum Replies Last Post
Identity creation in SQL srinivasanraghupathy SQL Server 2000 2 December 28th, 2007 02:51 PM
how to call sql server function in crystal report arumugavel Access VBA 0 November 16th, 2006 12:05 AM
Is there an IIF Function in SQL Server? treadmill Classic ASP Professional 4 January 17th, 2005 06:57 AM
sql server function mateenmohd SQL Server 2000 1 June 12th, 2003 04:57 PM
User Creation in SQL Server Database angie C# 1 June 12th, 2003 04:32 AM





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