Showing posts with label inserts. Show all posts
Showing posts with label inserts. Show all posts

Sunday, March 11, 2012

Blocking updates of a table

Hi,
I've been trying to design a way for me to issue a transaction that:
    Block all inserts on a table when row X has a certain value (call it A)
    Add a row to the table with row X containing A Add rows to another table Unblock inserts Commit transaction
Is this possible? Can anyone give me some pointers as to what to do?
Thanks in advance!

For (1) and (2)
While inserting the row that has a certain value (A), you can request a TABLOCKX. This will acquire X lock on the table and there by block other inserts by other concurrent transactions.

For (3): Is it like any other insert to another table? In that case, nothing special needs to be done

Thanks
Sunil Agarwal

|||For 3 that is what I meant.
For 1 and 2, it sounds like TABLOCKX locks the whole table exclusively (from what I can find in Books Online) - have I read it correctly? Is there any way to block other transactions from inserting rows (while the first transaction is not yet commited) when a table key column (A in my original post) is a certain value (X in my original post) - rather than just locking the whole table?
Thanks for your help!
|||For 1 and 2, it sounds like TABLOCKX locks the whole table exclusively (from what I can find in Books Online) - have I read it correctly

sunil> yes

Is there any way to block other transactions from inserting rows (while the first transaction is not yet commited) when a table key column (A in my original post) is a certain value (X in my original post) - rather than just locking the whole table?

sunila> if you only want to block inserts by other transactions under the condition you have mentioned but allow updates/selects, then there is no way.
thanks,|||I assume you only want to block Inserts but not Updates, Deletes and SELECTS.

You could try using an Insert trigger that would rollback the other transactions until a condition has been achieved.

Sunday, February 19, 2012

blank pages inserted on exported pdf and tif format

Hi,
After I export the report to PDF or TIF format, the pages became double. It
inserts a blank sheet on every page of the report. Does anyone know how to
fix this issue? Any help is appreciate it.
Thanks,
LianneLianne,
I had that problem too. Some of your report items are wider than the page.
Look on the ruler above your report page and make sure that you do not have
any report items that go to the right more than the width of your page
(usually it's 8.5 inches).
Good luck.
"Lianne Kwock" wrote:
> Hi,
> After I export the report to PDF or TIF format, the pages became double. It
> inserts a blank sheet on every page of the report. Does anyone know how to
> fix this issue? Any help is appreciate it.
>
> Thanks,
> Lianne|||Not greater than the width of the page when considering your margins plus
the ruler.
Bruce Loehle-Conger
MVP SQL Server Reporting Services
"Simon Gold" <SimonGold@.discussions.microsoft.com> wrote in message
news:862C6173-C1F9-40B2-8C4E-1B1333BEA0ED@.microsoft.com...
> Lianne,
> I had that problem too. Some of your report items are wider than the page.
> Look on the ruler above your report page and make sure that you do not
> have
> any report items that go to the right more than the width of your page
> (usually it's 8.5 inches).
> Good luck.
> "Lianne Kwock" wrote:
>> Hi,
>> After I export the report to PDF or TIF format, the pages became double.
>> It
>> inserts a blank sheet on every page of the report. Does anyone know how
>> to
>> fix this issue? Any help is appreciate it.
>>
>> Thanks,
>> Lianne|||You will also need to make sure that your report respect the following:
Body:Width > (Report:PageWidth - Report:LeftMargin -
Report:RightMargin).
A similar restriction exists for Body:Height and Report:PageHeight.
Bruce Johnson [MSFT]
Microsoft SQL Server Reporting Services
This posting is provided "AS IS" with no warranties, and confers no rights.
"Lianne Kwock" <LianneKwock@.discussions.microsoft.com> wrote in message
news:509E186D-CBBD-4725-B46C-47F175AEAA6F@.microsoft.com...
> Hi,
> After I export the report to PDF or TIF format, the pages became double.
> It
> inserts a blank sheet on every page of the report. Does anyone know how
> to
> fix this issue? Any help is appreciate it.
>
> Thanks,
> Lianne