Thursday, March 29, 2012
Alternate ways of deleting records - without logging
I'm looking for an alternate solution to delete rows from a temporary table.
Now, when the users run reports, the data belonging to each user is stored
in a temporary table, having an userid attached to each row.
Before starting a new report, the program issues a delete command like:
delete tmptable where usr = 123 to prepare the table for the new report.
This table grows very large, it can have 1.5..2 million records per user.
The problem I'm having is that the delete operation times out.
And also the log file grows very fast.
I changed the timeout to 10 minutes - values above this seem unreasonable
long to me...
I checked the TRUNCATE TABLE command - it works fast, it doesn't write info
to the log - but it doesn't have a where clause... so it would wipe out
information belonging to other users.
The temporary table is not bound in any FK references.
It has a clustered index built on the usrid field.
Is there any way of deleting records using DELETE command, but without
writing info to the log ? I mean, I know for sure this data is not so
important as to be logged when deleted...
Please help !
Thank you for any suggestion !
Andrei.All DELETE statements are logged and there is no way around that. The
"temp" table that you mention is actually a permanent table. Have you
considered going with an actual temp table - one whose name begins with#?
That would allow you to truncate the entire table (unlogged) without
affecting other users.
Tom
----
Thomas A. Moreau, BSc, PhD, MCSE, MCDBA
SQL Server MVP
Toronto, ON Canada
.
"Andrei" <andrei.toma@.era-environmental.com> wrote in message
news:O5FmFwWmGHA.4816@.TK2MSFTNGP03.phx.gbl...
Hi Group,
I'm looking for an alternate solution to delete rows from a temporary table.
Now, when the users run reports, the data belonging to each user is stored
in a temporary table, having an userid attached to each row.
Before starting a new report, the program issues a delete command like:
delete tmptable where usr = 123 to prepare the table for the new report.
This table grows very large, it can have 1.5..2 million records per user.
The problem I'm having is that the delete operation times out.
And also the log file grows very fast.
I changed the timeout to 10 minutes - values above this seem unreasonable
long to me...
I checked the TRUNCATE TABLE command - it works fast, it doesn't write info
to the log - but it doesn't have a where clause... so it would wipe out
information belonging to other users.
The temporary table is not bound in any FK references.
It has a clustered index built on the usrid field.
Is there any way of deleting records using DELETE command, but without
writing info to the log ? I mean, I know for sure this data is not so
important as to be logged when deleted...
Please help !
Thank you for any suggestion !
Andrei.|||Hi Tom and thanks for the fast answer !
You mentioned correctly that this is actually a permanent table - it's only
temporary from the point of view of the reporting action... we're so used to
call them temporary that it went out like this.
The problem is that I'm further using the "temporary" table in the report
generation and the report queries are based on this table... I don't see a
way of using different #tmp tables, belonging to different users, in the
same report...
Any ideas ?
Thank you !
"Tom Moreau" <tom@.dont.spam.me.cips.ca> wrote in message
news:uIlKRzWmGHA.3300@.TK2MSFTNGP05.phx.gbl...
> All DELETE statements are logged and there is no way around that. The
> "temp" table that you mention is actually a permanent table. Have you
> considered going with an actual temp table - one whose name begins with#?
> That would allow you to truncate the entire table (unlogged) without
> affecting other users.
> --
> Tom
> ----
> Thomas A. Moreau, BSc, PhD, MCSE, MCDBA
> SQL Server MVP
> Toronto, ON Canada
> .
> "Andrei" <andrei.toma@.era-environmental.com> wrote in message
> news:O5FmFwWmGHA.4816@.TK2MSFTNGP03.phx.gbl...
> Hi Group,
> I'm looking for an alternate solution to delete rows from a temporary
> table.
> Now, when the users run reports, the data belonging to each user is stored
> in a temporary table, having an userid attached to each row.
> Before starting a new report, the program issues a delete command like:
> delete tmptable where usr = 123 to prepare the table for the new report.
> This table grows very large, it can have 1.5..2 million records per user.
> The problem I'm having is that the delete operation times out.
> And also the log file grows very fast.
> I changed the timeout to 10 minutes - values above this seem unreasonable
> long to me...
> I checked the TRUNCATE TABLE command - it works fast, it doesn't write
> info
> to the log - but it doesn't have a where clause... so it would wipe out
> information belonging to other users.
> The temporary table is not bound in any FK references.
> It has a clustered index built on the usrid field.
> Is there any way of deleting records using DELETE command, but without
> writing info to the log ? I mean, I know for sure this data is not so
> important as to be logged when deleted...
> Please help !
> Thank you for any suggestion !
> Andrei.
>
>|||That's a toughie. The only other suggestion is to delete in chunks, say
10,000 rows at a time.
Tom
----
Thomas A. Moreau, BSc, PhD, MCSE, MCDBA
SQL Server MVP
Toronto, ON Canada
.
"Andrei" <andrei.toma@.era-environmental.com> wrote in message
news:uaBp1%23WmGHA.2120@.TK2MSFTNGP05.phx.gbl...
Hi Tom and thanks for the fast answer !
You mentioned correctly that this is actually a permanent table - it's only
temporary from the point of view of the reporting action... we're so used to
call them temporary that it went out like this.
The problem is that I'm further using the "temporary" table in the report
generation and the report queries are based on this table... I don't see a
way of using different #tmp tables, belonging to different users, in the
same report...
Any ideas ?
Thank you !
"Tom Moreau" <tom@.dont.spam.me.cips.ca> wrote in message
news:uIlKRzWmGHA.3300@.TK2MSFTNGP05.phx.gbl...
> All DELETE statements are logged and there is no way around that. The
> "temp" table that you mention is actually a permanent table. Have you
> considered going with an actual temp table - one whose name begins with#?
> That would allow you to truncate the entire table (unlogged) without
> affecting other users.
> --
> Tom
> ----
> Thomas A. Moreau, BSc, PhD, MCSE, MCDBA
> SQL Server MVP
> Toronto, ON Canada
> .
> "Andrei" <andrei.toma@.era-environmental.com> wrote in message
> news:O5FmFwWmGHA.4816@.TK2MSFTNGP03.phx.gbl...
> Hi Group,
> I'm looking for an alternate solution to delete rows from a temporary
> table.
> Now, when the users run reports, the data belonging to each user is stored
> in a temporary table, having an userid attached to each row.
> Before starting a new report, the program issues a delete command like:
> delete tmptable where usr = 123 to prepare the table for the new report.
> This table grows very large, it can have 1.5..2 million records per user.
> The problem I'm having is that the delete operation times out.
> And also the log file grows very fast.
> I changed the timeout to 10 minutes - values above this seem unreasonable
> long to me...
> I checked the TRUNCATE TABLE command - it works fast, it doesn't write
> info
> to the log - but it doesn't have a where clause... so it would wipe out
> information belonging to other users.
> The temporary table is not bound in any FK references.
> It has a clustered index built on the usrid field.
> Is there any way of deleting records using DELETE command, but without
> writing info to the log ? I mean, I know for sure this data is not so
> important as to be logged when deleted...
> Please help !
> Thank you for any suggestion !
> Andrei.
>
>|||I'm sure this is not a good solution, but you could change your database
recovery to simple.
--
If you are looking for SQL Server examples check out my Website at
http://www.geocities.com/sqlserverexamples
"Andrei" wrote:
> Hi Group,
> I'm looking for an alternate solution to delete rows from a temporary tabl
e.
> Now, when the users run reports, the data belonging to each user is stored
> in a temporary table, having an userid attached to each row.
> Before starting a new report, the program issues a delete command like:
> delete tmptable where usr = 123 to prepare the table for the new report.
> This table grows very large, it can have 1.5..2 million records per user.
> The problem I'm having is that the delete operation times out.
> And also the log file grows very fast.
> I changed the timeout to 10 minutes - values above this seem unreasonable
> long to me...
> I checked the TRUNCATE TABLE command - it works fast, it doesn't write inf
o
> to the log - but it doesn't have a where clause... so it would wipe out
> information belonging to other users.
> The temporary table is not bound in any FK references.
> It has a clustered index built on the usrid field.
> Is there any way of deleting records using DELETE command, but without
> writing info to the log ? I mean, I know for sure this data is not so
> important as to be logged when deleted...
> Please help !
> Thank you for any suggestion !
> Andrei.
>
>
>|||Alternatively you could put the table in a database by itself and then set
that database to simple recover mode.
--
If you are looking for SQL Server examples check out my Website at
http://www.geocities.com/sqlserverexamples
"Greg Larsen" wrote:
> I'm sure this is not a good solution, but you could change your database
> recovery to simple.
> --
> If you are looking for SQL Server examples check out my Website at
> http://www.geocities.com/sqlserverexamples
>
> "Andrei" wrote:
>|||Deletes are still logged in simple mode.
This solution depends on what the OP wants. If he wants the operation to be
as fast as a truncate, simple mode won't help. If he wants to make sure the
log doesn't fill up during the delete, simple won't help.
--
HTH
Kalen Delaney, SQL Server MVP
"Greg Larsen" <gregalarsen@.removeit.msn.com> wrote in message
news:45C04641-98F9-4E3C-BD5F-FFF19610F15D@.microsoft.com...
> Alternatively you could put the table in a database by itself and then set
> that database to simple recover mode.
> --
> If you are looking for SQL Server examples check out my Website at
> http://www.geocities.com/sqlserverexamples
>
> "Greg Larsen" wrote:
>|||Thank you, Tom, I'm going to try that.
Still leaves me with a big log file :(
I guess I'll have to clear it more often...
Andrei.
"Tom Moreau" <tom@.dont.spam.me.cips.ca> wrote in message
news:%23YLmjBXmGHA.4076@.TK2MSFTNGP03.phx.gbl...
> That's a toughie. The only other suggestion is to delete in chunks, say
> 10,000 rows at a time.
> --
> Tom
> ----
> Thomas A. Moreau, BSc, PhD, MCSE, MCDBA
> SQL Server MVP
> Toronto, ON Canada
> .
> "Andrei" <andrei.toma@.era-environmental.com> wrote in message
> news:uaBp1%23WmGHA.2120@.TK2MSFTNGP05.phx.gbl...
> Hi Tom and thanks for the fast answer !
> You mentioned correctly that this is actually a permanent table - it's
> only
> temporary from the point of view of the reporting action... we're so used
> to
> call them temporary that it went out like this.
> The problem is that I'm further using the "temporary" table in the report
> generation and the report queries are based on this table... I don't see a
> way of using different #tmp tables, belonging to different users, in the
> same report...
> Any ideas ?
> Thank you !
>
>
>
> "Tom Moreau" <tom@.dont.spam.me.cips.ca> wrote in message
> news:uIlKRzWmGHA.3300@.TK2MSFTNGP05.phx.gbl...
>|||Ouch! That's a very unwieldly design issue.
Based upon your reply, it may be that your only viable option is DELETE
(which is logged).
Arnie Rowland, YACE*
"To be successful, your heart must accompany your knowledge."
*Yet Another certification Exam
"Andrei" <andrei.toma@.era-environmental.com> wrote in message
news:uaBp1%23WmGHA.2120@.TK2MSFTNGP05.phx.gbl...
> Hi Tom and thanks for the fast answer !
> You mentioned correctly that this is actually a permanent table - it's
> only temporary from the point of view of the reporting action... we're so
> used to call them temporary that it went out like this.
> The problem is that I'm further using the "temporary" table in the report
> generation and the report queries are based on this table... I don't see a
> way of using different #tmp tables, belonging to different users, in the
> same report...
> Any ideas ?
> Thank you !
>
>
>
> "Tom Moreau" <tom@.dont.spam.me.cips.ca> wrote in message
> news:uIlKRzWmGHA.3300@.TK2MSFTNGP05.phx.gbl...
>|||Thank you, Greg and Kalen.
I need to get both of them - don't we all ? :) - less delete time and
smaller log size but in this specific order...
Thank you !
"Kalen Delaney" <replies@.public_newsgroups.com> wrote in message
news:ORvK%23LXmGHA.464@.TK2MSFTNGP05.phx.gbl...
> Deletes are still logged in simple mode.
> This solution depends on what the OP wants. If he wants the operation to
> be as fast as a truncate, simple mode won't help. If he wants to make sure
> the log doesn't fill up during the delete, simple won't help.
> --
> HTH
> Kalen Delaney, SQL Server MVP
>
> "Greg Larsen" <gregalarsen@.removeit.msn.com> wrote in message
> news:45C04641-98F9-4E3C-BD5F-FFF19610F15D@.microsoft.com...
>
Friday, February 24, 2012
Already open DataReader Error
I am getting the following error when running some of my reports that use a Report Model on a recently built Windows 2003 R2 server with SQL Server 2005 SP2 intalled. The reports run fine our SQL Server 2005 RTM server.
W3wp!webserver!7!01/09/2007-12:57:58:: e
ERROR: Reporting Services
error Microsoft.ReportingServices.Diagnostics.Utilities.RSException:
An error has occurred during report processing. > Microsoft.ReportingServices.ReportProcessing.ProcessingAbortedException: An error has occurred during report processing. > System.InvalidOperationException:
There is already an open DataReader associated with this Command which must be closed first.
Any help would be appreciated.
Rick
HI Rick,
Did you manage to get a solution for this? I am experiencing the very same problem.
Already open DataReader Error
I am getting the following error when running some of my reports that use a Report Model on a recently built Windows 2003 R2 server with SQL Server 2005 SP2 intalled. The reports run fine our SQL Server 2005 RTM server.
W3wp!webserver!7!01/09/2007-12:57:58:: e
ERROR: Reporting Services
error Microsoft.ReportingServices.Diagnostics.Utilities.RSException:
An error has occurred during report processing. > Microsoft.ReportingServices.ReportProcessing.ProcessingAbortedException: An error has occurred during report processing. > System.InvalidOperationException:
There is already an open DataReader associated with this Command which must be closed first.
Any help would be appreciated.
Rick
HI Rick,
Did you manage to get a solution for this? I am experiencing the very same problem.
allows blank value for integer Parameter
Hi have a problem to solve and I hope that this is not a SSRS Bug.
I created a Reports(using SQL Server Project) which has several parameters which values are passed to a SP.
One of these parameter is an Integer and it is an optional value, so if the user fill it is used by the SP, otherwise the SP uses NULL and run anyway.
I starts to define tha parameter:
Datatype = integer
Allow blank value
Available: Non queried
Default: Null
if I want to Preview the report I have to provide an integer to the parameter's field ...
If for instance I set:
Default: Not queried = 0
In the moment I deploy and I use the ReportViewer in my window application the parameter's field is unabled!!
So I tried this solution:
Datatype = integer
Allow blank value
Allow null value
Available: Non queried
Default: Null
In the preview the checkbox: NULL is checked and I click on the View Report.
But when I deploy it,in the ReportViewer in my window application the parameter's field this checkbox is unchecked.
Do I forget something during my setting?I have to control it programmatically?
N.B. By default the user will not user this parameter so the best is that he can click directly on "View Report" without any additional "work" on the parameter!!
Thank you for any help!
hi,
On the report parameters form do this please:
Add a parameter, name it to something,
choose data type integer,
mask as checked the "Allow null value",
select null as default value.
It was working on that way on my box as you wished. I'm using SSRS 2005 wih SP2
Regards,
Janos
Allowing users to type in characters in a drop down list?
is this even possible in reporting services? I already deployed reports for our client using Reporting Services 2000, one of their complaints was that the dropdownlist of the reports contains a very long list of data, this list cannot be shorten since all data are required. Is there a way to let the users type in characters, not only one character to find the exact data they want. The data in the drop down list are needed because these data are parameters.
Are there any web based reporting tools which can provide this kind of requirement?
Reporting Services utilises standard HTML controls (apart from multi-value parameters). The only typing supported in a html drop-down is by first letter.
You could come up with a 2 dependant parameter approach, where users type into a textbox and the dropdown list filters based on the pattern typen into the textbox. This however would not happen as they type, they would need to leave focus from the textbox which would then postback and do the filtering server-side.
The only other option is to code your own parameter UI.
Monday, February 13, 2012
Allow authenticated access without a log on
and a web page with hyperlinks to the reports
(i.e. /Reports/Pages/Report.aspx?ItemPath=%2fReports%2MyReport).
This is on an Intranet and users who have not authenticated against the
domain get a username and password prompt (as we would expect).
I turns out that none of the users will authenticated and so they will all
get the log on prompt.
Is there any way to avoid the log in prompt ? (a simple way - I know I can
Implement my own Security Extension - but this is overkill for my needs).
I can't use anonymous access as different groups of people need to see
different reports (and be denied access to the others).
There are 4 groups and I already know which group each user is in. ( they do
a forms based sign in to a gateway application first)
Is it possible for instance to pass a username and password to a report and
have it authenticate that way ?
Someone suggested using the API:
dim lgn as new
Microsoft.SqlServer.ReportingServices2005.ReportingService2005()
lgn.LogonUser("Myusername" , "myPassword" , "" )
Is this possible ? if so how would the report then be launched ?
I don't mind hard coding a generic username and password in the asp.net code
behind for the page. ( I can set up 4 generic accounts, one for each group).
--
MartyYou should be able to do this. If the user is logged in to your PC in the
same domain as the RS server then they should not be prompted.
Anything special about the server? I.e. is it a domain controller. Is it
running sharepoint? Does it have a fixed IP address?
I ask about the fixed IP address because I saw this problem once when I had
a test server that was using DHCP.
Also, try adding your domain users and groups to a local group and then use
that local group when setting up your roles.
--
Bruce Loehle-Conger
MVP SQL Server Reporting Services
"Marty" <smarty@.community.nospam> wrote in message
news:9B1A741B-88BB-494A-AA71-67C058D8C7D7@.microsoft.com...
>I have reporting services set up and working, using Windows Authentication
> and a web page with hyperlinks to the reports
> (i.e. /Reports/Pages/Report.aspx?ItemPath=%2fReports%2MyReport).
> This is on an Intranet and users who have not authenticated against the
> domain get a username and password prompt (as we would expect).
> I turns out that none of the users will authenticated and so they will all
> get the log on prompt.
> Is there any way to avoid the log in prompt ? (a simple way - I know I can
> Implement my own Security Extension - but this is overkill for my needs).
> I can't use anonymous access as different groups of people need to see
> different reports (and be denied access to the others).
> There are 4 groups and I already know which group each user is in. ( they
> do
> a forms based sign in to a gateway application first)
> Is it possible for instance to pass a username and password to a report
> and
> have it authenticate that way ?
> Someone suggested using the API:
> dim lgn as new
> Microsoft.SqlServer.ReportingServices2005.ReportingService2005()
> lgn.LogonUser("Myusername" , "myPassword" , "" )
> Is this possible ? if so how would the report then be launched ?
> I don't mind hard coding a generic username and password in the asp.net
> code
> behind for the page. ( I can set up 4 generic accounts, one for each
> group).
> --
> Marty|||"Also, try adding your domain users and groups to a local group and then use
that local group when setting up your roles."
Ah but my issue is that the users have not logged in to the domain when they
use my application. If I get them to log in to the domain first (as a test)
it all works seamlessley, with no prompts. However this is not how they
normally work (don't ask !).|||On Jan 8, 3:13=A0am, Marty <sma...@.community.nospam> wrote:
> "Also, try adding your domain users and groups to a local group and then u=se
> that local group when setting up your roles."
> Ah but my issue is that the users have not logged in to the domain when th=ey
> use my application. If I get them to log in to the domain first (as a test=)
> it all works seamlessley, with no prompts. However this is not how they
> normally work (don't ask !).
Along the same line, is there a way to use Windows Auth to not require
the log on screen every time we open
the Reporting Services web page rpt-serv/reports? The report server
is in domain I created a local group and added
mydomain\domain users to it? Hope this did not hijack your thread
Marty :)
Bob|||Hello Smart,
Since the reporting services is designed for the windows auth, you may need
to specify the domain account and password to log on to the domain.
So it will prompt the dialog.
Sincerely yours,
Wei Lu
Microsoft Online Partner Support
=====================================================
PLEASE NOTE: The partner managed newsgroups are provided to assist with
break/fix
issues and simple how to questions.
We also love to hear your product feedback!
Let us know what you think by posting
- from the web interface: Partner Feedback
- from your newsreader: microsoft.private.directaccess.partnerfeedback.
We look forward to hearing from you!
======================================================When responding to posts, please "Reply to Group" via your newsreader so
that others
may learn and benefit from this issue.
======================================================This posting is provided "AS IS" with no warranties, and confers no rights.
======================================================|||This makes absolutely no sense. You want them to be authenticated in RS
without logging in BUT they haven't logged in period. Then how would any
system in the world know who they are?
Sorry, this is just plain silly. If you aren't logged into a domain then you
aren't logged in and you are not authenticated and there is no way to be
authenticated without logging in.
Bruce Loehle-Conger
MVP SQL Server Reporting Services
"Marty" <smarty@.community.nospam> wrote in message
news:ABBE4EB2-43DE-424F-9655-32D3FF57559D@.microsoft.com...
> "Also, try adding your domain users and groups to a local group and then
> use
> that local group when setting up your roles."
> Ah but my issue is that the users have not logged in to the domain when
> they
> use my application. If I get them to log in to the domain first (as a
> test)
> it all works seamlessley, with no prompts. However this is not how they
> normally work (don't ask !).
>
All users can edit security!
s from being able to edit security on reports/folders. I have myself set up
as Content Manager and the groups Everyone and Users set up as Browsers. C
an someone please tell me w
hat I am missing? Thanks.OOPs. Should've put this in Reporting Services area. Sorry.
"BrianW" wrote:
> I've been fighting for 2 days trying to figure out how to block general users from
being able to edit security on reports/folders. I have myself set up as Content Ma
nager and the groups Everyone and Users set up as Browsers. Can someone please tell
me
what I am missing? Thanks.