computed column using another table in sql

Arash

i have two table in sql serever with no relation 1-rate table 2-jewellry tabale rate table hold diffrent rate for example usd , gold , platinume and jewellry table use holds jewellry item , and total price of each item is calculated real time based on rate value from rate table .

price field in jewellry table is computed column and has its own business rule , but in end it should use a value in rate table to complete the rule , for example gold rate in rate table*weight(jewellry table)*tax(rate table ).

how can i achive this in sql server ? store procedure ? function ? i dont want to use any client side because i want to export table via wcf as odata .

Gordon Linoff

You can achieve this by creating a user-defined function that does the calculation that you want.

The computed column can then be set using the UDF.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

SQL computed column for sum of data in another table

From Dev

How to create a computed column that references another column from another table?

From Dev

Insert in SQL table using select with column values from another select

From Dev

SQL: Filtering on a computed column

From Dev

SQL: Filtering on a computed column

From Dev

Update table column using table in another SQL Server database while using a spatial function

From Dev

Populate SQL table column from another table

From Dev

Can I use a computed column in a table to fetch data from another table columns

From Dev

How can I create a SQL table variable using records in another table as column names

From Dev

TryParse in a Sql Server computed column

From Dev

TryParse in a Sql Server computed column

From Dev

SQL computed column based on OR clause

From Dev

SQL Server - computed date column

From Dev

Move SQL Server table column values to another table column

From Dev

create table column based on another table column value in sql

From Dev

create table column based on another table column value in sql

From Dev

Move SQL Server table column values to another table column

From Dev

How can i create Computed Column which gets data from another table

From Dev

SQL Join Constraint Column on Another Joined Table

From Dev

SQL command single column data to another table

From Dev

Joining a column from another complex table in sql

From Dev

Populate a column in SQL with values from another table

From Dev

SQL - Setting a variable to value of column in another table

From Dev

SQL query for referring another column in same table

From Dev

SQL Query to Filter a Table using another Table

From Dev

query table using another lookup table sql

From Dev

Update table column with another column values of the same table using updateAll()

From Dev

Sort a CursorLoader using column present in another table

From Dev

use function from another database in computed column

Related Related

  1. 1

    SQL computed column for sum of data in another table

  2. 2

    How to create a computed column that references another column from another table?

  3. 3

    Insert in SQL table using select with column values from another select

  4. 4

    SQL: Filtering on a computed column

  5. 5

    SQL: Filtering on a computed column

  6. 6

    Update table column using table in another SQL Server database while using a spatial function

  7. 7

    Populate SQL table column from another table

  8. 8

    Can I use a computed column in a table to fetch data from another table columns

  9. 9

    How can I create a SQL table variable using records in another table as column names

  10. 10

    TryParse in a Sql Server computed column

  11. 11

    TryParse in a Sql Server computed column

  12. 12

    SQL computed column based on OR clause

  13. 13

    SQL Server - computed date column

  14. 14

    Move SQL Server table column values to another table column

  15. 15

    create table column based on another table column value in sql

  16. 16

    create table column based on another table column value in sql

  17. 17

    Move SQL Server table column values to another table column

  18. 18

    How can i create Computed Column which gets data from another table

  19. 19

    SQL Join Constraint Column on Another Joined Table

  20. 20

    SQL command single column data to another table

  21. 21

    Joining a column from another complex table in sql

  22. 22

    Populate a column in SQL with values from another table

  23. 23

    SQL - Setting a variable to value of column in another table

  24. 24

    SQL query for referring another column in same table

  25. 25

    SQL Query to Filter a Table using another Table

  26. 26

    query table using another lookup table sql

  27. 27

    Update table column with another column values of the same table using updateAll()

  28. 28

    Sort a CursorLoader using column present in another table

  29. 29

    use function from another database in computed column

HotTag

Archive