Thursday, March 22, 2012
creating a table
Sunday, February 19, 2012
CreateSubscription - Specify the Job Name or Get the GUID Job Name
We're using the CreateSubscription method to schedule a report for automatic delivery, using SQL Server Agent. Everything is working great. But, we had a question (or two).
Is there anyway to specify the name of the SQL Server Agent job that gets created when the CreateSubscription method is called? If so, how?
If not, is there anyway to get the GUID job name back after calling CreateSubscription?
TIA
There is no way to set the name of the SQL Agent job via the CreateSubscription method.
You can use the ListSubscriptions to get the guid and GetSubscriptionProperties to get further information.
ReportingService2005 rs = new ReportingService2005();
Subscription[] subscription = rs.ListSubscriptions(ReportAndPath, UserName);
rs.GetSubscriptionProperties(
subscription[0].SubscriptionID,
out actualExtensionSettings,
out actualDescription,
out actualActive,
out actualStatus,
out actualEventType,
out actualMatchData,
out actualParameters);
|||Brad,
Thanks for the info. However, does using the ListSubscriptions and GetSubscriptionProperties give me the GUID name of the SQL Server Agent job?
Since there is no way to set the SQL Server Agent job to something more meaningful to end-users, the next best option for us is to provide the GUID name of the SQL Server Agent job to the end-user after is has been created. Thus, our ASP.NET app. will display to the end-user something like, "Your job has been created. The job name is xxxx." (where xxxx is the GUID job name as shown in the SQL Server list of jobs). In our situation, our end-users are 'knowledgeable' enough about our product to open SQL Server, navigate to SQL Server Agent, and find the job they just tried to create. So, we need to be able to give them some help with which job name is theirs.
Thanks.
|||No. The guid for the SQL Agent job is not exposed through the SOAP Api's.
Why not just give them the subscription information? Instead of trying to tell them the SQL Agent Job, tell them the subscription name. "Your subscription has been created. The subscription is on "ReportX" for user "Foo" and is scheduled to send at "Time Selected". In Management Studio or Report Manager, more information is stored for the Subcription in RS then for the Job in the Agent. They can get parameter values, security info, and other information.
Just a thought.
Tuesday, February 14, 2012
CREATE VIEW - script to automate column names?
I'm trying to create views on all my existing tables and for that I'd
like to create a script or so.
I don't want to specify the '*' for the columns in the create view
statement. I prefer to specify the column names.
I have the column names int sys.columns table but Do not know how to
handle them to have a statement like that:
CREATE VIEW myVIEW
WITH SCHEMABINDING
AS
SELECT col1name, col2name, col3name, etc...
from sys.columns
...???....
Anyone can help?
thx,
ChrisOn 12 Mar 2007 04:44:56 -0700, "clir" <christophe.leroquais@.gmail.com>
wrote:
Use a cursor to loop over the column names, all the while
concatenating a string variable. In the end, execute that string
(sp_executesql) and your view will be created.
-Tom.
Quote:
Originally Posted by
>Hi,
>
>I'm trying to create views on all my existing tables and for that I'd
>like to create a script or so.
>I don't want to specify the '*' for the columns in the create view
>statement. I prefer to specify the column names.
>I have the column names int sys.columns table but Do not know how to
>handle them to have a statement like that:
>
>CREATE VIEW myVIEW
>WITH SCHEMABINDING
>AS
SELECT col1name, col2name, col3name, etc...
from sys.columns
...???....
>
>
>Anyone can help?
>
>thx,
>
>Chris