View Complete Post
I have the query below which is using a parallel query plan, I am not quite sure why its doing so, I think its to do with the design of the query but apart from adding indexes and specifying maxdop 1, I was wondering if there is anything else I can do in
order to rewrite the query to be more efficient and stop the use of the parallel plan.
Thanks in advance.
MERGE tblPersonProfile merge_target
USING #newrecs sourc ON merge_target.PersonURN = sourc.PersonURN AND [AddressURN]=AddressURN AND MatchCode =[ProfileMatchCode]
WHEN NOT MATCHED BY TARGET AND sourc.PersonURN IN ( SELECT PersonURN FROM #profiles ) THEN
INSERT (PersonURN, AddressURN, ProfileMatchCode)VALUES (sourc.PersonURN, sourc.AddressURN, sourc.MatchCode)
WHEN NOT MATCHED BY SOURCE AN
Cana you I need to do an update from a select statement...i'm really close here but have not quite figured out the nuance...
the full select statement provides correct results and i've joined the outer table with the inside table....can you make recommendations?
BEGIN TRAN --rollback
SET UPDT_OPR_ID = (select dm.CONFIRM_BY
FROM geprs_price..T_ITEM_PRC_CHG gep
JOIN SMS_DATAMART.dbo.T_PRC dm
ON dm.PRC_EFF_DT = gep.PRC_EFF_DT
AND gep.SG_CNTRC_BID_PRC = dm.PRC
and gep.prc_eff_dt = dm.prc_eff_dt
LEFT JOIN construct..T_AD_USERS con
ON dm.CONFIRM_BY = con.UID
LEFT JOIN construct..T_AD_USERS crt
ON dm.CREATE_BY = crt.UID
WHERE gep.sg_CNTRC_BID_PRC >0
AND gep.UPDT_OPR_ID <>dm.CONFIRM_BY
AND dm.PRC_TYP_ID in (39)
AND con.DISPLAYNAME IS NOT NULL)
I have a sql datasource with the ControlParameter called ddlDropDownList.
1. Is my syntax below ok, I am getting a runttime error that the syntax is incorrect.
2. I have the select statement set up the control parameter to get the selected value from the dropdownlist as shown below, is that syntax correct? especially the "selectedItem.value" for the propertyname property. thx
select fieldOne, fieldTwo from someTable where fieldOne IN
CASE WHEN @ddlDropDownList='valueABC' THEN ('ABC') WHEN @ddlDropDownList='valueDEF' THEN ('DEF')
ELSE ('ABC','DEF') END
<asp:ControlParameter ControlID="ddlDropDownList" Name="typeSlctd" PropertyName="SelectedItem.Value" Type="String" />
I need to do an IF THEN depending on the query result. If I use the SQLDataSource control...How do I declare and pass a variable for my IF THEN? Or should I use ADO? If so, how does it declare and pass variable in ADO?
Looking for a sample sql statement to query a db table that boolean data.
Here is the scenario...
Records are lodging businesses with fields for each of the amenities. Example of fields below.
After db is complete users will need to be able to query the db by checking checkboxes of the amenities they desire, click search, and have only those businesess appear with relavent amenities.
What might the a sameple sql statement look like for this? FYI... at this time unknown how many amenities fields there might be and may need to add new amenities at any time.
Select * From TableName Where.....
I have two table a and b and query like this
(Select min(b.x) from b...=a.... group by)
from a , b
where a... = b....
So it is using correlated query in select statement and it is very slow , what can I do increase the query performace
Can anyone provide some help tips on SQL query select statement.
Store procedure expect parameter for partition
01 1 value1
02 1 value2
03 2 value3
04 2 &n
i have two tables named
1.LookupPageInfo and (LookupPageInfoId,pathmessageID,pagemessageID)
Now i need to write a query something like this........in the query i need to pass the pathmessageid and needs to get messagetext from Messages Table,i am not sure how i need to write the below query..can someone guide me how can i write a query......as below..
(select messagetext from Messages where MessageID=PathmessageId) as TEXT
I usually work with windows forms, and am just starting to work with ASP.Net, so appologies if this is a dumb question!
I have a master page which has a search button on it. The results of this are built up using a Linq statement and if there are any results, I want to display the results in a contents page.
On the masterpage, I have the following code:
Public Overridable ReadOnly Property SearchRes()
Private Sub DoSearch()
'some code to get a linq result
If res.Any Then
_res = res
LabelNoRes.Visible = True
On the SearchResults.aspx page I have this code.
Dim m As pxSite = CType(Page.Master, MasterPage)
If m.SearchRes IsNot Nothing Then
Label1.Text = "Results found = " & m.SearchRes.Count
m.searchRes is always nothing.
What am I doing wrong here?
I'm going crazy... i've got a piece of code that don't update the database... Could somebody tel me why it doesn't run??