Click here to Skip to main content
15,918,168 members
Home / Discussions / Database
   

Database

 
AnswerRe: the insert command doesnt work Pin
Richard Deeming11-Apr-13 1:51
mveRichard Deeming11-Apr-13 1:51 
QuestionOleDb Overflow error Pin
TheJudeDude10-Apr-13 9:13
TheJudeDude10-Apr-13 9:13 
AnswerRe: OleDb Overflow error Pin
TheJudeDude10-Apr-13 9:28
TheJudeDude10-Apr-13 9:28 
Questionhow to create the databse?? Pin
tazeen ansari10-Apr-13 0:22
tazeen ansari10-Apr-13 0:22 
AnswerRe: how to create the databse?? Pin
Eddy Vluggen10-Apr-13 0:35
professionalEddy Vluggen10-Apr-13 0:35 
AnswerRe: how to create the databse?? Pin
Shanalal Kasim12-Apr-13 0:03
Shanalal Kasim12-Apr-13 0:03 
AnswerRe: how to create the databse?? Pin
indra kurnia13-May-13 6:57
indra kurnia13-May-13 6:57 
QuestionTable Design help with 2 computed columns Pin
Simon_Whale10-Apr-13 0:14
Simon_Whale10-Apr-13 0:14 
Using SQL Server 2008 r2

I am trying to design a table, which has 2 computed column based on the product of other columns including a computed column, which SQL Server doesn't like.

SQL
CREATE TABLE [dbo].[BaseRate2](
	[ProductType] [varchar](100) NOT NULL,
	[LinkToRate] [decimal](18, 0) NULL,
	[CopyOfRates] [decimal](18, 0) NULL,
	[BCdiscountLoading] [decimal](18, 0) NULL,
	[OtherLoading] [decimal](18, 0) NULL,
	[ClaimsLoading] [decimal](18, 0) NULL,
	[NoClaimsDiscount3Yr] [decimal](18, 0) NULL,
	[NoClaimsDiscount4Yr] [decimal](18, 0) NULL,
	[NoClaimsDiscount5Yr] [decimal](18, 0) NULL,
	[ConstructionLoading] [decimal](18, 0) NULL,
	[DiscretionaryDiscount] [decimal](18, 0) NULL,
	[MinPremiumLoading] [decimal](18, 0) NULL,
	[SecurityDiscount] [decimal](18, 0) NULL,
	[ProductLoading]  AS ((((((([ClaimsLoading]*[NoClaimsDiscount3Yr])*[NoClaimsDiscount4Yr])*[NoClaimsDiscount5Yr])*[ConstructionLoading])*[DiscretionaryDiscount])*[MinPremiumLoading])*[SecurityDiscount])
) ON [PRIMARY]


Now when I try to add the second computed column when uses the first computed column (ProductLoading) this is where SQL throws an error as it should do.

RateUsed as ([CopyOfRates] * [BCdiscountLoading] * [OtherLoading] * [ProductLoading])


Is there some other technique that I could design this table without manually calculating these product columns (ProductLoadings and RateUsed).

Thanks
Simon
Lobster Thermidor aux crevettes with a Mornay sauce, served in a Provençale manner with shallots and aubergines, garnished with truffle pate, brandy and a fried egg on top and Spam - Monty Python Spam Sketch

AnswerRe: Table Design help with 2 computed columns Pin
Eddy Vluggen10-Apr-13 0:23
professionalEddy Vluggen10-Apr-13 0:23 
GeneralRe: Table Design help with 2 computed columns Pin
Simon_Whale10-Apr-13 1:28
Simon_Whale10-Apr-13 1:28 
AnswerRe: Table Design help with 2 computed columns Pin
Mycroft Holmes10-Apr-13 1:50
professionalMycroft Holmes10-Apr-13 1:50 
GeneralRe: Table Design help with 2 computed columns Pin
Simon_Whale10-Apr-13 1:55
Simon_Whale10-Apr-13 1:55 
GeneralRe: Table Design help with 2 computed columns Pin
Mycroft Holmes10-Apr-13 2:23
professionalMycroft Holmes10-Apr-13 2:23 
GeneralRe: Table Design help with 2 computed columns Pin
Simon_Whale10-Apr-13 2:24
Simon_Whale10-Apr-13 2:24 
QuestionHow To Use Pivot in SQL SERVER Pin
srikrishnach9-Apr-13 23:55
srikrishnach9-Apr-13 23:55 
AnswerRe: How To Use Pivot in SQL SERVER Pin
Eddy Vluggen10-Apr-13 0:35
professionalEddy Vluggen10-Apr-13 0:35 
AnswerRe: How To Use Pivot in SQL SERVER Pin
Mycroft Holmes10-Apr-13 1:45
professionalMycroft Holmes10-Apr-13 1:45 
AnswerRe: How To Use Pivot in SQL SERVER Pin
Shanalal Kasim12-Apr-13 0:06
Shanalal Kasim12-Apr-13 0:06 
Questionproblem in join and update Pin
mhd.sbt9-Apr-13 7:34
mhd.sbt9-Apr-13 7:34 
QuestionRe: problem in join and update Pin
Sandeep Mewara9-Apr-13 8:13
mveSandeep Mewara9-Apr-13 8:13 
AnswerRe: problem in join and update Pin
mhd.sbt9-Apr-13 8:28
mhd.sbt9-Apr-13 8:28 
AnswerRe: problem in join and update Pin
Richard Deeming9-Apr-13 8:43
mveRichard Deeming9-Apr-13 8:43 
GeneralRe: problem in join and update Pin
mhd.sbt9-Apr-13 9:36
mhd.sbt9-Apr-13 9:36 
QuestionSQL Pin
nukalarajesh8-Apr-13 3:43
nukalarajesh8-Apr-13 3:43 
AnswerRe: SQL Pin
Richard Deeming8-Apr-13 4:01
mveRichard Deeming8-Apr-13 4:01 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.