Discussion:
Run program after inserting new data set
(too old to reply)
olivogt
2012-04-03 11:10:17 UTC
Permalink
Hello, I would like to auto-run a program after inserting a new
dataset.

The new dataset is in my case a new DotNetNuke user (table: users).
The program is "barcode2image.exe" which generates a bar-code image
depending on the DnnUserID.

At the moment I run a scheduled task every hour.
However, I would like to display a customised item (with the bar-code
image) immediately after generating the new user
Hence, I was just wondering if there is a way to write a trigger to
run the barcode2image.exe immediately after user registration...

Many thanks,
Oliver
Erland Sommarskog
2012-04-03 21:40:07 UTC
Permalink
Post by olivogt
Hello, I would like to auto-run a program after inserting a new
dataset.
The new dataset is in my case a new DotNetNuke user (table: users).
The program is "barcode2image.exe" which generates a bar-code image
depending on the DnnUserID.
At the moment I run a scheduled task every hour.
However, I would like to display a customised item (with the bar-code
image) immediately after generating the new user
Hence, I was just wondering if there is a way to write a trigger to
run the barcode2image.exe immediately after user registration...
If you would run it as part of the trigger, it would during registration,
which could slow things down. But you could use Service Broker and the
activation procedure could be a CLR procedure which incorporates the
code for generating the bar code. (I assume that is a C# program.)

Or can't you initiate generation of the bar code from the client-side
of things?
--
Erland Sommarskog, SQL Server MVP, ***@sommarskog.se

Links for SQL Server Books Online:
SQL 2008: http://msdn.microsoft.com/en-us/sqlserver/cc514207.aspx
SQL 2005: http://msdn.microsoft.com/en-us/sqlserver/bb895970.aspx
olivogt
2012-04-04 08:08:27 UTC
Permalink
Hello Erland, Thank you for the reply.

From your answer I can see that there is some more programming to be
done - I was rather looking for an option to run a scheduled task from
within the SQL Management Studio. May be I leave the Windows task
schedule once per hour....

Many thanks,
Oliver
Post by Erland Sommarskog
Post by olivogt
Hello, I would like to auto-run a program after inserting a new
dataset.
The new dataset is in my case a new DotNetNuke user (table: users).
The program is "barcode2image.exe" which generates a bar-code image
depending on the DnnUserID.
At the moment I run a scheduled task every hour.
However, I would like to display a customised item (with the bar-code
image) immediately after generating the new user
Hence, I was just wondering if there is a way to write a trigger to
run the barcode2image.exe immediately after user registration...
If you would run it as part of the trigger, it would during registration,
which could slow things down. But you could use Service Broker and the
activation procedure could be a CLR procedure which incorporates the
code for generating the bar code. (I assume that is a C# program.)
Or can't you initiate generation of the bar code from the client-side
of things?
--
SQL 2008:http://msdn.microsoft.com/en-us/sqlserver/cc514207.aspx
SQL 2005:http://msdn.microsoft.com/en-us/sqlserver/bb895970.aspx
Erland Sommarskog
2012-04-04 21:41:07 UTC
Permalink
Post by olivogt
From your answer I can see that there is some more programming to be
done - I was rather looking for an option to run a scheduled task from
within the SQL Management Studio. May be I leave the Windows task
schedule once per hour....
For one thing, I have no idea how your application looks like. Applications
usually do not include SSMS...
--
Erland Sommarskog, SQL Server MVP, ***@sommarskog.se

Links for SQL Server Books Online:
SQL 2008: http://msdn.microsoft.com/en-us/sqlserver/cc514207.aspx
SQL 2005: http://msdn.microsoft.com/en-us/sqlserver/bb895970.aspx
Loading...