I do believe that I found a way to do this without using cursors by creating a temp table, then using cross apply to broaden the temp table and then doing a cross apply against the transaction table with the temp table. If anybody is interested I can post what I ended up with.
wb
I am building a system where users can customize queries to pull data out of a transaction history table. The parameters are stored in a temporal table so we can easily track changes
CREATE TABLE [dbo].[RedFlagsLimits](
[Id] [int] IDENTITY(1,1) NOT NULL,
[CreatedBy] [int] NOT NULL...
I am trying to find instances where there are 3 or more consecutive check numbers for a given account. For instance, if I have:
Account CheckNumber Amount
001234 34546 500
001234 34547 1100
001234 34890 6
001234 35000 1000
001234 35001 1500
001234 35002...
I have two servers, both running SQL Server 2016 and I need to copy ~12 tables from one server to another, transform (link to a table on destination server and change businessid) and then load into the same server name on new server. My question is: Can I do this in one statement(pull data from...
I have a process that does a bulk import where I build a field value given incoming values. Sometimes, ALL of the incoming values are the same, but they are not duplicates. Since this is a bulk import, I don't know of any way to really check if the field value I have built is being built the...
Hello All!
I am working on getting the Failed_Database_Authentication_Group and Successful_Database_Authentication_Group specifications to work, but my changes do not seem to be taking.
I disable the audit and the database audit specification, I modify the database audit specification...
Sorry, the data is not that clean. Not strictly. What I have is a table with Core data and a table with detail data. I am matching detail to core so that I can move to history. However, there are a few issues that come in to play, one of them being that I may have 3 transactions in the core for...
If I have this data
ID Acct Date Amount TranCode ID Acct Date Amount TranCodeType
5 123 7/5/2017 10000 18 76 123 7/5/2017 10000 12
6 123 7/5/2017 10000 18 77 123 7/5/2017 10000 12
7 123 7/5/2017 10000 18 78 123 7/5/2017 10000 12
between two tables (with ID being the first field in each...
I am writing a stored procedure that will insert an order and then assign N serial numbers to that order id and I am wondering if you kind folk can give me any insight into which approach would be better practice (or if I am missing a third option?).
The options that I have come up with are...
Wondering if it is better practice to use OUTPUT variables (and am I using them right) to return some values to the calling code
CREATE PROCEDURE [dbo].[InsertOrUpdateFormPageData]
@FormPageDataId int null,
@FormPageId int,
@CreatedBy int null,
@PostedJSONData nvarchar(max),
@UpdatedBy...
I have a relationship table which I only want to allow certain entities to enter a record. And those entities could exist in one several places/tables. I have a view that aggregates all of them, but you cannot reference a view in a constraint. So, I was thinking UDF, but now I see that is often...
OK, let's say that I have a table with 5 columns: ID, Name, ProviderId, Date, Amount
Now, let's say that I fill in 4 of the fields and the client has to fill in the fifth field (in this case, ProviderId)
Is there a nice way to ONLY select the Name (they will be grouped by name and date) for...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.