Click here to Skip to main content
15,887,746 members
Home / Discussions / Database
   

Database

 
Questionnewtonsoft.json parser - how to deploy a CLR to SQL Server 2008 R2? Pin
Member 822518018-Nov-15 11:55
Member 822518018-Nov-15 11:55 
QuestionRemoval and delete of duplicate records in my table Pin
goldsoft15-Nov-15 2:37
goldsoft15-Nov-15 2:37 
AnswerRe: Removal and delete of duplicate records in my table Pin
Mycroft Holmes15-Nov-15 11:53
professionalMycroft Holmes15-Nov-15 11:53 
AnswerRe: Removal and delete of duplicate records in my table Pin
RNA Team15-Nov-15 16:00
RNA Team15-Nov-15 16:00 
QuestionI need to get a count of records, including column Names grouped by UnitName. What am I doing wrong? Pin
samflex13-Nov-15 5:34
samflex13-Nov-15 5:34 
AnswerRe: I need to get a count of records, including column Names grouped by UnitName. What am I doing wrong? Pin
Mycroft Holmes13-Nov-15 13:56
professionalMycroft Holmes13-Nov-15 13:56 
AnswerRe: I need to get a count of records, including column Names grouped by UnitName. What am I doing wrong? Pin
RNA Team13-Nov-15 16:32
RNA Team13-Nov-15 16:32 
QuestionSQL Linq, better idea than a join for as enumerable Pin
jkirkerx11-Nov-15 9:09
professionaljkirkerx11-Nov-15 9:09 
So I have this SQL Linq statement, pretty easy until I added Free Shipping.
In the original statement, I get the data from ORDER_COMPLETED and do a join to SHIPPING_REALTIME in which I grab the Realtime rate name.

But Now, I added Free Shipping, by using another table that holds my criteria. So now I have 2 tables to get the rate name from, the other called SHIPPING_FREEMATRIX

I'm trying to think of a better more proper way to do this.

So what I have so far is
pResults = _
(
   From oc In context.Order_Completed
   Join srt In context.Shipping_Realtime On srt.RateAPICode Equals oc.RateAPICode // My Join
   Where oc.OrderStatus = "QUEUED_FOR_FULFILLMENT" _
   Or oc.OrderStatus = "OUT_FOR_FULFILLMENT" _
   Or oc.OrderStatus = "ORDER_CANCELED" _
   And oc.OrderDate >= DbFunctions.AddDays(Today, -7)
   Order By oc.OrderNumber
   Select New coOrderIndex With
  {
     .OrderID = oc.CompletedOrderID,
     .OrderDate = oc.OrderDate,
     .OrderNumber = oc.OrderNumber,
     .OrderStatus = oc.OrderStatus,
     .LoginID = oc.LoginID,
     .GrandTotal = oc.GrandTotal,
     .RateAPICode = oc.RateAPICode,
     .RateCharge = oc.TotalNetCharge,
     .RateAPIName = If(srt.RateName Is Nothing, "", srt.RateName) // This is the rate name
  }
).AsEnumerable()
pValue = pResults.Count()
I tried using a tenary operator on RateName, but got an error saying First or Single can only be used at the end of the statement.
.RateAPIName = If(//Context.Any, //Single Linq Statement, //Single Linq Statement)
I tried a function but got the error can't execute an external function within a store statement
.RateAPIName = get_rateAPIName(oc.RateAPICode)
I tried a double join but got nothing
Join srt In context.Shipping_Realtime On srt.RateAPICode Equals oc.RateAPICode
Join fsm In context.Shipping_FreeMatrix On fsm.RateAPICode Equals oc.RateAPICode
I thought about taking the pResults and just looping back through using for each and populating the RateAPI Name, but I tried the above methods instead and aborted this thought.
for each pResult as coOrderIndex in pResults
  pResult.RateAPIName = // Another statement
next

If it was a single record that was easy for me, but doing it with multiple records is, well I'm not sure how to proceed.
AnswerRe: SQL Linq, better idea than a join for as enumerable Pin
Jörgen Andersson11-Nov-15 9:53
professionalJörgen Andersson11-Nov-15 9:53 
GeneralRe: SQL Linq, better idea than a join for as enumerable Pin
jkirkerx12-Nov-15 7:55
professionaljkirkerx12-Nov-15 7:55 
GeneralRe: SQL Linq, better idea than a join for as enumerable Pin
Jörgen Andersson12-Nov-15 9:13
professionalJörgen Andersson12-Nov-15 9:13 
GeneralRe: SQL Linq, better idea than a join for as enumerable Pin
jkirkerx12-Nov-15 10:00
professionaljkirkerx12-Nov-15 10:00 
GeneralRe: SQL Linq, better idea than a join for as enumerable Pin
Jörgen Andersson12-Nov-15 10:06
professionalJörgen Andersson12-Nov-15 10:06 
QuestionFind who dropped a table or column or view Pin
indian1435-Nov-15 7:50
indian1435-Nov-15 7:50 
AnswerRe: Find who dropped a table or column or view Pin
Corporal Agarn5-Nov-15 7:58
professionalCorporal Agarn5-Nov-15 7:58 
AnswerRe: Find who dropped a table or column or view Pin
RNA Team5-Nov-15 18:48
RNA Team5-Nov-15 18:48 
GeneralRe: Find who dropped a table or column or view Pin
Mycroft Holmes5-Nov-15 19:31
professionalMycroft Holmes5-Nov-15 19:31 
AnswerRe: Find who dropped a table or column or view Pin
Afzaal Ahmad Zeeshan8-Nov-15 1:04
professionalAfzaal Ahmad Zeeshan8-Nov-15 1:04 
QuestionWhat is the default isolation level of sqlserver 2008 R2 and 2005 Pin
MyJoiT3-Nov-15 2:15
MyJoiT3-Nov-15 2:15 
AnswerRe: What is the default isolation level of sqlserver 2008 R2 and 2005 Pin
Richard MacCutchan3-Nov-15 2:44
mveRichard MacCutchan3-Nov-15 2:44 
AnswerRe: What is the default isolation level of sqlserver 2008 R2 and 2005 Pin
Afzaal Ahmad Zeeshan3-Nov-15 3:56
professionalAfzaal Ahmad Zeeshan3-Nov-15 3:56 
QuestionSql Server DataBase Pin
Member 121090622-Nov-15 21:40
Member 121090622-Nov-15 21:40 
AnswerRe: Sql Server DataBase Pin
Chris Quinn3-Nov-15 0:32
Chris Quinn3-Nov-15 0:32 
AnswerRe: Sql Server DataBase Pin
RNA Team3-Nov-15 21:02
RNA Team3-Nov-15 21:02 
GeneralRe: Sql Server DataBase Pin
Mycroft Holmes3-Nov-15 21:15
professionalMycroft Holmes3-Nov-15 21:15 

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.