Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 123515
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T04:17:56+00:00 2026-05-11T04:17:56+00:00

I’ve got some SQL which performs complex logic on combinations of GL account numbers

  • 0

I’ve got some SQL which performs complex logic on combinations of GL account numbers and cost centers like this:

WHEN (@IntGLAcct In (     882001, 882025, 83000154, 83000155, 83000120, 83000130,      83000140, 83000157, 83000010, 83000159, 83000160, 83000161, 83000162, 83000011, 83000166, 83000168, 83000169, 82504000,  82504003, 82504005, 82504008, 82504029, 82530003, 82530004, 83000000, 83000100, 83000101, 83000102, 83000103, 83000104,  83000105, 83000106, 83000107, 83000108, 83000109, 83000110,  83000111, 83000112, 83000113, 83100005, 83100010, 83100015,  82518001, 82552004, 884424,   82550072, 82552000, 82552001,  82552002, 82552003, 82552005, 82552012, 82552015, 884433,    884450,   884501,   82504025, 82508010, 82508011, 82508012, 83016003, 82552014, 81000021, 80002222, 82506001, 82506005,  82532001, 82550000, 82500009, 82532000)) 

Overall, the whole thing is poorly performing in a UDF, especially when it’s all nested and the order of the steps is important etc. I can’t make it table-driven just yet, because the business logic is so terribly convoluted.

So I’m doing a little exploratory work in moving it into SSIS to see about doing it in a little bit of a different way. Inside my script task, however, I’ve got to use VB.NET, so I’m looking for an alternative to this:

Select Case IntGLAcct = 882001 OR IntGLAcct = 882025 OR ... 

Which is obviously a lot more verbose, and would make it terribly hard to port the process.

Even something like ({90605, 90607, 90610} AS List(Of Integer)).Contains(IntGLAcct) would be easier to port, but I can’t get the initializer to give me an anonymous array like that. And there are so many of these little collections, I’m not sure I can create them all in advance.

It really all NEEDS to be in one place. The business changes this logic regularly. My strategy was to use the udf to mirror their old ‘include’ file, but performance has been poor. Now each of the functions takes just 2 or three parameters. It turns out that in a dark corner of the existing system they actually build a multi-million row table of all these results – even though the pre-calced table is not used much.

So my new experiment is to (since I’m still building the massive cross join table to reconcile that part of the process) go ahead and use the table instead of the code, but go ahead and populate this table during an SSIS phase instead of calling the udf 12 million times – because my udf version just basically stopped working within a reasonable time frame and the DBAs are not of much help right now. Yet, I know that SSIS can process these rows pretty efficiently – because each month I bring in the known good results dozens of multi-million row tables from the legacy system in minutes AND run queries to reconcile that there are no differences with the new versions.

The SSIS code would theoretically become the keeper of the business logic, and the efficient table would be built from that (based on all known parameter combinations). Of course, if I can simplify the logic down to a real logic table, that would be the ultimate design – but that’s not really foreseeable at this point.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-11T04:17:56+00:00Added an answer on May 11, 2026 at 4:17 am

    Try this:

    Array.IndexOf(New Integer() {90605, 90607, 90610}, IntGLAcct) >-1 
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 89k
  • Answers 89k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer What he means is to map your data to the… May 11, 2026 at 5:51 pm
  • Editorial Team
    Editorial Team added an answer This is the way C and C++ express NOP. May 11, 2026 at 5:51 pm
  • Editorial Team
    Editorial Team added an answer Something like this: onclick="setTimeout(function() { updateLayer('text', 'ff', 'ok'); } ),1250);" May 11, 2026 at 5:51 pm

Related Questions

I ran into a problem. Wrote the following code snippet: teksti = teksti.Trim() teksti
I am currently running into a problem where an element is coming back from
Seemingly simple, but I cannot find anything relevant on the web. What is the
Configuring TinyMCE to allow for tags, based on a customer requirement. My config is
Is it possible to replace javascript w/ HTML if JavaScript is not enabled on

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.