Showing posts with label implement. Show all posts
Showing posts with label implement. Show all posts

Saturday, February 25, 2012

designing reports

Hi - we are just putting a proposal/costs together to implement reporting
services.
Might seem daft (!), I know i need the report designer and it works with the
visual studio .net 2003, but does that mean we need to buy visual studio .net
2003 (std/dev/enterprise?) and the designer comes free? Or vice versa? Or
both!
Thanks PaulThe designer comes free with SQL Server (you need a license for SQL Server
anywhere you have the server part of RS installed). But, the designer needs
some version (any version) of VS to install into. If you don't have VS 2003
then the cheapest thing to do is to buy VB.Net ($100).
Bruce Loehle-Conger
MVP SQL Server Reporting Services
"Paul" <Paul@.discussions.microsoft.com> wrote in message
news:ED6BE78D-8085-4A3A-8F01-6BD0408734D9@.microsoft.com...
> Hi - we are just putting a proposal/costs together to implement reporting
> services.
> Might seem daft (!), I know i need the report designer and it works with
the
> visual studio .net 2003, but does that mean we need to buy visual studio
.net
> 2003 (std/dev/enterprise?) and the designer comes free? Or vice versa? Or
> both!
> Thanks Paul|||Thanks for the info Bruce! We have SQL server but are hoping to migrate from
Actuate...
"Bruce L-C [MVP]" wrote:
> The designer comes free with SQL Server (you need a license for SQL Server
> anywhere you have the server part of RS installed). But, the designer needs
> some version (any version) of VS to install into. If you don't have VS 2003
> then the cheapest thing to do is to buy VB.Net ($100).
>
> --
> Bruce Loehle-Conger
> MVP SQL Server Reporting Services
> "Paul" <Paul@.discussions.microsoft.com> wrote in message
> news:ED6BE78D-8085-4A3A-8F01-6BD0408734D9@.microsoft.com...
> > Hi - we are just putting a proposal/costs together to implement reporting
> > services.
> >
> > Might seem daft (!), I know i need the report designer and it works with
> the
> > visual studio .net 2003, but does that mean we need to buy visual studio
> ..net
> > 2003 (std/dev/enterprise?) and the designer comes free? Or vice versa? Or
> > both!
> >
> > Thanks Paul
>
>|||Hi Paul,
We too are evaluating products to migrate from Actuate. I can share our
findings if you're interested.
Bill
"Paul" wrote:
> Thanks for the info Bruce! We have SQL server but are hoping to migrate from
> Actuate...
> "Bruce L-C [MVP]" wrote:
> > The designer comes free with SQL Server (you need a license for SQL Server
> > anywhere you have the server part of RS installed). But, the designer needs
> > some version (any version) of VS to install into. If you don't have VS 2003
> > then the cheapest thing to do is to buy VB.Net ($100).
> >
> >
> > --
> > Bruce Loehle-Conger
> > MVP SQL Server Reporting Services
> >
> > "Paul" <Paul@.discussions.microsoft.com> wrote in message
> > news:ED6BE78D-8085-4A3A-8F01-6BD0408734D9@.microsoft.com...
> > > Hi - we are just putting a proposal/costs together to implement reporting
> > > services.
> > >
> > > Might seem daft (!), I know i need the report designer and it works with
> > the
> > > visual studio .net 2003, but does that mean we need to buy visual studio
> > ..net
> > > 2003 (std/dev/enterprise?) and the designer comes free? Or vice versa? Or
> > > both!
> > >
> > > Thanks Paul
> >
> >
> >|||Hi Paul,
I have a lot of experience with Actuate (8 years) and am currently getting
up to speed on Reporting Services.
Let me know if you'd like to exchange information/experiences on migrating
from Actuate to Reporting Services.
-- Chris
--
Chris, SSSI
"Paul" wrote:
> Thanks for the info Bruce! We have SQL server but are hoping to migrate from
> Actuate...
> "Bruce L-C [MVP]" wrote:
> > The designer comes free with SQL Server (you need a license for SQL Server
> > anywhere you have the server part of RS installed). But, the designer needs
> > some version (any version) of VS to install into. If you don't have VS 2003
> > then the cheapest thing to do is to buy VB.Net ($100).
> >
> >
> > --
> > Bruce Loehle-Conger
> > MVP SQL Server Reporting Services
> >
> > "Paul" <Paul@.discussions.microsoft.com> wrote in message
> > news:ED6BE78D-8085-4A3A-8F01-6BD0408734D9@.microsoft.com...
> > > Hi - we are just putting a proposal/costs together to implement reporting
> > > services.
> > >
> > > Might seem daft (!), I know i need the report designer and it works with
> > the
> > > visual studio .net 2003, but does that mean we need to buy visual studio
> > ..net
> > > 2003 (std/dev/enterprise?) and the designer comes free? Or vice versa? Or
> > > both!
> > >
> > > Thanks Paul
> >
> >
> >|||Hi Bill,
I have a lot of experience with Actuate (8 years) and am currently getting
up to speed on Reporting Services.
Let me know if you'd like to exchange information/experiences on migrating
from Actuate to Reporting Services.
-- Chris
Chris, SSSI
"Bill" wrote:
> Hi Paul,
> We too are evaluating products to migrate from Actuate. I can share our
> findings if you're interested.
> Bill
> "Paul" wrote:
> > Thanks for the info Bruce! We have SQL server but are hoping to migrate from
> > Actuate...
> >
> > "Bruce L-C [MVP]" wrote:
> >
> > > The designer comes free with SQL Server (you need a license for SQL Server
> > > anywhere you have the server part of RS installed). But, the designer needs
> > > some version (any version) of VS to install into. If you don't have VS 2003
> > > then the cheapest thing to do is to buy VB.Net ($100).
> > >
> > >
> > > --
> > > Bruce Loehle-Conger
> > > MVP SQL Server Reporting Services
> > >
> > > "Paul" <Paul@.discussions.microsoft.com> wrote in message
> > > news:ED6BE78D-8085-4A3A-8F01-6BD0408734D9@.microsoft.com...
> > > > Hi - we are just putting a proposal/costs together to implement reporting
> > > > services.
> > > >
> > > > Might seem daft (!), I know i need the report designer and it works with
> > > the
> > > > visual studio .net 2003, but does that mean we need to buy visual studio
> > > ..net
> > > > 2003 (std/dev/enterprise?) and the designer comes free? Or vice versa? Or
> > > > both!
> > > >
> > > > Thanks Paul
> > >
> > >
> > >

Sunday, February 19, 2012

design question

What would the best / most correct way be to implement a relationship where you have for example a customer table, a partner table and a orders table and both customers and partners can have orders associated with them. This is just an easy way for me to describe the relationship I am looking at and is not really the data sets I am working with.

Following this analogy I currently have customers and orders and the orders table has a column customer_id to link each order to a customer. I now want partners to start to be able to place orders. It does not seem logical to me to have a second order table for them but the two identity columns that are the id columns would be on separate tables and thus could conflict. Only thing I can think of is to start the partner id identity column at a really high number. Is this the right thing to do it somehow does not feel right.

I would suggest adding another column to the Orders table called partnerId and FK it to the Partners table. Place a check constraint on the table to ensure that one of these columns is null at all times. There will be no conflict with the ids. For display purposes, you can check to see which column is not null and display the header Customer or partner in the order so people reading it are not confused. Or even just keep saying Customer id but prefix the display of partnerIds with a P. This seems to be the cleanest solution in my opinion.

|||

I would consider partners a special type of customer, rather than them being two different things. Then for each partner, you create an entry in the customers table (perhaps with a customertype field). Then for those customers that are partners, you can add a row to the partner table that uses the customer id as it's own primary key.

Another option is to create a "Entity" table of some kind that is the one making the orders, and partners and customers point to the entity (are specific types of entity). Of course you can use a different name if you want (Persons, BusinessEntity, etc).

These types of designs will allow you to reuse code, and perhaps even some UI savings when dealing with information that is shared between the two types of entities (Name, address, phone number, etc).

Design Question

I have a scenario that I want to implement and i'm not quiet sure how to get
about this using SQL Server and I would like to share some of your
experiences and expertise.
I need to retreive data on the basis of different roles for example there
are two different sites and there are two different types of users site user
and admin user. site user can only view the site related data and the admin
user can view data from both the sites.
As in the real system there will be lots of sites and there are couple of
more roles defined into the database.
I have created a 3 tables. User, Role and UserRole and i'm kinda stuck
thinking what is the best way to proceed further.
I would appreciate if you could provide me some of your views.
Thanks in advance.
Regards,
Sajid Malik
Sajid
There is not enough info to suggest an accurate solutuion
Can you provide DDL+ sample data + expected result ?
"Sajid S. Malik" <sajid_malick@.yahoo.com> wrote in message
news:%23OEGfS9BHHA.4680@.TK2MSFTNGP04.phx.gbl...
>I have a scenario that I want to implement and i'm not quiet sure how to
>get about this using SQL Server and I would like to share some of your
>experiences and expertise.
> I need to retreive data on the basis of different roles for example there
> are two different sites and there are two different types of users site
> user and admin user. site user can only view the site related data and the
> admin user can view data from both the sites.
> As in the real system there will be lots of sites and there are couple of
> more roles defined into the database.
> I have created a 3 tables. User, Role and UserRole and i'm kinda stuck
> thinking what is the best way to proceed further.
> I would appreciate if you could provide me some of your views.
> Thanks in advance.
> Regards,
> Sajid Malik
>
|||Hi Uri,
User Table
UserID
Username
Password
Role Table
RoleID
Role
User Role Table
UserID
RoleID
I have three tables for users and roles. Now for example I have 1 table
that have some records and I want to retreive only those records if
user that have permissions to view all the records and there could be
some other permissions for other user role.
I hope this information is what you need if there is something else you
need to know please do not hesitate to contact me.
Thank you in advance.
Regards,
Sajid Malik
Uri Dimant wrote:[vbcol=seagreen]
> Sajid
> There is not enough info to suggest an accurate solutuion
> Can you provide DDL+ sample data + expected result ?
>
> "Sajid S. Malik" <sajid_malick@.yahoo.com> wrote in message
> news:%23OEGfS9BHHA.4680@.TK2MSFTNGP04.phx.gbl...
|||Hi
> I have three tables for users and roles. Now for example I have 1 table
> that have some records and I want to retreive only those records if
> user that have permissions to view all the records and there could be
> some other permissions for other user role.
What do you mean "I have 1 table"? Can you isnert some sample data and show
us an expected result?
"Sajid MALIK" <sajid.malik@.gmail.com> wrote in message
news:1163530384.096202.126770@.b28g2000cwb.googlegr oups.com...
> Hi Uri,
> User Table
> --
> UserID
> Username
> Password
> Role Table
> --
> RoleID
> Role
> User Role Table
> --
> UserID
> RoleID
> I have three tables for users and roles. Now for example I have 1 table
> that have some records and I want to retreive only those records if
> user that have permissions to view all the records and there could be
> some other permissions for other user role.
> I hope this information is what you need if there is something else you
> need to know please do not hesitate to contact me.
> Thank you in advance.
> Regards,
> Sajid Malik
>
> Uri Dimant wrote:
>
|||Sajid S. Malik wrote:
> I have a scenario that I want to implement and i'm not quiet sure how to get
> about this using SQL Server and I would like to share some of your
> experiences and expertise.
> I need to retreive data on the basis of different roles for example there
> are two different sites and there are two different types of users site user
> and admin user. site user can only view the site related data and the admin
> user can view data from both the sites.
> As in the real system there will be lots of sites and there are couple of
> more roles defined into the database.
> I have created a 3 tables. User, Role and UserRole and i'm kinda stuck
> thinking what is the best way to proceed further.
> I would appreciate if you could provide me some of your views.
It seems what you are after is row level security. Oracle has a feature
called Virtual Private Databases (VPD), which let you make each user see
only those rows he is allowed to based on his role. You might like to
check Oracle's webpages to check if this is what you are after. If it
is, check Microsoft's page
http://www.microsoft.com/technet/prodtechnol/sql/2005/multisec.mspx .
Arto Viitanen, CSC Ltd.
Espoo, Finland
|||Hi Uri,
Well it doesn't matter what the data is it could be only one column in that
table I want to only select the rows based on the user roles.
Lets take another example of stores So the table would be
Site Table
SiteID
Site
1 | USA
2 | London
3 | France
4 | Germany
Now for example if I'm a site user I should only view the records for the
local division like USA, London etc but if I'm an admin user I can view
records for all the divisions.
I hope this clears the question.
Please do not hesitate to ask further question.
Thanks,
sajid malik
"Uri Dimant" <urid@.iscar.co.il> wrote in message
news:Op7ww6HCHHA.3380@.TK2MSFTNGP04.phx.gbl...
> Hi
> What do you mean "I have 1 table"? Can you isnert some sample data and
> show us an expected result?
>
> "Sajid MALIK" <sajid.malik@.gmail.com> wrote in message
> news:1163530384.096202.126770@.b28g2000cwb.googlegr oups.com...
>
|||Hi
http://vyaskn.tripod.com/row_level_security_in_sql_server_databases.htm
"Sajid S. Malik" <sajid_malick@.yahoo.com> wrote in message
news:u4ru3uKCHHA.3448@.TK2MSFTNGP03.phx.gbl...
> Hi Uri,
> Well it doesn't matter what the data is it could be only one column in
> that table I want to only select the rows based on the user roles.
> Lets take another example of stores So the table would be
> Site Table
> --
> SiteID
> Site
> --
> 1 | USA
> 2 | London
> 3 | France
> 4 | Germany
> --
> Now for example if I'm a site user I should only view the records for the
> local division like USA, London etc but if I'm an admin user I can view
> records for all the divisions.
> I hope this clears the question.
> Please do not hesitate to ask further question.
> Thanks,
> sajid malik
>
> "Uri Dimant" <urid@.iscar.co.il> wrote in message
> news:Op7ww6HCHHA.3380@.TK2MSFTNGP04.phx.gbl...
>

Design Question

Hi

I am trying to implement a invtentory control system and would like
some advice on the best design for it.

The system will have to main tables Product and Stock which will look
as follows

Product
---
ProductId
PartNumber
Description

Stock
--
StockId
ProductId
SerialNumber
RecievedDate
OrderNo
ShipmentNo

In ths stock table the RecivedDate Signifies when the product
recieved, The OrderNo signifies the whether the item has been sold and
the shipmentNo represents whethert tiem has been shipped.

I want to produce an SQL query which basically looks like this

StockList
---
PartNumber
Description
QtyInStock (StockItems not sold or shipped)
QtySold (StockItems Sold)
QtyShipped (StockItems Sold and shipped)

I cant seem to work out what the query would look like for this.
Has anyone got anytips, or alternative ideas/designs"Boogieboy" <iamthecow@.hotmail.com> wrote in message news:67ae4f66.0409220519.6d99eb62@.posting.google.c om...
> Hi
> I am trying to implement a invtentory control system and would like
> some advice on the best design for it.
<snip>
> I want to produce an SQL query which basically looks like this
> StockList
> ---
> PartNumber
> Description
> QtyInStock (StockItems not sold or shipped)
> QtySold (StockItems Sold)
> QtyShipped (StockItems Sold and shipped)
> I cant seem to work out what the query would look like for this.
> Has anyone got anytips, or alternative ideas/designs

Tip: Summing 1s and 0s is essentially the same as counting...

How about this?

Select
PartNumber,
Description,
SUM( CASE
WHEN OrderNo is NULL and ShipmentNo is NULL
then 1 else 0 END) as QtyInStock,
SUM( CASE
WHEN OrderNo is NOT NULL and ShipmentNo is NULL
then 1 else 0 END) as QtySold,
SUM( CASE
WHEN OrderNo is NOT NULL and ShipmentNo is NOT NULL
then 1 else 0 end) as QtyShipped
FROM
Product
JOIN Stock
ON Product.ProductID = Stock.ProductID
GROUP BY
PartNumber,
Description
ORDER BY
PartNumber ;

--
Paul Horan[TeamSybase] www.teamsybase.com
Sr. Architect
VCI Springfield, Mass
www.vcisolutions.com|||>> Has anyone got any tips, or alternative ideas/designs <<

inventory, orders and shipments are all logically different things, I
would put them in separate tables.

Friday, February 17, 2012

Design Question

I have a scenario that I want to implement and i'm not quiet sure how to get
about this using SQL Server and I would like to share some of your
experiences and expertise.
I need to retreive data on the basis of different roles for example there
are two different sites and there are two different types of users site user
and admin user. site user can only view the site related data and the admin
user can view data from both the sites.
As in the real system there will be lots of sites and there are couple of
more roles defined into the database.
I have created a 3 tables. User, Role and UserRole and i'm kinda stuck
thinking what is the best way to proceed further.
I would appreciate if you could provide me some of your views.
Thanks in advance.
Regards,
Sajid MalikSajid
There is not enough info to suggest an accurate solutuion
Can you provide DDL+ sample data + expected result ?
"Sajid S. Malik" <sajid_malick@.yahoo.com> wrote in message
news:%23OEGfS9BHHA.4680@.TK2MSFTNGP04.phx.gbl...
>I have a scenario that I want to implement and i'm not quiet sure how to
>get about this using SQL Server and I would like to share some of your
>experiences and expertise.
> I need to retreive data on the basis of different roles for example there
> are two different sites and there are two different types of users site
> user and admin user. site user can only view the site related data and the
> admin user can view data from both the sites.
> As in the real system there will be lots of sites and there are couple of
> more roles defined into the database.
> I have created a 3 tables. User, Role and UserRole and i'm kinda stuck
> thinking what is the best way to proceed further.
> I would appreciate if you could provide me some of your views.
> Thanks in advance.
> Regards,
> Sajid Malik
>|||Hi Uri,
User Table
--
UserID
Username
Password
Role Table
--
RoleID
Role
User Role Table
--
UserID
RoleID
I have three tables for users and roles. Now for example I have 1 table
that have some records and I want to retreive only those records if
user that have permissions to view all the records and there could be
some other permissions for other user role.
I hope this information is what you need if there is something else you
need to know please do not hesitate to contact me.
Thank you in advance.
Regards,
Sajid Malik
Uri Dimant wrote:
> Sajid
> There is not enough info to suggest an accurate solutuion
> Can you provide DDL+ sample data + expected result ?
>
> "Sajid S. Malik" <sajid_malick@.yahoo.com> wrote in message
> news:%23OEGfS9BHHA.4680@.TK2MSFTNGP04.phx.gbl...
> >I have a scenario that I want to implement and i'm not quiet sure how to
> >get about this using SQL Server and I would like to share some of your
> >experiences and expertise.
> >
> > I need to retreive data on the basis of different roles for example there
> > are two different sites and there are two different types of users site
> > user and admin user. site user can only view the site related data and the
> > admin user can view data from both the sites.
> > As in the real system there will be lots of sites and there are couple of
> > more roles defined into the database.
> > I have created a 3 tables. User, Role and UserRole and i'm kinda stuck
> > thinking what is the best way to proceed further.
> >
> > I would appreciate if you could provide me some of your views.
> >
> > Thanks in advance.
> > Regards,
> > Sajid Malik
> >|||Hi
> I have three tables for users and roles. Now for example I have 1 table
> that have some records and I want to retreive only those records if
> user that have permissions to view all the records and there could be
> some other permissions for other user role.
What do you mean "I have 1 table"? Can you isnert some sample data and show
us an expected result?
"Sajid MALIK" <sajid.malik@.gmail.com> wrote in message
news:1163530384.096202.126770@.b28g2000cwb.googlegroups.com...
> Hi Uri,
> User Table
> --
> UserID
> Username
> Password
> Role Table
> --
> RoleID
> Role
> User Role Table
> --
> UserID
> RoleID
> I have three tables for users and roles. Now for example I have 1 table
> that have some records and I want to retreive only those records if
> user that have permissions to view all the records and there could be
> some other permissions for other user role.
> I hope this information is what you need if there is something else you
> need to know please do not hesitate to contact me.
> Thank you in advance.
> Regards,
> Sajid Malik
>
> Uri Dimant wrote:
>> Sajid
>> There is not enough info to suggest an accurate solutuion
>> Can you provide DDL+ sample data + expected result ?
>>
>> "Sajid S. Malik" <sajid_malick@.yahoo.com> wrote in message
>> news:%23OEGfS9BHHA.4680@.TK2MSFTNGP04.phx.gbl...
>> >I have a scenario that I want to implement and i'm not quiet sure how to
>> >get about this using SQL Server and I would like to share some of your
>> >experiences and expertise.
>> >
>> > I need to retreive data on the basis of different roles for example
>> > there
>> > are two different sites and there are two different types of users site
>> > user and admin user. site user can only view the site related data and
>> > the
>> > admin user can view data from both the sites.
>> > As in the real system there will be lots of sites and there are couple
>> > of
>> > more roles defined into the database.
>> > I have created a 3 tables. User, Role and UserRole and i'm kinda stuck
>> > thinking what is the best way to proceed further.
>> >
>> > I would appreciate if you could provide me some of your views.
>> >
>> > Thanks in advance.
>> > Regards,
>> > Sajid Malik
>> >
>|||Sajid S. Malik wrote:
> I have a scenario that I want to implement and i'm not quiet sure how to get
> about this using SQL Server and I would like to share some of your
> experiences and expertise.
> I need to retreive data on the basis of different roles for example there
> are two different sites and there are two different types of users site user
> and admin user. site user can only view the site related data and the admin
> user can view data from both the sites.
> As in the real system there will be lots of sites and there are couple of
> more roles defined into the database.
> I have created a 3 tables. User, Role and UserRole and i'm kinda stuck
> thinking what is the best way to proceed further.
> I would appreciate if you could provide me some of your views.
It seems what you are after is row level security. Oracle has a feature
called Virtual Private Databases (VPD), which let you make each user see
only those rows he is allowed to based on his role. You might like to
check Oracle's webpages to check if this is what you are after. If it
is, check Microsoft's page
http://www.microsoft.com/technet/prodtechnol/sql/2005/multisec.mspx .
Arto Viitanen, CSC Ltd.
Espoo, Finland|||Hi Uri,
Well it doesn't matter what the data is it could be only one column in that
table I want to only select the rows based on the user roles.
Lets take another example of stores So the table would be
Site Table
--
SiteID
Site
--
1 | USA
2 | London
3 | France
4 | Germany
--
Now for example if I'm a site user I should only view the records for the
local division like USA, London etc but if I'm an admin user I can view
records for all the divisions.
I hope this clears the question.
Please do not hesitate to ask further question.
Thanks,
sajid malik
"Uri Dimant" <urid@.iscar.co.il> wrote in message
news:Op7ww6HCHHA.3380@.TK2MSFTNGP04.phx.gbl...
> Hi
>> I have three tables for users and roles. Now for example I have 1 table
>> that have some records and I want to retreive only those records if
>> user that have permissions to view all the records and there could be
>> some other permissions for other user role.
> What do you mean "I have 1 table"? Can you isnert some sample data and
> show us an expected result?
>
> "Sajid MALIK" <sajid.malik@.gmail.com> wrote in message
> news:1163530384.096202.126770@.b28g2000cwb.googlegroups.com...
>> Hi Uri,
>> User Table
>> --
>> UserID
>> Username
>> Password
>> Role Table
>> --
>> RoleID
>> Role
>> User Role Table
>> --
>> UserID
>> RoleID
>> I have three tables for users and roles. Now for example I have 1 table
>> that have some records and I want to retreive only those records if
>> user that have permissions to view all the records and there could be
>> some other permissions for other user role.
>> I hope this information is what you need if there is something else you
>> need to know please do not hesitate to contact me.
>> Thank you in advance.
>> Regards,
>> Sajid Malik
>>
>> Uri Dimant wrote:
>> Sajid
>> There is not enough info to suggest an accurate solutuion
>> Can you provide DDL+ sample data + expected result ?
>>
>> "Sajid S. Malik" <sajid_malick@.yahoo.com> wrote in message
>> news:%23OEGfS9BHHA.4680@.TK2MSFTNGP04.phx.gbl...
>> >I have a scenario that I want to implement and i'm not quiet sure how
>> >to
>> >get about this using SQL Server and I would like to share some of your
>> >experiences and expertise.
>> >
>> > I need to retreive data on the basis of different roles for example
>> > there
>> > are two different sites and there are two different types of users
>> > site
>> > user and admin user. site user can only view the site related data and
>> > the
>> > admin user can view data from both the sites.
>> > As in the real system there will be lots of sites and there are couple
>> > of
>> > more roles defined into the database.
>> > I have created a 3 tables. User, Role and UserRole and i'm kinda stuck
>> > thinking what is the best way to proceed further.
>> >
>> > I would appreciate if you could provide me some of your views.
>> >
>> > Thanks in advance.
>> > Regards,
>> > Sajid Malik
>> >
>|||Hi
http://vyaskn.tripod.com/row_level_security_in_sql_server_databases.htm
"Sajid S. Malik" <sajid_malick@.yahoo.com> wrote in message
news:u4ru3uKCHHA.3448@.TK2MSFTNGP03.phx.gbl...
> Hi Uri,
> Well it doesn't matter what the data is it could be only one column in
> that table I want to only select the rows based on the user roles.
> Lets take another example of stores So the table would be
> Site Table
> --
> SiteID
> Site
> --
> 1 | USA
> 2 | London
> 3 | France
> 4 | Germany
> --
> Now for example if I'm a site user I should only view the records for the
> local division like USA, London etc but if I'm an admin user I can view
> records for all the divisions.
> I hope this clears the question.
> Please do not hesitate to ask further question.
> Thanks,
> sajid malik
>
> "Uri Dimant" <urid@.iscar.co.il> wrote in message
> news:Op7ww6HCHHA.3380@.TK2MSFTNGP04.phx.gbl...
>> Hi
>> I have three tables for users and roles. Now for example I have 1 table
>> that have some records and I want to retreive only those records if
>> user that have permissions to view all the records and there could be
>> some other permissions for other user role.
>> What do you mean "I have 1 table"? Can you isnert some sample data and
>> show us an expected result?
>>
>> "Sajid MALIK" <sajid.malik@.gmail.com> wrote in message
>> news:1163530384.096202.126770@.b28g2000cwb.googlegroups.com...
>> Hi Uri,
>> User Table
>> --
>> UserID
>> Username
>> Password
>> Role Table
>> --
>> RoleID
>> Role
>> User Role Table
>> --
>> UserID
>> RoleID
>> I have three tables for users and roles. Now for example I have 1 table
>> that have some records and I want to retreive only those records if
>> user that have permissions to view all the records and there could be
>> some other permissions for other user role.
>> I hope this information is what you need if there is something else you
>> need to know please do not hesitate to contact me.
>> Thank you in advance.
>> Regards,
>> Sajid Malik
>>
>> Uri Dimant wrote:
>> Sajid
>> There is not enough info to suggest an accurate solutuion
>> Can you provide DDL+ sample data + expected result ?
>>
>> "Sajid S. Malik" <sajid_malick@.yahoo.com> wrote in message
>> news:%23OEGfS9BHHA.4680@.TK2MSFTNGP04.phx.gbl...
>> >I have a scenario that I want to implement and i'm not quiet sure how
>> >to
>> >get about this using SQL Server and I would like to share some of your
>> >experiences and expertise.
>> >
>> > I need to retreive data on the basis of different roles for example
>> > there
>> > are two different sites and there are two different types of users
>> > site
>> > user and admin user. site user can only view the site related data
>> > and the
>> > admin user can view data from both the sites.
>> > As in the real system there will be lots of sites and there are
>> > couple of
>> > more roles defined into the database.
>> > I have created a 3 tables. User, Role and UserRole and i'm kinda
>> > stuck
>> > thinking what is the best way to proceed further.
>> >
>> > I would appreciate if you could provide me some of your views.
>> >
>> > Thanks in advance.
>> > Regards,
>> > Sajid Malik
>> >
>>
>

Design Question

I have a scenario that I want to implement and i'm not quiet sure how to get
about this using SQL Server and I would like to share some of your
experiences and expertise.
I need to retreive data on the basis of different roles for example there
are two different sites and there are two different types of users site user
and admin user. site user can only view the site related data and the admin
user can view data from both the sites.
As in the real system there will be lots of sites and there are couple of
more roles defined into the database.
I have created a 3 tables. User, Role and UserRole and i'm kinda stuck
thinking what is the best way to proceed further.
I would appreciate if you could provide me some of your views.
Thanks in advance.
Regards,
Sajid MalikSajid
There is not enough info to suggest an accurate solutuion
Can you provide DDL+ sample data + expected result ?
"Sajid S. Malik" <sajid_malick@.yahoo.com> wrote in message
news:%23OEGfS9BHHA.4680@.TK2MSFTNGP04.phx.gbl...
>I have a scenario that I want to implement and i'm not quiet sure how to
>get about this using SQL Server and I would like to share some of your
>experiences and expertise.
> I need to retreive data on the basis of different roles for example there
> are two different sites and there are two different types of users site
> user and admin user. site user can only view the site related data and the
> admin user can view data from both the sites.
> As in the real system there will be lots of sites and there are couple of
> more roles defined into the database.
> I have created a 3 tables. User, Role and UserRole and i'm kinda stuck
> thinking what is the best way to proceed further.
> I would appreciate if you could provide me some of your views.
> Thanks in advance.
> Regards,
> Sajid Malik
>|||Hi Uri,
User Table
--
UserID
Username
Password
Role Table
--
RoleID
Role
User Role Table
--
UserID
RoleID
I have three tables for users and roles. Now for example I have 1 table
that have some records and I want to retreive only those records if
user that have permissions to view all the records and there could be
some other permissions for other user role.
I hope this information is what you need if there is something else you
need to know please do not hesitate to contact me.
Thank you in advance.
Regards,
Sajid Malik
Uri Dimant wrote:[vbcol=seagreen]
> Sajid
> There is not enough info to suggest an accurate solutuion
> Can you provide DDL+ sample data + expected result ?
>
> "Sajid S. Malik" <sajid_malick@.yahoo.com> wrote in message
> news:%23OEGfS9BHHA.4680@.TK2MSFTNGP04.phx.gbl...|||Hi
> I have three tables for users and roles. Now for example I have 1 table
> that have some records and I want to retreive only those records if
> user that have permissions to view all the records and there could be
> some other permissions for other user role.
What do you mean "I have 1 table"? Can you isnert some sample data and show
us an expected result?
"Sajid MALIK" <sajid.malik@.gmail.com> wrote in message
news:1163530384.096202.126770@.b28g2000cwb.googlegroups.com...
> Hi Uri,
> User Table
> --
> UserID
> Username
> Password
> Role Table
> --
> RoleID
> Role
> User Role Table
> --
> UserID
> RoleID
> I have three tables for users and roles. Now for example I have 1 table
> that have some records and I want to retreive only those records if
> user that have permissions to view all the records and there could be
> some other permissions for other user role.
> I hope this information is what you need if there is something else you
> need to know please do not hesitate to contact me.
> Thank you in advance.
> Regards,
> Sajid Malik
>
> Uri Dimant wrote:
>|||Sajid S. Malik wrote:
> I have a scenario that I want to implement and i'm not quiet sure how to g
et
> about this using SQL Server and I would like to share some of your
> experiences and expertise.
> I need to retreive data on the basis of different roles for example there
> are two different sites and there are two different types of users site us
er
> and admin user. site user can only view the site related data and the admi
n
> user can view data from both the sites.
> As in the real system there will be lots of sites and there are couple of
> more roles defined into the database.
> I have created a 3 tables. User, Role and UserRole and i'm kinda stuck
> thinking what is the best way to proceed further.
> I would appreciate if you could provide me some of your views.
It seems what you are after is row level security. Oracle has a feature
called Virtual Private Databases (VPD), which let you make each user see
only those rows he is allowed to based on his role. You might like to
check Oracle's webpages to check if this is what you are after. If it
is, check Microsoft's page
http://www.microsoft.com/technet/pr...5/multisec.mspx .
Arto Viitanen, CSC Ltd.
Espoo, Finland|||Hi Uri,
Well it doesn't matter what the data is it could be only one column in that
table I want to only select the rows based on the user roles.
Lets take another example of stores So the table would be
Site Table
--
SiteID
Site
1 | USA
2 | London
3 | France
4 | Germany
--
Now for example if I'm a site user I should only view the records for the
local division like USA, London etc but if I'm an admin user I can view
records for all the divisions.
I hope this clears the question.
Please do not hesitate to ask further question.
Thanks,
sajid malik
"Uri Dimant" <urid@.iscar.co.il> wrote in message
news:Op7ww6HCHHA.3380@.TK2MSFTNGP04.phx.gbl...
> Hi
> What do you mean "I have 1 table"? Can you isnert some sample data and
> show us an expected result?
>
> "Sajid MALIK" <sajid.malik@.gmail.com> wrote in message
> news:1163530384.096202.126770@.b28g2000cwb.googlegroups.com...
>|||Hi
http://vyaskn.tripod.com/ row_level...as
es.htm
"Sajid S. Malik" <sajid_malick@.yahoo.com> wrote in message
news:u4ru3uKCHHA.3448@.TK2MSFTNGP03.phx.gbl...
> Hi Uri,
> Well it doesn't matter what the data is it could be only one column in
> that table I want to only select the rows based on the user roles.
> Lets take another example of stores So the table would be
> Site Table
> --
> SiteID
> Site
> --
> 1 | USA
> 2 | London
> 3 | France
> 4 | Germany
> --
> Now for example if I'm a site user I should only view the records for the
> local division like USA, London etc but if I'm an admin user I can view
> records for all the divisions.
> I hope this clears the question.
> Please do not hesitate to ask further question.
> Thanks,
> sajid malik
>
> "Uri Dimant" <urid@.iscar.co.il> wrote in message
> news:Op7ww6HCHHA.3380@.TK2MSFTNGP04.phx.gbl...
>

Tuesday, February 14, 2012

Design advice please...

Without a more thorough understanding of your database schema and the
business model you're trying to implement, I can only offer suggestions.
First I think using NULL to handle these values can make sense. However in
this case, I expect that I would create a Member table that had a MemberID
and MemberType columns. I would also create StudentDetails, AffiliateDetails
and RegularDetails tables and cross-reference these on the MemberID PK/FK.
This way you could hold common columns in the Member table and type-specific
information in the FK tables.
hth
____________________________________
William (Bill) Vaughn
Author, Mentor, Consultant
Microsoft MVP
www.betav.com
Please reply only to the newsgroup so that others can benefit.
This posting is provided "AS IS" with no warranties, and confers no rights.
__________________________________
"Matt" <awpilotnospam@.aol.com> wrote in message
news:jz6yc.66258$3x.20120@.attbi_s54...
> I'm developing a database for someone that will involve user accounts.
The
> accounts will hold certain data. There are different types of users: e.g.
> regular members, affiliate members, and student members. The problem is
> that not all the accounts will hold the same type of data. The difference
> between a regular member and a student member is that the regular member
has
> a doctoral degree, a date at which that degree was received, and some
other
> information; the student member has info about their current institution,
> degree type, and a faculty sponsor name.
> I think it would be unwise to put all these fields into one table and then
> leave null whichever fields are unneeded.
> Would it be good practice to have a users table with user name, password,
> email, and member type (regular, student, etc.) and then have separate
> tables for each type of member? For example, separate tables for regular
> members, student members, affiliate members, etc.
> Thanks.
> Matt
>
> Without a more thorough understanding of your database schema and the
> business model you're trying to implement, I can only offer suggestions.
> First I think using NULL to handle these values can make sense. However in
> this case, I expect that I would create a Member table that had a MemberID
> and MemberType columns. I would also create StudentDetails,
AffiliateDetails
> and RegularDetails tables and cross-reference these on the MemberID PK/FK.
> This way you could hold common columns in the Member table and
type-specific
> information in the FK tables.
Thanks!
Matt