generate a file through SQL Server by query - sql-server

I'm working on a project which is based on daily activity.So i need to provide multiple reports at the end of the day by using export/Import Wizard it will take around 30-40 min of time.
In this case am thinking that i can write a query to generate these reports are done by a single query.It saves my time.
There is any chance to do this?

You have many options. Two good options to save your time, and generate the results of many queries in file format, are:
SSRS
SSRS Scheduled Reports, if you have that available to you.
To configure a subscription to deliver a report to a file share
In the Configuration Manager console, navigate to System CenterConfiguration Manager / Site Database / Computer Management /
Reporting / Reporting Services / , and expand the
node.
In the results pane, right-click a report and then click New Subscription.
On the Subscription Delivery page of the Create Subscription Wizard, specify the delivery properties for this report subscription.
From the Report delivered by drop-down list, select Windows File
Share. For more details about the options on this page, see Report
Subscription Dialog Box: Subscription Delivery Tab.
Click Next to continue.
On the Subscription Schedule page of the Create Subscription Wizard, configure the schedule by which the report will be generated
and delivered to the file share. For more details about the options on
this page, see Report Subscription Dialog Box: Subscription Schedule
Tab.
Click Next to continue.
On the Subscription Parameters page of the Create Subscription Wizard, specify any parameters that this report needs to run. For more
details about the options on this page, see Report Subscription Dialog
Box: Subscription Parameters Tab.
Click Next to continue.
On the Summary page of the Create Subscription Wizard, review the subscription that will be created and then click Next.
On the Confirmation page of the Create Subscription Wizard, review the actions taken and then click Close to exit the wizard.
SQLCMD
And using the Windows scheduler or a batch file run by hand to have sqlcmd run one or more queries and/or stored procedures on a schedule, outputting to one or more files.
Both Excel and Libreoffice will read tab delimited files; to do so with sqlcmd see this stackoverflow answer.

Related

Is it possible to restrict an SSRS report on Report Manager to one user at a time?

I have an SSRS report published to Report Manager, available to all Domain Users. The report's stored procedure executes a xp_cmdshell which outputs SQL data to an excel file in a shared file location. The issue is the report can't handle being run concurrently - anyone trying to run the report simultaneously with another user gets a blank file, or, worse, a file with missing data. I can't redevelop the solution right now, what I'm hoping to do is restrict the report to one user at a time, either within the SSRS report, via report manager config or the SharePoint link on our intranet (which users access the report by). Everything is on-prem.
I've tried the report config, RM config, our SharePoint developer and Google and none are helping. Thanks.

passing GUID from CRM on premise to SSRS report

I have uploaded report to CRM which I created in SSRS, when I go into CRM and then run it from Report section it runs successfully, only thing is it's looking for GUID in order to show reports with value.
I want to automate this somthing like whenever I go to each client Profile in CRM and click on run reports it should fetch it's GUID and pass it to that report as parameter and show the report.
Please help.
Try following,
1) change your report's datasource to embedded and then add button to the ribbon in Dynamics CRM( see following link)
http://mahadeomatre.blogspot.ca/2015/04/run-report-from-custom-ribbon-button.html?_sm_au_=iVV7VjqJnWZTNR0P

Stop Email from being sent Temporarily

I have a number of Subscriptions on SQL Server Reporting Services that are automatically fired off on a certain day and time. The only way I can think of stopping the subscription is to delete and then recreate it after.
Is there any other way i could do this?
If i was to use this, would it work?
USE msdb
GO
EXECUTE dbo.sysmail_stop_sp
GO
You can try pausing the shared schedule, as documented on MSDN:
Pause a shared schedule
If a report or subscription runs from a shared schedule, you can pause
the schedule to prevent processing. All report and subscription
processing driven by the schedule is deferred until the schedule is
resumed.
SharePoint mode: SharePoint Settings In Site settings, select Manage shared schedules. Select the schedule and click Pause selected
schedules.
Native mode: In report manager, click Site Settings. Select the schedule and then click Pause.

DotNetNuke EventLog table is deleting

New to DotNetNuke (ver 05.06.02 (144)) and writing a SSRS report to track how many times users have logged into the system, since that is part of their job requirements.
It appears this data is stored in EventLog.LogTypeKey --> "LOGIN_SUCCESS" being the item I need to count.
The problem is that the table is getting purged somehow. I have no hits on any successful logins that are older than roughly 24 hours.
Does anyone know the setting that is purging these values?
Thank you
If you go to the EVENT VIEWER page and go to the actions menu for the module, you can go to specific events and see what the default number of historical items to store is configured to.
EX: the LOGIN_SUCCESS event I believe stores 10 records, after that entries are trimmed from the database.
Each event type can be configured separately.
By default, DotNetNuke does not purge the EventLog table. You can find DNN's scheduled tasks in the Host menu's Schedule page. DNN schedule can execute any code that inherits the SchedulerClient base class provided by the DotNetNuke framework. But there is no EventLog purge code shipped as a scheduler client.
It is possible that the site administrator has added EventLog purging. Have you checked if there are any SQL Server Jobs, or Windows scheduled tasks? There is also a Scheduled SQL Jobs module to schedule sql scripts.

Restricting SSRS subscriptions to shared schedules only

I'm reasonably new to SQL Server Reporting Services and Report Manager, and completely new to SSRS's Subscriptions. We're running SSRS 2008.
Out of the box it seems that a user with the Browser role can create a Subscription to a report and schedule it to run at any time they choose.
As an admin I have setup a schedule called "Overnight reports" and have it run every night from 1am.
I would like it so that when a regular user creates their Subscription they can only use one of my shared schedules so that their subscription will only run overnight.
Is this possible?
Thanks
-Matt
OK well I haven't been able to find an answer for this.
I am able to hide the radio button for selecting their own schedule and the "Select Schedule" button using CSS, by changing ReportingServices.css (located in C:\Program Files\Microsoft SQL Server\MSRS10.MSSQLSERVER\Reporting Services\ReportManager\Styles on my Win 2008 server)
input#ui_rdoOnSchedule { display:none; }
input#ui_btn_SpecifyScheduleSubscriptionProp { display:none; }
However it's not very elegant - the text for "When the scheduled report run is complete" and "At 8:00 am every Mon of every week" is still visible.
-Matt

Resources