Showing posts with label corresponding. Show all posts
Showing posts with label corresponding. Show all posts

Friday, March 23, 2012

How to Refresh a Data Source View and autogenerate/Re-Deploy the corresponding Report Model

Hi everyone!,

Our team is new to SSRS and we are trying to figure out how to refresh the data source view, autogenerate the corressponding report model and Re-Deploy the Report Model (rewrite existing Report Model) on the server on a periodoc basis or trigger the whole action whenever there is a change in the database on some specific tables.

We prefer to do this action through a Agent job ( a diff approach is also welcome).

Are there any stored procs out there?

Appreciate your time.

-PN

Can anybody please tell me if this is possible or not in the current version of SSRS or VS.

Appreciate your time guys.

|||This won't be easy but I think it is possible. There is no eventing that RS provides to help you with this. The DSV schema information gets embedded in the model definition (under the <Schema> element). So, you need to load the model defintion (GetModelDefinition() API), make the changes to the DSV schema, update the model, and save it back (SetModelDefinition). As far subscribing for notifications, you are on your own. Probably CLR DDL trigger will be your best joice to sink the table schema change event.|||

Hi Teo,

Thanks for your answer. I was thinking around the same lines but did not know the Methods to accomplish this task.

|||

Hi,

My project requirements goes the same way. I was trying to refresh the Report Model in the way mentioned by Teo. But the GetModelDefinition will fetch the report model SMDL.

How to get the DSV schema? Is there anything am missing out?

Did any one got the solution for the same?

Thanks.

|||Assuming a model on top of a relational database, the DSV schema gets embedded in the model definition (see <DataSourceView> element) upon deploy.|||Hi Teo,

Thanks for ur help. I tried in the same lines and was able to achieve my task.

I need to know whether it is recomended to change the xml definition of the Report Model.

Thanks

How to Refresh a Data Source View and autogenerate/Re-Deploy the corresponding Report Model

Hi everyone!,

Our team is new to SSRS and we are trying to figure out how to refresh the data source view, autogenerate the corressponding report model and Re-Deploy the Report Model (rewrite existing Report Model) on the server on a periodoc basis or trigger the whole action whenever there is a change in the database on some specific tables.

We prefer to do this action through a Agent job ( a diff approach is also welcome).

Are there any stored procs out there?

Appreciate your time.

-PN

Can anybody please tell me if this is possible or not in the current version of SSRS or VS.

Appreciate your time guys.

|||This won't be easy but I think it is possible. There is no eventing that RS provides to help you with this. The DSV schema information gets embedded in the model definition (under the <Schema> element). So, you need to load the model defintion (GetModelDefinition() API), make the changes to the DSV schema, update the model, and save it back (SetModelDefinition). As far subscribing for notifications, you are on your own. Probably CLR DDL trigger will be your best joice to sink the table schema change event.|||

Hi Teo,

Thanks for your answer. I was thinking around the same lines but did not know the Methods to accomplish this task.

|||

Hi,

My project requirements goes the same way. I was trying to refresh the Report Model in the way mentioned by Teo. But the GetModelDefinition will fetch the report model SMDL.

How to get the DSV schema? Is there anything am missing out?

Did any one got the solution for the same?

Thanks.

|||Assuming a model on top of a relational database, the DSV schema gets embedded in the model definition (see <DataSourceView> element) upon deploy.|||Hi Teo,

Thanks for ur help. I tried in the same lines and was able to achieve my task.

I need to know whether it is recomended to change the xml definition of the Report Model.

Thanks

Monday, March 19, 2012

How to reduce .ldf log file size

I have a SQL Server 2005 database with a data file that's 156MB. It's corresponding .ldf file is 5.6GB!! At most, I need about 1% of the data that's in there. Is there anything I can do to reduce the size of this file? I've looked everywhere I can think of for settings to reduce what's logged and how long the logs are kept. I've set what few things I can control to the minimums. What I'd prefer is to be able to periodically flush it and start over.

You might find these resources useful:

FileSize -How to stop the log file from growing
http://www.support.microsoft.com/?id=873235

FileSize -Log file filling up
http://www.support.microsoft.com/?id=110139

FileSize -Log File Grows too big
http://www.support.microsoft.com/?id=317375

FileSize -Log File issues
http://www.nigelrivett.net/TransactionLogFileGrows_1.html

FileSize -Shrinking Log in SQL Server 2000 with DBCC SHRINKFILE
http://www.support.microsoft.com/?id=272318

|||

This is a common problem in sql server. You need to understand few things in sql server like Recovery model, Transaction log physical architecture, How to keep the TL size under control and how to shrink the transaction log. If you are not taking Transaction log backup and you don't need to recover to a point in time ... then first thing you should do is change the recovery model to simple... If you want to have point in time recovery (STOPAT) then you should schedule the transaction log backup more frequently to keep the size within limit. Now since the log size is grwon over a period of time and if you need to reduce the size then follow these steps

(a)

backup log Somedatabase with truncate_only -- This statement will mark inactive part of log

(b) dbcc shrinkfile(DevGrantPlan_Log) -- This statement will release the marked inactive space to OS

(c) soon after this , the first step you must do is to backup the database. otherwise the backup chain is broken and you will not be able to use the TL backup for recovery

read the article mentioned by Arnie and it will give you more clear picture

Madhu