|
Tell us exactly what the error says
|
|
|
|
|
Hi,
I am getting the following error when I am trying to run a SQL Query with larger Data, any help how can I run the select statement.
SELECT
CASE WHEN PTT.POSTransactionTypeCode = 'A' THEN 'A'
WHEN PTT.POSTransactionTypeCode = 'C' THEN 'C'
WHEN PTT.POSTransactionTypeCode = 'R' THEN 'R'
WHEN PTT.POSTransactionTypeCode = 'I' THEN 'C'
END AS TransactionType,
CASE WHEN PTT.POSTransactionTypeCode = 'A' THEN 'A'
WHEN PTT.POSTransactionTypeCode = 'C' THEN 'A'
WHEN PTT.POSTransactionTypeCode = 'R' THEN 'A'
WHEN PTT.POSTransactionTypeCode = 'I' THEN 'I'
END AS ProviderStatus,
-- right format. uncomment when the PIN numbers are fixed.
'00000' + C.ProviderNbr + SPACE(1) AS ContractNbr,
-- right format. uncomment when sending the provider numbers that were added wrongly.
--'000000' + C.ContractNbr AS ContractNbr,
'01' AS Other,
'000000' AS PIN,
UPPER(LEFT(C.ProviderName, 28)) AS ContractName,
'PROGRAM DIRECTOR' + SPACE(8) AS ContractAddressAttention,
UPPER(LEFT(A.StreetAddress1, 24)) AS Address1,
UPPER(LEFT(A.StreetAddress2, 24)) AS Address2,
UPPER(LEFT(A.City, 17)) AS City,
UPPER(S.PK_Geographic_Location_Code) AS State,
LEFT(A.Zip1, 9) AS ZipCd,
SPACE(12) AS ErrorCode2,
SPACE(8) AS Filler
FROM
POSPINTransaction AS E INNER JOIN
Provider AS C ON E.FKProviderId = C.PKProviderId INNER JOIN
ProviderDate AS PD ON dbo.Udf_GetPKProviderDate(C.PKProviderId) = PD.PKContractDate INNER JOIN
ProviderAddress AS PA ON PA.FKProviderId=C.PKProviderId INNER JOIN
[Address] AS A ON A.PKAddressId = PA.FKAddressId INNER JOIN
--ParentTypeLKP AS PT ON A.FKParentType = PT.PKParentType AND PT.ParentTypeCd = 'usrContract' INNER JOIN
[State] AS S ON A.FK_State = S.PKStateId INNER JOIN
POSTransactionTypeLKP PTT ON E.FKPOSTransactionTypeId=PTT.PKPOSTransactionTypeId
WHERE
(PA.IsCurrentAddress = 1) AND (E.TransactionSentDate IS NULL) AND (E.TransactionReceivedDate IS NULL) AND (E.FKPOSTransactionTypeId IN (SELECT PKPOSTransactionTypeId FROM POSTransactionTypeLKP WHERE POSTransactionTypeCode IN ('A', 'C', 'R'))) OR
(PA.IsCurrentAddress = 1) AND (E.TransactionSentDate IS NULL) AND (E.TransactionReceivedDate IS NULL) AND (E.FKPOSTransactionTypeId = (SELECT Top 1 PKPOSTransactionTypeId FROM POSTransactionTypeLKP WHERE POSTransactionTypeCode = 'I')) AND (PD.EffectiveDateTo IS NULL) OR
(PA.IsCurrentAddress = 1) AND (E.TransactionSentDate IS NULL) AND (E.TransactionReceivedDate IS NULL) AND (PD.EffectiveDateTo <= GETDATE())
UNION
SELECT
CASE WHEN PTT.POSTransactionTypeCode = 'A' THEN 'A'
WHEN PTT.POSTransactionTypeCode = 'C' THEN 'C'
WHEN PTT.POSTransactionTypeCode = 'R' THEN 'R'
WHEN PTT.POSTransactionTypeCode= 'I' THEN 'C'
END AS TransactionType,
CASE WHEN PTT.POSTransactionTypeCode = 'A' THEN 'A'
WHEN PTT.POSTransactionTypeCode = 'C' THEN 'A'
WHEN PTT.POSTransactionTypeCode = 'R' THEN 'A'
WHEN PTT.POSTransactionTypeCode = 'I' THEN 'I'
END AS ProviderStatus, SP.NPINumber AS ContractNbr,
'01' AS Other,
'000000' AS PIN,
UPPER(LEFT(SP.FirstName, 28)) AS ContractName,
'PROGRAM DIRECTOR' + SPACE(8) AS ContractAddressAttention,
UPPER(LEFT(ADDR.StreetAddress1, 24)) AS Address1,
UPPER(LEFT(ADDR.StreetAddress2, 24)) AS Address2,
UPPER(LEFT(ADDR.City, 17)) AS City,
UPPER(ST.PK_Geographic_Location_Code) AS State,
LEFT(ADDR.Zip1, 9) AS ZipCd,
SPACE(12) AS ErrorCode2,
SPACE(8) AS Filler
FROM
POSPINTransaction AS EDS INNER JOIN
NPIAssociation NA ON NA.FKParentId=EDS.FKProviderId AND NA.FKParentTypeLKPId = (SELECT Min(PKParentTypeLKPId) FROM ParentTypeLKP WHERE ParentCode='PRV') INNER JOIN
NPI AS SP ON SP.PKNPIId = NA.FKNPIId LEFT OUTER JOIN
POSTransactionError AS EDSERR ON EDSERR.FKPOSPINTransactionId = EDS.PKPOSPINTransactionId LEFT OUTER JOIN
POSTransactionErrorLKP AS EDSERRCD ON EDSERRCD.PKPOSTransactionErrorLKPId = EDSERR.FKPOSTransactionErrorLKPId LEFT OUTER JOIN
NPIAddress AS NPIADDR ON NPIADDR.FKNPIId = SP.PKNPIId AND NPIADDR.IsCurrentAddress = 1 INNER JOIN
[Address] AS ADDR ON ADDR.PKAddressId=NPIADDR.FKAddressId INNER JOIN
[State] AS ST ON ADDR.FK_State = ST.PKStateId INNER JOIN
County AS CO ON CO.PKCountyId = ADDR.FK_County INNER JOIN
POSTransactionTypeLKP PTT ON EDS.FKPOSTransactionTypeId=PTT.PKPOSTransactionTypeId
WHERE
(EDS.TransactionSentDate IS NULL) AND (EDS.TransactionReceivedDate IS NULL) AND
(EDS.FKPOSTransactionTypeId IN (SELECT PKPOSTransactionTypeId FROM POSTransactionTypeLKP WHERE POSTransactionTypeCode IN ('A', 'C', 'R'))
OR EDS.FKPOSTransactionTypeId = (SELECT Top 1 PKPOSTransactionTypeId FROM POSTransactionTypeLKP WHERE POSTransactionTypeCode = 'I'))
Let me know if I can refine the script or any other advice is also welcome please thanks in advance friends.
|
|
|
|
|
System.OutOfMemoryException just means that the code is using too much space. The only way to fix it is to reduce the amount of data that you are trying to process in one go.
|
|
|
|
|
You need to cut back how many records and or fields you are returning.
Everyone is born right handed. Only the strongest overcome it.
Fight for left-handed rights and hand equality.
|
|
|
|
|
Hi,
I have couple of larger tables in my Database, but when I am trying to generate script for data of those tables using SSMS Wizard, I getting red sign and its failing, any help how can I generate data for the larger tables using Generate Script or some other option? thanks in advance my friends.
|
|
|
|
|
I'm not sure what you want us to tell you. You'd have to share what the error message is.
Everyone is born right handed. Only the strongest overcome it.
Fight for left-handed rights and hand equality.
|
|
|
|
|
When attaching the database file to SQL Server 2005 exports the below error message, I want to remove this message, what to do ?
TITLE: Locate Database Files - MICROSOFT
D:\abc\WebSite\ASP_NET\TTGS\TTGS\App_Data
Cannot access the specified path or file on the server. Verify that you have the necessary security privileges and that the path or file exists.
If you know that the service account can access a specific file, type in the full path for the file in the File Name control in the Locate dialog box.
BUTTONS:
OK
modified 30-Nov-18 4:54am.
|
|
|
|
|
The message is clearly telling you that it cannot access that path name, or that you do not have the appropriate privilege. Check the address is correct and that you are allowed to access it.
|
|
|
|
|
I am confused. If you want the message to go away then fix what it is telling you. What did you want us to do?
Everyone is born right handed. Only the strongest overcome it.
Fight for left-handed rights and hand equality.
|
|
|
|
|
|
Many of us will not be able to follow those links from work computers - I know I can't.
Have you discussed this with your tutor? Surely it is not being returned with no comments at all, or indication of what is wrong.
|
|
|
|
|
Gotcha, sorry about the links! I’ve gotten a tutor, but they’re very spotty at responding and often have busy schedules.
Just looking for some outside help
|
|
|
|
|
If the primary key is always an autokey, we would not have to ask what identifies anything. We'd just have a hidden autonumber in every table, automatically.
Why can a vendor only have 1 "QtyArriving"?
This is why I like the database-normalization-steps; they provide you with an argumentation for every field and gives you the ammo to say "this is how it SHOULD be, and here is WHY".
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
"If you just follow the bacon Eddy, wherever it leads you, then you won't have to think about politics." -- Some Bell.
|
|
|
|
|
Reaching out to the community to pressure test our internal thinking.
We are building a simplified business intelligence platform that will aggregate metrics (i.e. traffic, backlinks) and text list (i.e search keywords, used technologies) from several data providers.
The data will be somewhat loosely structured and may change over time with vendors potentially changing their response formats.
Data volume may be long term 100,000 rows x 25 input vectors.
Data would be updated and read continuously but not at massive concurrent volume.
We'd expect to need to do some ETL transformations on the gathered data from partners along the way to the UI (e.g show trending information over the past five captured data points).
We'd want to archive every single data snapshot (i.e. version it) vs just storing the most current data point.
The persistence technology should be readily available through AWS.
Our assumption is our requirements lend themselves best towards DynamoDB (vs Amazon Neptune or Redshift or Aurora).
Is that fair to assume? Are there any other questions / information I can provide to elicit input from this community?
|
|
|
|
|
Member 14070096 wrote: Is that fair to assume No, it is an assumption. Fair would be to evaluate them on their merits, and award points for each merit. My guess is that any NoSQL database would do.
Member 14070096 wrote:
The data will be somewhat loosely structured and may change over time with vendors potentially changing their response formats. That's wrong; your format should depend on the data that you want to collect, not on the format of various datasources.
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
"If you just follow the bacon Eddy, wherever it leads you, then you won't have to think about politics." -- Some Bell.
|
|
|
|
|
Why a NoSQL database, I would have thought that a relational DB would serve the purpose better.
Never underestimate the power of human stupidity -
RAH
I'm old. I know stuff - JSOP
|
|
|
|
|
Mycroft Holmes wrote: Why a NoSQL database Good question; his example of Dynamo is, but..
Mycroft Holmes wrote: I would have thought that a relational DB would serve the purpose better. ..is probably true
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
"If you just follow the bacon Eddy, wherever it leads you, then you won't have to think about politics." -- Some Bell.
|
|
|
|
|
You will HAVE to have an ETL layer between your various sources and your database (assuming it is a relational DB). You need to get all your sources into a single format and deal with changing source structures which will need recoding the ETL to suit.
Never underestimate the power of human stupidity -
RAH
I'm old. I know stuff - JSOP
|
|
|
|
|
Hi
I wish to only begin a select statement if the top value date is found - this the first of the month. It's my way of knowing data has been added into a system at the beginning of the month e.g max date is 01/11/2018. If not take the last day of the previous month 31/10/2018. Table is called sales. Column is called SaleDateFrom.
I want to pull e.g data from SaleDateFrom <=01/11/2018...if not pull data
SaleDateFrom <=31/10/2018
statement to change
where (SaleDateFrom<= '20181101'
and (SaleDateTo '20010101' or
SaleDateTo is null))
Any ideas team?
|
|
|
|
|
|
hi
I don't know whats happened sorry...I tried so hard to edit the previous post, and it would not let me, so I signed out , went to log in it said denied, asked for reset I think it has issues if you login with facebook as uses same email. please help
|
|
|
|
|
If you have problems with your account then you should use the Bugs and Suggestions[^] forum to get assistance from the administrators. I suggest you do so now from your original account, and delete this one.
|
|
|
|
|
Not only is this a repost of the question below, you haven't responded to any of the questions asked in response to that post.
2018-10-31 is less than 2018-11-01 ; therefore, if there are no records with SaleDateFrom <= '20181101' , there will be no records with SaleDateFrom <= '20181031' .
You need to explain what you're actually trying to achieve.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
I'm doing my best to explain ,
here is my where clause
where (SaleDateFrom<= '20181101'
and (SaleDateTo '20010101' or
SaleDateTo is null))
I want to replace the date in bold to 20181031 if the highest date entered into the data base is not the 20181101. this is to make sure the data for the start of the month has been entered
please help
please see response to Richard - about account big issue, which I be contacting code project about
|
|
|
|
|
And once again: If there are no records where the SaleDateFrom is on or before 1st November, then there will be no records where SaleDateFrom is on or before 31st October.
If there is a record for 31st October, then that will already be included in your current query.
If there are no records on or before 1st November, then changing your query to look for records with an earlier date isn't going to make any difference.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|