web technical support http://web.vniup.com Just another MoVN - Together for development Sites site Mon, 07 May 2012 15:18:25 +0000 en hourly 1 http://wordpress.org/?v=3.3.1 How to directly expose a table for editing? http://web.vniup.com/index.php/drupal/how-to-directly-expose-a-table-for-editing.html http://web.vniup.com/index.php/drupal/how-to-directly-expose-a-table-for-editing.html#comments Mon, 07 May 2012 15:18:25 +0000 admin http://web.vniup.com/index.php/drupal/how-to-directly-expose-a-table-for-editing.html I have imported all the tables from an external database into my Drupal 7 database.

I would now like to create a view/or some other item that will allow me to view and edit the fields of these imported tables directly.

For example:

An imported table would be ‘Gateways’ and it would have the columns ‘Gateway_Code’ and ‘Gateway_Id’.

What would I need to do to directly modify the values in Gateway_Code and Gateway_Id?

– Answer –

]]>
http://web.vniup.com/index.php/drupal/how-to-directly-expose-a-table-for-editing.html/feed 0
Hide Custom Line item Fields based on taxonomy http://web.vniup.com/index.php/drupal/hide-custom-line-item-fields-based-on-taxonomy.html http://web.vniup.com/index.php/drupal/hide-custom-line-item-fields-based-on-taxonomy.html#comments Mon, 07 May 2012 15:08:33 +0000 admin http://web.vniup.com/index.php/drupal/hide-custom-line-item-fields-based-on-taxonomy.html I am busy with a Drupal 7 commerce site.

There is a product type “Golf Clubs”. With different taxonomy Terms assigned to the products.

How can I create a view to hide custom line item fields based on taxonomy.

– Answer –

  • 7 May 2012: Hide Custom Line item Fields based on taxonomy -

    I am busy with a Drupal 7 commerce site.

    There is a product type "Golf Clubs". With different taxonomy Terms assigned to the products.

    How can I create a view to hide custom line item fields based on taxonomy.

    You have to edit the node.tpl.php.

    How can I code this. if (taxonomy term) = (term) then hide line item field(field name) ?

]]>
http://web.vniup.com/index.php/drupal/hide-custom-line-item-fields-based-on-taxonomy.html/feed 0
What is the "right" way to track a custom patch to a contributed module? http://web.vniup.com/index.php/drupal/what-is-the-right-way-to-track-a-custom-patch-to-a-contributed-module.html http://web.vniup.com/index.php/drupal/what-is-the-right-way-to-track-a-custom-patch-to-a-contributed-module.html#comments Mon, 07 May 2012 15:05:02 +0000 admin http://web.vniup.com/index.php/drupal/what-is-the-right-way-to-track-a-custom-patch-to-a-contributed-module.html I need to apply this patch to my site:
http://drupal.org/node/483176#comment-5939648

What is the “right” or “responsible” way to track this change? We use Git for version control.

– Answer –

  • 7 May 2012: Answer by Letharion for What is the "right" way to track a custom patch to a contributed module? -

    I keep all of those in the projects make file, which makes it easy to apply the patch again should the module be updated without it commited, and remove it when it's no longer necessary.

    This answer makes the most sense in context of my answer to the question Should I source control contribed modules in my project?.

  • 7 May 2012: What is the "right" way to track a custom patch to a contributed module? -

    I need to apply this patch to my site: http://drupal.org/node/483176#comment-5939648

    What is the "right" or "responsible" way to track this change? We use Git for version control.

]]>
http://web.vniup.com/index.php/drupal/what-is-the-right-way-to-track-a-custom-patch-to-a-contributed-module.html/feed 0
CKE editor not showing up until I upload an image? http://web.vniup.com/index.php/drupal/cke-editor-not-showing-up-until-i-upload-an-image.html http://web.vniup.com/index.php/drupal/cke-editor-not-showing-up-until-i-upload-an-image.html#comments Mon, 07 May 2012 15:01:16 +0000 admin http://web.vniup.com/index.php/drupal/cke-editor-not-showing-up-until-i-upload-an-image.html If I add content as admin, it works fine right from the beginning(using admin overlay).

admin overlay

But if I login as another role then CKE editor wont be neabled until I upload the image. ckeEditor

In Both roles FULL HTML is the default text format.
What might be the reason for this?

When I upload an image, then CKE editor shows up

cke editor after upload

– Answer –

  • 7 May 2012: CKE editor not showing up until I upload an image? -

    If I add content as admin, it works fine right from the beginning(using admin overlay).

    admin overlay

    But if I login as another role then CKE editor wont be neabled until I upload the image. ckeEditor

    In Both roles FULL HTML is the default text format. What might be the reason for this?

    When I upload an image, then CKE editor shows up

    cke editor after upload

]]>
http://web.vniup.com/index.php/drupal/cke-editor-not-showing-up-until-i-upload-an-image.html/feed 0
drupal 7 flag user login for anonymous user http://web.vniup.com/index.php/drupal/drupal-7-flag-user-login-for-anonymous-user.html http://web.vniup.com/index.php/drupal/drupal-7-flag-user-login-for-anonymous-user.html#comments Mon, 07 May 2012 14:58:43 +0000 admin http://web.vniup.com/index.php/drupal/drupal-7-flag-user-login-for-anonymous-user.html i want When anonymous users –or otherwise unprivileged users– visit my site they click on flag For these users you may wish to show a “Please log in” link instead in the lightbox or colorbox like facebook.

i am use drupal 7.

– Answer –

  • 7 May 2012: drupal 7 flag user login for anonymous user -

    i want When anonymous users --or otherwise unprivileged users-- visit my site they click on flag For these users you may wish to show a "Please log in" link instead in the lightbox or colorbox like facebook.

    i am use drupal 7.

]]>
http://web.vniup.com/index.php/drupal/drupal-7-flag-user-login-for-anonymous-user.html/feed 0
Finding variables available in preprocess node or node.tpl.php from cck fields http://web.vniup.com/index.php/drupal/finding-variables-available-in-preprocess-node-or-node-tpl-php-from-cck-fields.html http://web.vniup.com/index.php/drupal/finding-variables-available-in-preprocess-node-or-node-tpl-php-from-cck-fields.html#comments Mon, 07 May 2012 14:37:50 +0000 admin http://web.vniup.com/index.php/drupal/finding-variables-available-in-preprocess-node-or-node-tpl-php-from-cck-fields.html Would really appreciate help resolving this. I am using D7 and the devel module is not an option, for some reason it causes some problems with my site. I have looked into the contemplate module but see it isn’t supported in D7, otherwise it would be great. Is there any quick way for me to see all my variables so I can utilize them in a preprocess function?

– Answer –

  • 7 May 2012: Answer by Jimajamma for Finding variables available in preprocess node or node.tpl.php from cck fields -

    Yes, you can do something like this in a custom module:

    function YOURMODULE_preprocess_node(&$vars) {
      drupal_set_message('<pre>' . print_r($vars, true) . '</pre>');
    }
    

    or this in your theme's template.php file:

    function YOURTHEME_preprocess_node(&$vars) {
      drupal_set_message('<pre>' . print_r($vars, true) . '</pre>');
    }
    

    If that's too much information, you can get just the variable names with:

     foreach ($vars as $name => $value) {
       drupal_set_message($name);
     }
    

    instead of print_r()ing the entire array.

  • 7 May 2012: Finding variables available in preprocess node or node.tpl.php from cck fields -

    Would really appreciate help resolving this. I am using D7 and the devel module is not an option, for some reason it causes some problems with my site. I have looked into the contemplate module but see it isn't supported in D7, otherwise it would be great. Is there any quick way for me to see all my variables so I can utilize them in a preprocess function?

]]>
http://web.vniup.com/index.php/drupal/finding-variables-available-in-preprocess-node-or-node-tpl-php-from-cck-fields.html/feed 0
Setting Circular Replication in mysql http://web.vniup.com/index.php/database-admin/setting-circular-replication-in-mysql.html http://web.vniup.com/index.php/database-admin/setting-circular-replication-in-mysql.html#comments Mon, 07 May 2012 14:14:12 +0000 admin http://web.vniup.com/index.php/database-admin/setting-circular-replication-in-mysql.html I have 3 MySQL servers say A,B,C.

What I want to do is that I want to make all of them master as well as slave.If there is update on any of the MySQL Servers it should be replicated to all of the Servers.

I have studied about the circular replication and found it can be implemented with it.

Can anybody please give me all the steps to accomplish the Replication as stated between three servers.

One More Point i want to ignore some of the tables from a database also.

Also What are caveats of this type of replication?

– Answer –

  • 8 May 2012: Answer by Aaron Brown for Setting Circular Replication in mysql -

    Rolando told you how to do it and his answer is excellent. The truth is, circular replication is an awful, terrible, terrible idea. Don't do it. Ever. "Absolutes are never true," but in this case, it's pretty close.

    Instead of having a single point of failure, now you have three.

    What if one of the servers goes down? Now replication is broken everywhere.

    How do you replace it easily and align the binary log positions? You can't without doing some very complicated and error prone binary log analysis.

    So, now you have to restore all three servers from a backup. Wait, was that backup taken at the same moment in time? Nope, because there's no way to make a transactional backup across multiple servers. So, you're left with broken replication and attempting to fix it with pt-table-checksum and pt-table-sync...or rebuilding the entire cluster from scratch.

    Just because you can do something, doesn't mean you should. Don't do this, really. I'm not kidding.

  • 7 May 2012: Answer by RolandoMySQLDBA for Setting Circular Replication in mysql -

    For this example, let assume the following

    • ServerA IP Address 10.1.1.20
    • ServerB IP Address 10.1.1.30
    • ServerC IP Address 10.1.1.40
    • You will create a user for replication
      • username replicator@'10.1.1.%'
      • password r3plic4t0R
    • ServerA's Master will be ServerC
    • ServerB's Master will be ServerA
    • ServerC's Master will be ServerB
    • There are no databases on the three Servers
    • There are three tables to ignore
      • db1.tb1
      • db2.tb2
      • db3.tb3

    Step 01) Add these options under [mysqld] in /etc/my.cnf on ServerA

    [mysqld]
    server-id=20
    log-bin=mysql-bin
    relay-log=relay-bin
    log-slave-updates
    replicate-ignore-table=db1.tb1
    replicate-ignore-table=db2.tb2
    replicate-ignore-table=db3.tb3
    

    Step 02) Add these options under [mysqld] in /etc/my.cnf on ServerB

    [mysqld]
    server-id=30
    log-bin=mysql-bin
    relay-log=relay-bin
    log-slave-updates
    replicate-ignore-table=db1.tb1
    replicate-ignore-table=db2.tb2
    replicate-ignore-table=db3.tb3
    

    Step 03) Add these options under [mysqld] in /etc/my.cnf on ServerC

    [mysqld]
    server-id=40
    log-bin=mysql-bin
    relay-log=relay-bin
    log-slave-updates
    replicate-ignore-table=db1.tb1
    replicate-ignore-table=db2.tb2
    replicate-ignore-table=db3.tb3
    

    Step 05) service mysql restart on ServerA, ServerB, ServerC

    Step 06) Create GRANT for replication user on ServerA, ServerB, ServerC

    GRANT SELECT,REPLICATION SLAVE,REPLICATION CLIENT
    ON *.* to replicator@'10.1.1.%'
    IDENTIFIED BY 'r3plic4t0R';
    

    Step 07) Run SHOW MASTER STATUS; on ServerC

    Step 08) Run this CHANGE MASTER TO command on ServerA

    CHANGE MASTER TO
    MASTER_HOST='10.1.1.40',
    MASTER_PORT=3306,
    MASTER_USER='replicator',
    MASTER_PASSWORD='r3plic4t0R',
    MASTER_LOG_FILE='mysql-bin.000001',
    MASTER_LOG_POS=<PositionNumberFromStep07>;
    

    Step 09) Run SHOW MASTER STATUS; on ServerA

    Step 10) Run this CHANGE MASTER TO command on ServerB

    CHANGE MASTER TO
    MASTER_HOST='10.1.1.20',
    MASTER_PORT=3306,
    MASTER_USER='replicator',
    MASTER_PASSWORD='r3plic4t0R',
    MASTER_LOG_FILE='mysql-bin.000001',
    MASTER_LOG_POS=<PositionNumberFromStep09>;
    

    Step 11) Run SHOW MASTER STATUS; on ServerB

    Step 12) Run this CHANGE MASTER TO command on ServerC

    CHANGE MASTER TO
    MASTER_HOST='10.1.1.30',
    MASTER_PORT=3306,
    MASTER_USER='replicator',
    MASTER_PASSWORD='r3plic4t0R',
    MASTER_LOG_FILE='mysql-bin.000001',
    MASTER_LOG_POS=<PositionNumberFromStep11>;
    

    Step 13) START SLAVE; on ServerA

    Step 14) Wait 5 seconds, then SHOW SLAVE STATUS\G on ServerA

    If Slave_IO_Running=Yes and Slave_SQL_Running=Yes, replication is working

    Step 15) START SLAVE; on ServerB

    Step 16) Wait 5 seconds, then SHOW SLAVE STATUS\G on ServerB

    If Slave_IO_Running=Yes and Slave_SQL_Running=Yes, replication is working

    Step 17) START SLAVE; on ServerC

    Step 18) Wait 5 seconds, then SHOW SLAVE STATUS\G on ServerC

    If Slave_IO_Running=Yes and Slave_SQL_Running=Yes, replication is working

    UPDATE 2012-05-07 12:22 EDT

    The only reason to use auto_increment_offset/auto_increment_increment in this setup would be to do writes to all masters and reads from any master.

    There is only one scenrio with this setup where you are not obligated to use auto_increment_offset/auto_increment_increment:

    For any given database mydb - If you write to mydb on ServerA only, then read from mydb on ServerA - If you write to mydb on ServerB only, then read from mydb on ServerB - If you write to mydb on ServerC only, then read from mydb on ServerC

  • 7 May 2012: Setting Circular Replication in mysql -

    I have 3 MySQL servers say A,B,C.

    What I want to do is that I want to make all of them master as well as slave.If there is update on any of the MySQL Servers it should be replicated to all of the Servers.

    I have studied about the circular replication and found it can be implemented with it.

    Can anybody please give me all the steps to accomplish the Replication as stated between three servers.

    One More Point i want to ignore some of the tables from a database also.

    Also What are caveats of this type of replication?

]]>
http://web.vniup.com/index.php/database-admin/setting-circular-replication-in-mysql.html/feed 0
How to add id to a block http://web.vniup.com/index.php/drupal/how-to-add-id-to-a-block.html http://web.vniup.com/index.php/drupal/how-to-add-id-to-a-block.html#comments Mon, 07 May 2012 13:48:21 +0000 admin http://web.vniup.com/index.php/drupal/how-to-add-id-to-a-block.html For example I have the code:

function contact_block_view($delta = '') {
$block = array();
switch ($delta) {
  case 'contact_block':
  $block['content'] = drupal_get_form('contact_form');
break;
}
return $block;
}

How to set inside this block the id or class attributes?

– Answer –

  • 7 May 2012: Answer by Pierre Buyle for How to add id to a block -

    You will not be able to add an id or class attribute to the block in your hook_block_view implementation. At this stage you are not yet dealing with the markup of the block itself but only the markup for its content. In order to set the id or class of the block markup, you will need to use hook_preprocess_block() or hook_process_block() to add a usable variables to the block.tpl.php template. Then you will need to actually use the variables in the template itself.

    Fortunately, the default block.tpl.php file already provides variables for both the id and class attributes of your block ($block_html_id and $classes). Actually, template_preprocess_block already sets the id to 'block-' . $variables['block']->module . '-' . $variables['block']->delta. So in your case, using the default template, your block will have block-contact-contact-block as id. But it can be changed if needed. In any preprocessor functions, you can add and remove CSS classes by manipulating $classes_array variables. Both are illustrated in the following code.

    function MODULE_preprocess_block(&$variables) {
      if ($variables['block']->module == 'contact' && $variables['block']->delta == 'contact_block') {
        $variables['block_html_id'] = drupal_html_id('your-id-here');
        $variables['classes_array'][] = drupal_html_class('your-class-here');
      }
    }
    
  • 7 May 2012: How to add id to a block -

    For example I have the code:

    function contact_block_view($delta = '') {
    $block = array();
    switch ($delta) {
      case 'contact_block':
      $block['content'] = drupal_get_form('contact_form');
    break;  
    }
    return $block; 
    }
    

    How to set inside this block the id or class attributes?

]]>
http://web.vniup.com/index.php/drupal/how-to-add-id-to-a-block.html/feed 0
How to schedule function in Oracle? http://web.vniup.com/index.php/database-admin/how-to-schedule-function-in-oracle.html http://web.vniup.com/index.php/database-admin/how-to-schedule-function-in-oracle.html#comments Mon, 07 May 2012 13:46:34 +0000 admin http://web.vniup.com/index.php/database-admin/how-to-schedule-function-in-oracle.html I want to schedule function in Oracle.

begin
  dbms_scheduler.create_job(job_name        => 'aud_clear',
                            job_type        => 'PLSQL_BLOCK',
                            job_action      => 'aud_clear_fun',
                            start_date      => sysdate,
                            repeat_interval => 'freq=daily; byminute=0; bysecond=0',
                            end_date        => null,
                            enabled         => true,
                            comments        => 'Created By: MK; Truncates aud$ table');
end;

I have tried to indicate several other values for job_action, for example:

declare
my_var number;
begin
select aud_clear_fun into my_var from dual;
end;

But doesn’t work. Can you provide me with the right syntax of scheduling function?

Thank you.

–aud_clear_fun

create or replace function aud_clear_fun
return number is
begin
   delete from a;
   return 0;
end;

–Job

begin
  dbms_scheduler.create_job(job_name        => 'aud_clear',
                            job_type        => 'PLSQL_BLOCK',
                            job_action      => 'begin
                                                 mari_dba.aud_clear_fun();
                                                end;',
                            start_date      => sysdate,
                            end_date        => NULL,
                            repeat_interval => 'freq=daily; byminute=0; bysecond=0',
                            enabled         => true);
end;

–Execution

begin
  dbms_scheduler.run_job('aud_clear');
end;

–Error

ORA-06550: line 2, column 50:
PLS-00221: 'AUD_CLEAR_FUN' is not a procedure or is undefined
ORA-06550: line 2, column 50:
PL/SQL: Statement ignored
ORA-06512: at "SYS.DBMS_ISCHED", line 185
ORA-06512: at "SYS.DBMS_SCHEDULER", line 486
ORA-06512: at line 2

View program sources of error stack?

– Answer –

  • 7 May 2012: Answer by ik_zelf for How to schedule function in Oracle? -

    The error message is very clear, you need to specify a procedure or a valid pl/sql block. If you really want to truncate the aud$ table from a piece of pl/sql, you will need to use dynamic SQL.

    begin
    execute immediate 'truncate table sys.aud$';
    end;
    /
    

    put the code in the action or in the procedure definition of aud_clear_fun, that really needs to be a procedure to work with Oracle Scheduler. The Scheduler is not going to read the returned value ...

  • 7 May 2012: Answer by Phil for How to schedule function in Oracle? -

    Put the job_action inline, as follows:

    begin
      dbms_scheduler.create_job(job_name        => 'aud_clear',
                                job_type        => 'PLSQL_BLOCK',
                                job_action      => 'begin
                                                    truncate table aud$;
                                                    end;',
                                start_date      => sysdate,
                                end_date        => NULL,
                                repeat_interval => 'freq=daily; byminute=0; bysecond=0',
                                enabled         => true,
                                comments        => 'Created By: MK; Truncates aud$ table');
    end;
    
  • 7 May 2012: How to schedule function in Oracle? -

    I want to schedule function in Oracle.

    begin
      dbms_scheduler.create_job(job_name        => 'aud_clear',
                                job_type        => 'PLSQL_BLOCK',
                                job_action      => 'aud_clear_fun',
                                start_date      => sysdate,
                                repeat_interval => 'freq=daily; byminute=0; bysecond=0',
                                end_date        => null,
                                enabled         => true,
                                comments        => 'Created By: MK; Truncates aud$ table');
    end;
    

    I have tried to indicate several other values for job_action, for example:

    declare
    my_var number;
    begin
    select aud_clear_fun into my_var from dual;
    end;
    

    But doesn't work. Can you provide me with the right syntax of scheduling function?

    Thank you.

    --aud_clear_fun

    create or replace function aud_clear_fun
    return number is
    begin
       delete from a;
       return 0;
    end;
    

    --Job

    begin
      dbms_scheduler.create_job(job_name        => 'aud_clear',
                                job_type        => 'PLSQL_BLOCK',
                                job_action      => 'begin
                                                     mari_dba.aud_clear_fun();
                                                    end;',
                                start_date      => sysdate,
                                end_date        => NULL,
                                repeat_interval => 'freq=daily; byminute=0; bysecond=0',
                                enabled         => true);
    end;
    

    --Execution

    begin
      dbms_scheduler.run_job('aud_clear');
    end;
    

    --Error

    ORA-06550: line 2, column 50:
    PLS-00221: 'AUD_CLEAR_FUN' is not a procedure or is undefined
    ORA-06550: line 2, column 50:
    PL/SQL: Statement ignored
    ORA-06512: at "SYS.DBMS_ISCHED", line 185
    ORA-06512: at "SYS.DBMS_SCHEDULER", line 486
    ORA-06512: at line 2
    
    View program sources of error stack?
    

]]>
http://web.vniup.com/index.php/database-admin/how-to-schedule-function-in-oracle.html/feed 0
Associate a piece of data with a session http://web.vniup.com/index.php/database-admin/associate-a-piece-of-data-with-a-session.html http://web.vniup.com/index.php/database-admin/associate-a-piece-of-data-with-a-session.html#comments Mon, 07 May 2012 12:41:32 +0000 admin http://web.vniup.com/index.php/database-admin/associate-a-piece-of-data-with-a-session.html I think I want to associate a piece of data with each session.

The association must have the following properties:

  • The data being associated is provided either as a part of connection string (if that is possible at all) or as a parameter for a stored procedure which then must be the first SP called within the session.
  • The data must be easily available for any stored procedures the session then calls, without having this piece of data passed as a parameter.
    This point is essential for the idea: obviously, I could add a parameter into each of my stored procedures and oblige the software to pass the piece of data each time any stored proc is called, but that is exactly what I want to avoid.
  • The data must automatically expire and be invalid as soon as the session disconnects. No actions from the client must be required to mark the data as expired. If a session disconnects unexpectedly, that still must render its piece of data invalid.

I’ve considered several ways of doing it, but didn’t like any:

  • Local temporary tables.
    Pick a table name (based on a freshly created GUID to avoid any clashes). Have a stored procedure that creates temporary table with this name and inserts a row with the data passed as a parameter. Then all other procs can reference the #table and get the data. The idea is that each session will have it’s own #table, while the name of the #table remains the same.
    Won’t work. The temporary table created in the stored procedure will be dropped upon exiting the procedure. Making the user create the #table directly, without calling a SP, is not an option.
  • A regular table where data is looked up by @SPID.
    Won’t work. This requires deleting the data manually upon disconnect.
  • APP_NAME().
    Will probably work, but that’s not really app name, and that will not be easily extendable.

Are there better ways of associating data with a session?

– Answer –

  • 7 May 2012: Answer by Nick Chammas for Associate a piece of data with a session -

    Use SET CONTEXT_INFO.

    The most common use case for this is to send triggers information about the actor that caused the trigger to fire.

    For example:

    CREATE PROCEDURE [dbo].[ModifyData]
    AS
    BEGIN
        DECLARE @ObjectID BINARY(4) = CAST(@@PROCID AS BINARY(4));
        SET CONTEXT_INFO @ObjectID;
    
        UPDATE [dbo].[Data]
        ...
    END;
    GO
    
    CREATE TRIGGER [LogModifications]
    ON [dbo].[Data]
    FOR UPDATE 
    AS 
    BEGIN
        DECLARE @ModifiedByObjectID INT = CAST(SUBSTRING(CONTEXT_INFO(), 1, 4) AS INT);
    
        ...
    END;
    GO
    
  • 7 May 2012: Associate a piece of data with a session -

    I think I want to associate a piece of data with each session.

    The association must have the following properties:

    • The data being associated is provided either as a part of connection string (if that is possible at all) or as a parameter for a stored procedure which then must be the first SP called within the session.
    • The data must be easily available for any stored procedures the session then calls, without having this piece of data passed as a parameter.
      This point is essential for the idea: obviously, I could add a parameter into each of my stored procedures and oblige the software to pass the piece of data each time any stored proc is called, but that is exactly what I want to avoid.
    • The data must automatically expire and be invalid as soon as the session disconnects. No actions from the client must be required to mark the data as expired. If a session disconnects unexpectedly, that still must render its piece of data invalid.

    I've considered several ways of doing it, but didn't like any:

    • Local temporary tables.
      Pick a table name (based on a freshly created GUID to avoid any clashes). Have a stored procedure that creates temporary table with this name and inserts a row with the data passed as a parameter. Then all other procs can reference the #table and get the data. The idea is that each session will have it's own #table, while the name of the #table remains the same.
      Won't work. The temporary table created in the stored procedure will be dropped upon exiting the procedure. Making the user create the #table directly, without calling a SP, is not an option.
    • A regular table where data is looked up by @SPID.
      Won't work. This requires deleting the data manually upon disconnect.
    • APP_NAME().
      Will probably work, but that's not really app name, and that will not be easily extendable.

    Are there better ways of associating data with a session?

]]>
http://web.vniup.com/index.php/database-admin/associate-a-piece-of-data-with-a-session.html/feed 0