c# - creating a custom constraint in sql -


I am using sql on a C # application and my table consists of stock quotes which I am concerned with They are called symbols and dates, what I am trying to do, prevents one line from adding to the table if both symbols and dates are already present in a separate line.

For example if I already have a line for GOOG and today's date, then if I try to add a line with that mailing information, it will either be rejected Or update the existing line with new information is the easiest way to do this?

"itemprop =" text ">

After a look on the statement. <'& lt; Market & gt; ',' & lt; Open & gt; ', dbo.StockDailyData used as the merger target> (VALUES (' 'your id value' ',' gt; ', & lt; high & Gt; ',' lt; low & gt; ',' & lt; source (in the form of ID, symbol, market, open, high '); closed & gt;', '& lt; volume & gt; ',' AdjustedClose & gt; ',' & gt; Date & gt; Low, Closed, Segment, AdjustedClose, date to Target.Symbol = Source.Symbol and Target.Date = Source.Date Set Target.Market = Source.Market, Target.High = Source.High, Target. Less = Source.Low, Target.Close = Source.Close, Target.Volume = Source.Volume, Target.AdjustedClose = Source.AdjustedClose, when No match with target Re-inserted (id, symbol, market, open, high, low, closed, segment, adjustedClose, date) values ​​(Source.ID, Source.Symbol, Source.Market, Source.Open, Source.High, Source.Low You can set the logic by using Source.Close, Source.Volume, Source.AdjustedClose, Sourc E.Date

Already exists, what to do for it - In your case, you will update the information about the new bid. / P>

Comments

Popular posts from this blog

c - Mpirun hangs when mpi send and recieve is put in a loop -

python - Apply coupon to a customer's subscription based on non-stripe related actions on the site -

java - Unable to get JDBC connection in Spring application to MySQL -