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
Register
Register | FAQ | Members List | Calendar | 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
Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old December 6th, 2007, 09:26 AM
Friend of Wrox
 
Join Date: Oct 2004
Location: delhi, delhi, India.
Posts: 553
Thanks: 0
Thanked 1 Time in 1 Post
Send a message via MSN to vinod_yadav1919 Send a message via Yahoo to vinod_yadav1919
Default Go for View or User Defined function

Hi Everybody!!,


Go for View or User Defined function

I am using 12-14 unions to get the desired output.

e.g ProductShipped is devided into four regions(North,south,east,west)

to get records of each regions i have to make 4 unions .

so i put 4 different function fn_getProductNorth,fn_getProductSouth,fn_getProduc tEast and
fn_getProductWest.

I could make one function and based on regions i could get the results.

the problem is that database is designed columnwise for each Region
i.e NorthRegion, SouthRegion,WestRegion and EastRegion are columns.
the same thing is applied for all other ProductOwner tables.

so I have to use joined on different columnName as specified by Regions.
Yes we can design good database tables but we can't modify it as per some business rules.
so ,
1>should i use View and put all the joins with Union Class.
2>should i continue with different function<for code maintainablity and reuse>
and then make union of all the functions
3>since we are only looking for records search,should i use view or function.
As i can get the results from both view and functions.

Because Admin can get records for all regions or some specific regions.
and these regions are different columns
i.e

NOrthRegion SouthRegion EastRegion
 1 1 1
 1 0 1
 0 1 0
 1 0 1

Any Help or pointer to use view or function?

Thanks In Advance.

Cheers :)

vinod
__________________
Cheers :)

vinod
Reply With Quote
  #2 (permalink)  
Old December 12th, 2007, 04:18 AM
Friend of Wrox
 
Join Date: May 2006
Location: Helsingborg, , Sweden.
Posts: 246
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I think you should use FUNCTION with four parameters, one for each region.


Reply With Quote
Reply


Thread Tools
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
User Defined function in XSL1.0 elayaraja.s XML 1 July 22nd, 2008 03:24 AM
calling the user defined function on click event CsharpHelp C# 1 June 6th, 2005 07:25 AM
Calling User Defined Function penta Access 5 March 4th, 2005 11:57 AM
User Defined Function niravp SQL Server 2000 7 November 29th, 2004 01:18 PM
Using a user defined type and the Split Function nikotromus Access VBA 2 August 20th, 2004 12:02 PM



All times are GMT -4. The time now is 06:18 AM.


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