Wrox Programmer Forums
|
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 November 24th, 2004, 02:59 PM
Registered User
 
Join Date: Nov 2004
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default Views or not ??

Dear all,

I'm writing an internet application that uses SQL server as a database. In this database you have about 20 tables that will contain information about all customers. Suppose I have about 50 customers. A customer can select, insert and update records in the database using the internet application. When a customer select or updates records he should only be able to see or change records that only apply to him and not to another customer.

So in my sql statements I must always use a where clause that points to the correct customer (where customer_nr=1 for example).

Is it therefore better not let the customers use the 20 base tables but in stead create 20 views for each customer that already point to only that customer ?

This means that if you have 20 base tables and 50 customers you will have 1.000 views … Is there a limit on the views to use ?

What would you guys suggest ? Or any other suggestion ?


 
Old November 24th, 2004, 03:08 PM
Authorized User
 
Join Date: Oct 2004
Posts: 46
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Views have advantage over direct access to the tables for security purposes. If you have direct access e.g. embedded SQL in you application, the user may be able to use Access to access the whole table.

However, provide you use stored procedures and have your security set correctly there should be no problem.





Similar Threads
Thread Thread Starter Forum Replies Last Post
Tables only no views eungandy SQL Server DTS 1 October 23rd, 2006 08:26 AM
Views prashar SQL Language 1 December 13th, 2005 02:10 AM
converting Access 2000 views to Sql views matta Classic ASP Professional 1 January 26th, 2005 03:37 PM
Variables in views richarda SQL Server 2000 9 December 23rd, 2004 12:29 PM
Views SAM GORDON SQL Server 2000 5 July 19th, 2003 08:14 AM





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