Can SSIS packages call other SSIS packages in the connection string?

I am running an SSIS package that transfers data from one (SQL2008) server to another (SQL2000). However after P2V conversion the SQL2008 server cannot execute an SSIS package due to a user authentication error.

Lets say the package is called "Transfer-Go". In the connection string of that package can it call another SSIS package? In the SSIS library there is another package with the same that appears in the string (called Transfer-Now) name The string is below:

Data Source=<IP>;User ID=<user>;Initial Catalog=<db_name>;Provider=SQLNCLI10.1;Persist Security Info=True;OLE DB Services=-13;Auto Translate=False;Application Name=SSIS-<Transfer-Now-name of other SSIS package>-{8ABA18EE-637E-424F-A3F7-F7E4EA50DD9D}<IP.db_name.user>; 

So is this SSIS package connection string calling that package?

And if the credentials are wrong in that package could that be why I am unable to authenticate?

Thanks for any input, not a DB/SQL guy at all so I apologize if I sound green here.

display an input string many times

I’d like to create a function that add 2 to an integer as much as we want. It would look like that:

>>> n = 3  >>> add_two(n) Would you like to add a two to n ? Yes The new n is 5 Would you like to add a two to n ? Yes the new n is 7 Would you like to add a two to n ? No 

Can anyone help me please ? I don’t how I can print the sentence without recalling the function.

Database connection lost whenever SQL query string is too long

I recently switched from running my Rails app on a single VM to running the database — MariaDB 10.3 — on a separate (Debian Buster) VM. Now that the database is on a separate server, Rails immediately throws Mysql2::Error::ConnectionError: MySQL server has gone away whenever it tries to make a query where the SQL itself is very long. (They query itself isn’t necessarily one that would put significant load on the system.)

An example query that causes the problem looks like this:

SELECT `articles`.`id` FROM `articles` WHERE `articles`.`namespace` = 0 AND `articles`.`wiki_id` = 1 AND `articles`.`title` IN ('Abortion', 'American_Civil_Liberties_Union', 'Auschwitz_concentration_camp', 'Agent_Orange', 'Ahimsa') 

… except the array of titles is about 5000 items long, and the full query string is ~158kB.

On the database side, this corresponds to warnings like this:

2021-03-25 15:47:13 10 [Warning] Aborted connection 10 to db: 'dashboard' user: 'outreachdashboard' host: 'programs-and-events-dashboard.globaleducation.eqiad1.wikimed' (Got an error reading communication packets)

The problem seems to be with the network layer, but I can’t get to the bottom of it. I’ve tried adjusting many MariaDB config variables (max_allowed_packet, innodb_log_buffer_size, innodb_log_file_size, innodb_buffer_pool_size) but none of those made a difference. The problem seems to be that the connection is aborted while it is attempting to transmit the long SQL query string from the app server to the database server. (There’s no corresponding problem with receiving large query results from the database.)

I’ve tried adjusting several timeout-related settings as well, although that seems unlikely to be the problem because I can replicate the connection error without any significant wait, just by issuing one of the long-SQL-string queries from a Rails console.

I’ve tried using tcpdump to see what’s coming in, but didn’t pick up any additional clues from that.

Using Dynamic Data Masking in SQL Server Custom String

I need to mask the data in the following table. enter image description here

For example, I need to mask the first_name of the user Roberto to something like NAME<>, So the end result should look like NAME1

Is this possible in SQL Server?

My SQL Server details below.

enter image description here

I have tried these methods from the documentation but still no luck. enter link description here

Implicitly cast an ISO8601 string to TIMESTAMPTZ (postgresql) for Debezium

I am using a 3rd party application (Debezium Connector). It has to write date time strings in ISO-8601 format into a TIMESTAMPTZ column. Unfortunately this fails, because there is no implicit cast from varchar to timestamp tz.

I did notice that the following works:

SELECT TIMESTAMPTZ('2021-01-05T05:17:46Z'); SELECT TIMESTAMPTZ('2021-01-05T05:17:46.123Z'); 

I tried the following:

  1. Create a function and a cast
CREATE OR REPLACE FUNCTION varchar_to_timestamptz(val VARCHAR)  RETURNS timestamptz AS $  $       SELECT TIMESTAMPTZ(val) INTO tstz; $  $   LANGUAGE SQL; CREATE CAST (varchar as timestamptz) WITH FUNCTION varchar_to_timestamptz (varchar) AS IMPLICIT; 

Unfortunately, it gives the following errors:

function timestamptz(character varying) does not exist

  1. I also tried the same as above but using plpgsql and got the same error.

  2. I tried writing a manual parse, but had issues with the optional microsecond segment which gave me the following

CREATE OR REPLACE FUNCTION varchar_to_timestamptz (val varchar) RETURNS timestamptz AS $  $        SELECT CASE          WHEN $  1 LIKE '%.%'              THEN to_timestamp($  1, 'YYYY-MM-DD"T"HH24:MI:SS.USZ')::timestamp without time zone at time zone 'Etc/UTC'          ELSE to_timestamp($  1, 'YYYY-MM-DD"T"HH24:MI:SSZ')::timestamp without time zone at time zone 'Etc/UTC' END $  $   LANGUAGE SQL; 

Which worked, but didn’t feel correct.

Is there a better way to approach this implicit cast?

Postgres: Efficient schema for querying with one exact string match and two range matches

The table I need to query:

CREATE TABLE regions (     state text NOT NULL,     zip_begin text NOT NULL,  -- 9-digit zip code     zip_end text NOT NULL,     date_begin date NOT NULL,     date_end date,      data ..., ) 

There are ~50 states and between 0-5M rows per state. The zip and date ranges might overlap.

The following will be one of the most common queries in my OLTP application:

SELECT data FROM regions WHERE state = {state}   AND {date} BETWEEN date_begin AND date_end   AND {zip} BETWEEN zip_begin AND zip_end 

This query usually yields one row, but may sometimes yield more.

From the Postgres docs, it sounds like a GiST index might do what I need, but I don’t really understand how those work.

How do I make ClickToCopy copy some text rather than string?

Consider the following example:

ClickToCopy["display text","file name"] 

When I click the display text I get "file name" rather than file name without the quotes. Which doesn’t serve my purpose of quick file name access. So when I copy to some location I have to manually remove the quotes.

What should I do to make it copy the actual Text inside the String?

Illegal string offset checkbox

So I’m trying to create a custom plugin, which has a separate page on admin side where you can enable or disable comments on the whole page.

Here is the code that works but throws a php error:

Illegal string offset ‘enode-checkbox’

    function enode_settings_page() {     add_settings_section("section", "Comments", null, "enode");     add_settings_field("enode-checkbox", "Disable Comments", "enode_checkbox_display", "enode", "section");     register_setting("section", "enode-checkbox"); }  function enode_checkbox_display() {    ?>         <!-- Here we are comparing stored value with 1. Stored value is 1 if user checks the checkbox otherwise empty string. -->         <p>If you do not plan on having comments on your posts, products or anywhere on your site, it's best practice to completely disable comments to prevent spam bots overwhelming the site.</p>         <input type="checkbox" name="enode-checkbox" value="1" <?php checked(1, get_option('enode-checkbox'), true); ?> />    <?php }  add_action("admin_init", "enode_settings_page");  function enode_page() {   ?>       <div class="wrap">          <h1>Enode Settings</h1>           <form method="post" action="options.php">             <?php                settings_fields("section");                 do_settings_sections("enode");                 submit_button();             ?>          </form>       </div>    <?php }   function my_admin_menu() {  $  icon_url = plugins_url( 'enode-plugin/enode-setting.svg' );  add_menu_page(  __( 'Enode', 'enode-plugin-setting' ),  __( 'Enode', 'enode-plugin-setting' ),  'manage_options',  'sample-page',  'enode_page',  $  icon_url  );  }    add_action( 'admin_menu', 'my_admin_menu' );   add_action('init', 'enodeDisableComments'); function enodeDisableComments() {   $  options = get_option( 'enode-checkbox' );    // If is checked, activate function to disable comments   if( $  options['enode-checkbox'] == '1' ) {     /* Remove Comments Entirely From Site */      add_action('admin_init', function () {         // Redirect any user trying to access comments page         global $  pagenow;          if ($  pagenow === 'edit-comments.php') {             wp_redirect(admin_url());             exit;         }          // Remove comments metabox from dashboard         remove_meta_box('dashboard_recent_comments', 'dashboard', 'normal');          // Disable support for comments and trackbacks in post types         foreach (get_post_types() as $  post_type) {             if (post_type_supports($  post_type, 'comments')) {                 remove_post_type_support($  post_type, 'comments');                 remove_post_type_support($  post_type, 'trackbacks');             }         }     });      // Close comments on the front-end     add_filter('comments_open', '__return_false', 20, 2);     add_filter('pings_open', '__return_false', 20, 2);      // Hide existing comments     add_filter('comments_array', '__return_empty_array', 10, 2);      // Remove comments page in menu     add_action('admin_menu', function () {         remove_menu_page('edit-comments.php');     });      // Remove comments links from admin bar     add_action('init', function () {         if (is_admin_bar_showing()) {             remove_action('admin_bar_menu', 'wp_admin_bar_comments_menu', 60);         }     });      /* end of Remove Comments Entirely From Site */   }   else {       //do nothing   }   return; } 

I’m not the first one to have this kind of an issue so I know the problem is, that when the checkbox is unchecked, it doesn’t store anything in the database. So we need to check if there is something stored in the db.

So changing this line

  if( $  options['enode-checkbox'] == '1' ) { 

to this:

if ( isset( $  options['enode-checkbox'] ) && $  options['enode-checkbox'] == '1' ) { 

should work but it doesn’t.

Can i use a string as an end of line delimeter when importing a csv to mysql?

Very basic question but im struggling with it. When i am importing a csv file to mysql is it possible to use any character or string as an end of line delimeter? If so is it possible from the admin window ‘Import’? Or must i do so in a sql query (doesnt seem logical).

So far i have had issues using everything besides \n and auto in the php my admin window. I tried the € sign i tried ///. Didnt work and got errors relating to an incorrect end of line delimeter.
Any help would be much appreciated. Thank you.