SSIS Creating a DT_DBTIMESTAMP project parameter - sql-server

I have a SSIS project that back in December start failing validation on an expression to create DT_DBTIMESTAMP. This expression hasn't changed since 2018 that I can tell, the SQL server was upgraded not sure if the timing correlates or not. The error is "The expression for variable "EndDate" failed evaluation. There was an error in the expression"
#[$Project::UseOverrideDate]? (DT_DBTIMESTAMP)((DT_WSTR, 4)#[$Project::Year] + "-" + (DT_WSTR, 2)(#[$Project::Month] + 1) + "-" + "01") : DATEADD( "dd", -(DATEPART( "dd",GETDATE() ) -1), (DT_DBDATE) GETDATE())
The UseOverrideDate is a bool so we can manually set a month and year in parameters (Month, Year)
The package is developed in VS2012 and evaluates out successful in the dev studio and under the debugger; do any of you see anything that might cause the error. The SSIS package completes its task with the expected results so I am wondering what the error is being thrown for.
Thanks in advance for any insight you may provide.

After more rooting around abit more with no success I deleted the package out of the SSISDB and re-deployed it back in by way of the command line; the problem went away. Not sure what the deployment process wasn't doing but this 2.5 day excercise of chasing down something that works elsewere is over, Thank you for everyones time.

It works for me so I think we're missing some pieces here
I defined the following project parameters
and created a package variable with the above expression
If I flip the project parameter to True, I see the EndDate change to 4/1/2021
The comment indicates that the problem only surfaces when executed outside of Visual Studio. The results here are the same as I experience when I deploy to the SSISDB but are easier for me to show without screenshots.
I added a trivial script task to echo my variables to the output window. I built the ispac and then ran it two times to catch both cases.
Execute the project and package setting my UseOverrideDate to False
C:\Users\bfellows\source\repos\SO_Trash\SO_Trash\bin\Development>dtexec /proj SO_Trash.ispac /pack SO_66772141.dtsx /set \Package.Variables[$Project::UseOverrideDate];False /rep V
Microsoft (R) SQL Server Execute Package Utility
Version 14.0.3370.1 for 32-bit
Copyright (C) 2017 Microsoft. All rights reserved.
Started: 12:17:49 PM
Info: 2021-03-24 12:17:49.97
Code: 0x00000000
Source: SCR Echo Back SCR Echo Back
Description: User::EndDate : 3/1/2021 12:00:00 AM
End Info
DTExec: The package execution returned DTSER_SUCCESS (0).
Started: 12:17:49 PM
Finished: 12:17:49 PM
Elapsed: 0.266 seconds
Flip the UseOverride To True
C:\Users\bfellows\source\repos\SO_Trash\SO_Trash\bin\Development>dtexec /proj SO_Trash.ispac /pack SO_66772141.dtsx /set \Package.Variables[$Project::UseOverrideDate];True /rep V
Microsoft (R) SQL Server Execute Package Utility
Version 14.0.3370.1 for 32-bit
Copyright (C) 2017 Microsoft. All rights reserved.
Started: 12:17:56 PM
Info: 2021-03-24 12:17:56.93
Code: 0x00000000
Source: SCR Echo Back SCR Echo Back
Description: User::EndDate : 4/1/2021 12:00:00 AM
End Info
DTExec: The package execution returned DTSER_SUCCESS (0).
Started: 12:17:56 PM
Finished: 12:17:56 PM
Elapsed: 0.25 seconds
I ran dtexec with a /REP /v to turn on verbose logging. As you can see, my variable value changes as expected and no error is generated.
Given that you've resolved the issue by deleting and recreating from scratch, it would seem that something in the deployment/"the SQL server was upgraded" was in play here but not enough data to diagnose root cause.

Related

Oracle Database: plshprof procudes incomplete HTML for DBMS_HPROF-Profiler trace file

Moin,
I used the Oracle-Profiler from the DBMS_HPROF package a lot to find out where the right queries to optimize.
This time I ran into a problem, even though it seems to be setup correctly.
Profiling even complex parts of the application I try to optimize produce trace files that are processed without any issues by the plshprof tool that produces the HTML reports from the trace files.
When I profile this one particular procedure it produces a trace file that seems ok (it is properly ended and so).
But when I use plshprof on it, out comes always an HTML file that ends after 12542 Bytes (no, the drive is not full).
I tried executing an additional query before the problematic procedure and the result was that the HTML ended again after exactly 12542 Bytes.
In one case the HTML ended in the middle of an attribute of a tag in the other before the > of the ending tag.
From the beginning to the EOF the HTML report looks ok!
Windows Server 2019 Build 1809
Oracle Database Version: 19c (19.3) Standard Edition 2
This is how I called the profiler and the procedure:
BEGIN
DBMS_HPROF.START_PROFILING(LOCATION=>'PLSHPROF_DIR', FILENAME=> 'test1.trc');
SOME_PACKAGE.SOME_PROCEDURE();
COMMIT;
DBMS_HPROF.STOP_PROFILING;
END;
/
This how I called it:
C:\TEMP>plshprof test1.trc
PLSHPROF: Release 19.0.0.0.0 - Production on Do Mrz 24 12:04:00 2022
Version 19.3.0.0.0
Copyright (c) 1982, 2019, Oracle and/or its affiliates. All rights reserved.
[160 symbols processed]
C:\TEMP>echo %ERRORLEVEL%
-1073741819
C:\TEMP>plshprof
PLSHPROF: Release 19.0.0.0.0 - Production on Fr Mrz 25 11:56:20 2022
Version 19.3.0.0.0
Copyright (c) 1982, 2019, Oracle and/or its affiliates. All rights reserved.
Usage: plshprof [<option>...] <tracefile1> [<tracefile2>]
Options:
-trace <symbol> (no default) specify function name of tree root
-skip <count> (default=0) skip first <count> invokations
-collect <count> (default=1) collect info for <count> invokations
-output <filename> (default=<symbol>.html or <tracefile1>.html)
-summary print time only
C:\TEMP>
As you can see last line of the output is missing and there is an error code but there is no error message nor any switch to verbose the output of the tool.
C:\TEMP>plshprof test2.trc
PLSHPROF: Release 19.0.0.0.0 - Production on Do Mrz 24 12:41:17 2022
Version 19.3.0.0.0
Copyright (c) 1982, 2019, Oracle and/or its affiliates. All rights reserved.
[12 symbols processed]
[Report written to 'test2.html']
C:\TEMP>echo %ERRORLEVEL%
0
The trace file seems to end properly:
P#C SQL."SCHEMANAME"."SOME_PACKAGE"::11."__static_sql_exec_line133" #133."8ggw94h7mvxd7"
P#! COMMIT
P#X 79
P#R
P#X 17
P#R
P#C SQL."".""."__static_sql_exec_line8" #8."8ggw94h7mvxd7"
P#! COMMIT
P#X 160
P#R
P#C PLSQL."SYS"."DBMS_HPROF"::11."STOP_PROFILING"#980980e97e42f8ec #747
P#R
P#! PL/SQL Timer Stopped
Did anybody ever ran into this problem and/or found out what is/was the problem?
I can imagine it has to do with the complexity of the function tree called but I am not able to figure out where to start.
The procedure uses several packages and reads and writes from and to tables and views with triggers which also call functions that do the same.
Thanks in advance!

Jenkins - OpenCover batch command cant find pdb files

I am trying to follow these instructions for my system and am as far as step 8 (unit tests & coverage).
When I execute this command on the server it works succesfully:
"C:\Program Files (x86)\OpenCover\OpenCover.Console.exe" -register:user -target:"C:\Program Files (x86)\NUnit.org\nunit-console\nunit3-console.exe" -targetargs:"C:\workspace\Extensions\Extensions\ExtensionTests\bin\Debug\ExtensionsTests.dll -result=TestResult.xml;format=nunit2" -filter:+
If I add it as a Jenkins Batch command step I get:
"C:\Program Files (x86)\OpenCover\OpenCover.Console.exe" -register:user -target:"C:\Program Files (x86)\NUnit.org\nunit-console\nunit3-console.exe" -targetargs:"C:\workspace\Extensions\Extensions\ExtensionTests\bin\Debug\ExtensionsTests.dll -result=TestResult.xml;format=nunit2" -filter:+
Executing: C:\Program Files (x86)\NUnit.org\nunit-console\nunit3-console.exe
NUnit Console Runner 3.8.0
Copyright (c) 2018 Charlie Poole, Rob Prouse
Runtime Environment
OS Version: Microsoft Windows NT 6.3.9600.0
CLR Version: 4.0.30319.42000
Test Files
C:\workspace\Extensions\Extensions\ExtensionTests\bin\Debug\ExtensionsTests.dll
Run Settings
DisposeRunners: True
WorkDirectory: c:\workspace\Extensions
ImageRuntimeVersion: 4.0.30319
ImageTargetFrameworkName: .NETFramework,Version=v4.6.1
ImageRequiresX86: False
ImageRequiresDefaultAppDomainAssemblyResolver: False
NumberOfTestWorkers: 2
Test Run Summary
Overall result: Passed
Test Count: 37, Passed: 37, Failed: 0, Warnings: 0, Inconclusive: 0, Skipped: 0
Start time: 2018-02-23 10:40:58Z
End time: 2018-02-23 10:40:59Z
Duration: 1.106 seconds
Results (nunit2) saved as TestResult.xml
Committing...
No results, this could be for a number of reasons. The most common reasons are:
1) missing PDBs for the assemblies that match the filter please review the
output file and refer to the Usage guide (Usage.rtf) about filters.
2) the profiler may not be registered correctly, please refer to the Usage
guide and the -register switch.
I have tried setting the Jenkins to run under my ID and allowed it to interact with the desktop.
Can someone point me in the right direction to get it running please?
Ahh so I found the answer from this question, I just needed to move a quote to give:
"C:\Program Files (x86)\OpenCover\OpenCover.Console.exe" -register:user -target:"C:\Program Files (x86)\NUnit.org\nunit-console\nunit3-console.exe" -"targetargs:C:\workspace\Extensions\Extensions\ExtensionTests\bin\Debug\ExtensionsTests.dll -result=TestResult.xml;format=nunit2" -filter:+
Which works!

Sonar Runner : Unable to extract version of Microsoft Compiler

While trying to run sonar-runner on a 32 bit C++/MFC solution I got the error:
Sonar Runner : Unable to extract version of Microsoft Compiler
Here is the output:
11:56:44.856 INFO - 18645 files indexed
11:57:02.381 INFO - Quality profile for c: Sonar way
11:57:02.381 INFO - Quality profile for cpp: Sonar way
11:57:02.540 INFO - cpp EVALUATION [Expiration: 2015-10-13, Server: *]
11:57:02.540 INFO - Sensor Lines Sensor
11:57:02.747 INFO - Sensor Lines Sensor (done) | time=207ms
11:57:02.747 INFO - Sensor QProfileSensor
11:57:02.749 INFO - Sensor QProfileSensor (done) | time=2ms
11:57:02.750 INFO - Sensor InitialOpenIssuesSensor
11:57:02.754 INFO - Sensor InitialOpenIssuesSensor (done) | time=4ms
11:57:02.755 INFO - Sensor ProjectLinksSensor
11:57:02.759 INFO - Sensor ProjectLinksSensor (done) | time=4ms
11:57:02.759 INFO - Sensor VersionEventsSensor
11:57:02.764 INFO - Sensor VersionEventsSensor (done) | time=5ms
11:57:02.764 INFO - Sensor SquidSensorC
11:57:02.766 INFO - C/C++ Preprocessor in silent mode. Relaunch the analysis wi
th "sonar.verbose=true" to see issues encountered by the preprocessor.
11:57:03.214 INFO - Using build-wrapper output: E:\dev\ProjectDir\build
-wrapper-out\build-wrapper-dump.json
INFO: ------------------------------------------------------------------------
INFO: EXECUTION FAILURE
INFO: ------------------------------------------------------------------------
Total time: 28.126s
Final Memory: 17M/200M
INFO: ------------------------------------------------------------------------
ERROR: Error during Sonar runner execution
ERROR: Unable to execute Sonar
ERROR: Caused by: Unable to extract version of Microsoft Compiler
Environment:
Windows 7 64 bit
sonarqube-5.1.2
sonar-runner-dist-2.4
build-wrapper-3.6
sonar-cpp-plugin-3.6
Java 1.8 32 bit
Any ideas what might cause this issue?
The build-wrapper produces a file with the name 'build-wrapper-dump.json'. If you open this file you'll see that at the top there is a section called 'captures'. It looks probably like this:
"captures":[
{
"compiler":"msvc-cl",
"executable":"C:\\Program Files (x86)\\Microsoft Visual Studio 12.0\\VC\\bin\\x86_amd64\\CL.exe",
"stdout":"",
"stderr":""
}
While it should look like this:
"captures":[
{
"compiler":"msvc-cl",
"executable":"C:\\Program Files (x86)\\Microsoft Visual Studio 12.0\\VC\\bin\\x86_amd64\\CL.exe",
"stdout":"usage: cl [ option... ] filename... [ \/link linkoption... ]\r\n",
"stderr":"Microsoft (R) C\/C++ Optimizing Compiler Version 18.00.40629 for x64\r\nCopyright (C) Microsoft Corporation. All rights reserved.\r\n\r\n"
}
To get the missing values you need to execute the build-wrapper from the Visual Studio Command prompt. This command prompt sets some extra environment variables. Hope this helps.

pro*C keyword "Execute" not recognized

I am using HP-UX aCC compiler [HP C/aC++ B3910B A.06.26] to compile an old C/Pro*C application (already compiled with an older version of aCC compiler).
The compilation is always failing with the below error
Pro*C/C++: Release 10.2.0.4.0 - Production on Sun Apr 28 12:01:34 2013
Copyright (c) 1982, 2007, Oracle. All rights reserved.
System default option values taken from: /data/oracle/product/10.2.0/db_1//precomp/admin/pcscfg.cfg
PCC-I-02106, Userid only used when SQLCHECK = FULL, userid ignored.
Semantic error at line 252, column 9, file ToolDb.pcpp:
EXECUTE
........1
PCC-S-02345, SQLCHECK=SEMANTICS must be given when embedded PL/SQL blocks are us
ed
gmake: *** [ToolDb.c] Error 1
As I understood, the compiler cannot recognize the proc *C keyword "EXECUTE" used to call a database stored procedure!
Any idea please that can help tp solve this issue?
Thank you very much in advance.
Regards
Add SQLCHECK=SEMANTICS to your Proc execute command
It is not something like Pro*C compiler is not identifying the EXECUTE command. Whenever there is error in PL/SQL block first word is displayed.
There might be some issue inside the PL/SQL.
It would be helpful if we can have the PL/SQL block.

Pass Value/Variable to Dtsx /SET \Package.Variables[User::NameVariable];"value" ERROR

I want pass a value to ssis package, but i have an error back
I execute with batch, the command
dtexec /F "c:\MyPackage.dtsx" /SET \Package.Variables[User::Valore].Properties[Value];2
This is the error (warning) :
C:>dtexec /F "c:\AnagraficaTOC.dtsx" /SET \Package.Variables[User::Valore].Prop
erties[Value];2
Microsoft (R) SQL Server Execute Package Utility
Version 10.50.2500.0 for 64-bit
Copyright (C) Microsoft Corporation 2010. All rights reserved.
Started: 11:30:10
Warning: 2011-11-12 11:30:10.95
Code: 0x80012017
Source: AnagraficaTOC
Description: The package path referenced an object that cannot be found: "\Pa
ckage.Variables[User::Valore].Properties[Value]". This occurs when an attempt is
made to resolve a package path to an object that cannot be found.
End Warning
DTExec: Could not set \Package.Variables[User::Valore].Properties[Value] value t
o 2.
Started: 11:30:10
Finished: 11:30:10
Elapsed: 0.203 seconds
What does this mean? The syntax looks right to me, I checked on many sites, what is wrong?
Thanks to all!
Your syntax looks correct assuming your variable is exactly named Valore and lives at the package level scope.
Variables are case sensitive so if it's named valore, VAlore, etc, it will not match.
Variables can be created at any level in the program so scope does matter. Locate the variable Valore and verify it's scope is at the package level (the Scope will match the Package.Name property). This is an example of how to reference a variable declared inside a Data Flow Task which is nested inside a Sequence Container.
\Package\Sequence Container\Data Flow Task.Variables[User::something].Properties[Value]
I put together a simple package and called it using your input. It worked fine
C:\src\SSISHackAndSlash\SSISHackAndSlash>dtexec /F ".\AnagraficaTOC.dtsx" /SET \Package.Variables[User::Valore].Properties[Value];2
Microsoft (R) SQL Server Execute Package Utility
Version 10.50.2500.0 for 64-bit
Copyright (C) Microsoft Corporation 2010. All rights reserved.
Started: 8:05:45 AM
Warning: 2011-11-12 08:05:45.93
Code: 0x00000000
Source: Script Task value check
Description: Valore : 2
End Warning
DTExec: The package execution returned DTSER_SUCCESS (0).
Started: 8:05:45 AM
Finished: 8:05:45 AM
Elapsed: 0.328 seconds
I also tested with the above command line from inside a batch file and it too worked as expected.
Finally, it seems you've scrubbed your input for us
"dtexec /F "c:\MyPackage.dtsx" /SET \Package.Variables[User::Valore].Properties[Value];2"
vs
dtexec /F "c:\AnagraficaTOC.dtsx" /SET \Package.Variables[User::Valore].Prop erties[Value];2
Despite the space in Properties in the second example, I assume that is related to copying values as the error message has a correct path. The first one has quotes in the wrong places (at least when I run it as provided I receive error - cannot find the path specified) Could the issue be that you're looking at an older version of the package (or you have multiple copies of it)?
had the same problem, was resolved by changing the namespace from config to user in the ssis variables pane

Resources