Thursday, March 29, 2012
Deleting reports
Well I want to delete them but I have no clue how. I was wondering if
anybody could either
A) walk me through how to do it.
B) point me in the direction of some sites that explain how to do it
(I'm having no luck with google this morning)
Thanks a ton for the help.
MathiasWhere do you want to delete them from?
The server or your development project?
If you want to delete them from your server, just use Report Manager. Click
on "Show Details". Mark the ones you want to delete, and click on the Delete
button.
You'll need to be Content Manager to do it though. If you don't see the
Delete button, you don't have the rights to do it, and need to log on as a
different user.
If you want to delete them from you development project, you should be able
to right click the report in the management tool, and choose Remove. This
will let you choose between Remove or Delete. Remove means to delete the
reference in your project, but still leave the rdl file in the project
folder. Delete means delete the reference and the rdl-file completely.
Kaisa M. Lindahl Lervik
"Mathias" <mathias.helbach@.gmail.com> wrote in message
news:1141308861.584476.110140@.u72g2000cwu.googlegroups.com...
> So I've got a couple of reports deployed in reporting services 2005 and
> Well I want to delete them but I have no clue how. I was wondering if
> anybody could either
> A) walk me through how to do it.
> B) point me in the direction of some sites that explain how to do it
> (I'm having no luck with google this morning)
>
> Thanks a ton for the help.
> Mathias
>|||Kaisa
Thanks for the help. That was what I was looking for.
Tuesday, March 27, 2012
deleting records
i'm guessing there is no index on the date column - so you are suffering a table scan - you'll just have to suck it up and let the delete take however long it takes.
If this will be an ongoing requirement (i.e. purge this table) - why don't you add an index?
.....gtr
|||Thanks for your response
This table was set up way before my time, but there is no index. I am still relatively new with MS Sql so am not very famililiar w/ indexing. Is this all I have to do?
CREATE INDEX IDX_Daily_snapshot_INV_File_Date
on Daily_snapshot_INV (File_Date)
After this, do I just query the table normally and it will bypass the table scan?
|||yup, that's all there is to it
.....gtr
|||>> it will bypass the table scan?<<
This is not possible to guess, but if you are only deleting a few rows, like say 10% or less (VERY ROUGH estimate) this should do the trick.
Even so, if you have 50 million rows over 2 years it is going to take a while to delete a large number of these rows regardless. If it is slow, try deleting only a small number of rows, like a days, weeks, or months worth at a time (instead of a year at a time) which will depend a lot on your hardware.
|||Thank you for your answers. I know now that indexing will help me search but unfortunately there is nothing to help the process of of the actual deletion. I am going to run a delete query in Query Analyzer over the weekend when our server is not being used.
Matt
|||Here is a small example that you can use to experiment with
And you can modify it to delete your data in batches
this code creates a table that has the au_id from the authors table
The delete query has a where clause that will delete exactly 9 rows
the code will run until @.@.rowcount =0 and it will delete in batches of 2
This of course is just to illustrate this concept but you probably want to have a much higher number perhaps 10000
use pubs
set nocount on
create table SomeTable (ID varchar(49))
insert into SomeTable
select au_id from authors
declare @.count int
select @.count = count(*) from SomeTable
print 'Count before delete == ' + convert(varchar(10),@.count)
declare @.rowcount int
set rowcount 2 --delete in batches of 2
select @.rowcount =666 --initialize to <> 0
while @.rowcount <> 0 -- do until we are done
begin
-- the table should be 9 rows less after we are done
delete SomeTable
where ID like '7%'
or ID like '8%'
select @.rowcount =@.@.ROWCOUNT
end
set rowcount 0 --very important to set this back to 0
select @.count = count(*) from SomeTable
print 'Count after delete == ' + convert(varchar(10),@.count)
set nocount off
Denis the SQL Menace
http://sqlservercode.blogspot.com/
|||Is there an advantage of doing it that way when I could do this:
DELETE FROM dbo.Daily_snapshot_INV
WHERE (File_date < CONVERT(DATETIME, '2005-04-01 00:00:00', 102))
The problem is that this probably consists of 20,000,000 rows so instead of one query to delete them all I will need to delete a month or half month at a time. Each day has about 120,000 rows. This table was created in Oct, 2004.
Like I said above, I am relatively new at SQL so any help in understanding is appreciated.
|||The advantage is that you don't have to write a lot of WHERE statements
Denis the SQL Menace
http://sqlservercode.blogspot.com/
|||Since this is the first time you are deleting from the table - yes, you are just going to have to let the thing run - deleting many rows (and logging) just plain takes time.
In the future, as this becomes a regular process (perhaps monthly) the index will help a great deal.
.....gtr
Friday, February 24, 2012
DELETE rows involving auto-increment fields
which is auto-incremented(IDENTITY) . But, after deletion... when I
tried to insert new records, the ID field gets incremented from
previous next value (before deletion). Is there any way to get around
this? Plz helpLookup DBCC CHECKIDENT
example:
Force the current identity value to 30
This example forces the current identity value in the jobs table to a
value of 30.
USE pubs
GO
DBCC CHECKIDENT (jobs, RESEED, 30)
http://sqlservercode.blogspot.com/|||"juventus" <saurabh.kotkar@.gmail.com> wrote in message
news:1140806282.998562.62590@.j33g2000cwa.googlegroups.com...
>I tried to delete a couple of records from a table which has a ID field
> which is auto-incremented(IDENTITY) . But, after deletion... when I
> tried to insert new records, the ID field gets incremented from
> previous next value (before deletion). Is there any way to get around
> this? Plz help
>
First of all, a lot of things can happen that may cause gaps in Identity.
You have found one. Rolled back transactions are another.
SQL only guarantees that the values will be incremental.
See DBCC Checkident in Books On-Line.|||Thanks a lot man..! It worked. I was able to reseed the increment
value..|||Confirm that you have a unique index or constraint on this column. I think
it may be possible for SQL Server to repeat sequences of identity numbers if
the maximum value for data type is reached or as a result of reseeding to a
value less than the current highest value.
"juventus" <saurabh.kotkar@.gmail.com> wrote in message
news:1140808374.186842.221090@.u72g2000cwu.googlegroups.com...
> Thanks a lot man..! It worked. I was able to reseed the increment
> value..
>
DELETE rows in MSDE
DELETE FROM table1 WHERE projektID=5
there are 500000 rows that has projektID=5.. and when i run the query the hardrive is working for a couple of minutes and then stops. and NOTHING has happened. not a single row has been deleted?.. cant the DELETE statement handle that many rows or?. or is there another way i can delete these rows?.yeah, it can handle that. I've deleted more than 500,000 rows before (sometimes by accident!)
DELETE table1 WHERE projektID = 5
are you running this from query analyzer or from ASP.NET?|||im running it from asp.net, there is no query analyser for MSDE.
but it doesnt happen anything when do it, except for my harddrive gets occupied for 10 min or so.|||> there is no query analyser for MSDE.
sort of. MSDE being the SQL engine, you can connect to it with SQL Server client tools, and many people do.
do me a favour. install the 180 day SQL Server trial - client tools only. then run it through QA
Sunday, February 19, 2012
Delete records permission
I have a couple of tables in a SQL Server 2005 database back end and I want
to delete some records through a query from a MS
Access 2003 front end. I get an error in MS Access saying "Could not delete
from specified tables". There are multiple users of the
back end and each one logs in to SQL Server using Windows Authentication. Ea
ch user has the db_datareader and db_datawriter
permissions checked for the database role membership. SELECT queries work an
d I can see the contents of the tables but the DELETE
query cannot run from MS Access. I have a feeling I need to set up more perm
issions. Does anyone know how to get this working?
Cheers,
Max.Max,
Does the table you are trying to delete from have a primary key? If not, you
may need to add one.
-- Bill
"Max" <maxy_100@.yahoo.com> wrote in message
news:OyWc3GOMHHA.140@.TK2MSFTNGP04.phx.gbl...
> Hello,
> I have a couple of tables in a SQL Server 2005 database back end and I
> want to delete some records through a query from a MS
> Access 2003 front end. I get an error in MS Access saying "Could not
> delete from specified tables". There are multiple users of the
> back end and each one logs in to SQL Server using Windows Authentication.
> Each user has the db_datareader and db_datawriter
> permissions checked for the database role membership. SELECT queries work
> and I can see the contents of the tables but the DELETE
> query cannot run from MS Access. I have a feeling I need to set up more
> permissions. Does anyone know how to get this working?
> Cheers,
> Max.
>
Delete records permission
I have a couple of tables in a SQL Server 2005 database back end and I want to delete some records through a query from a MS
Access 2003 front end. I get an error in MS Access saying "Could not delete from specified tables". There are multiple users of the
back end and each one logs in to SQL Server using Windows Authentication. Each user has the db_datareader and db_datawriter
permissions checked for the database role membership. SELECT queries work and I can see the contents of the tables but the DELETE
query cannot run from MS Access. I have a feeling I need to set up more permissions. Does anyone know how to get this working?
Cheers,
Max.Max,
Does the table you are trying to delete from have a primary key? If not, you
may need to add one.
-- Bill
"Max" <maxy_100@.yahoo.com> wrote in message
news:OyWc3GOMHHA.140@.TK2MSFTNGP04.phx.gbl...
> Hello,
> I have a couple of tables in a SQL Server 2005 database back end and I
> want to delete some records through a query from a MS
> Access 2003 front end. I get an error in MS Access saying "Could not
> delete from specified tables". There are multiple users of the
> back end and each one logs in to SQL Server using Windows Authentication.
> Each user has the db_datareader and db_datawriter
> permissions checked for the database role membership. SELECT queries work
> and I can see the contents of the tables but the DELETE
> query cannot run from MS Access. I have a feeling I need to set up more
> permissions. Does anyone know how to get this working?
> Cheers,
> Max.
>