Disable Indexes

May 30, 2007

Hello all.

Could anyone advise me how to disable indexes on a specific table at the start of a script, then re-enable them at the end?

Thanks all.

View 5 Replies


ADVERTISEMENT

SQL Server 2012 :: Rule Of Thumb When To Disable Indexes?

Jun 19, 2014

It's often said or done that when inserting or updating into a 'large' table that disabling the non-clustered indexes can is needed for performance.

Now I know the obvious way to find out if this is best or not is by testing the different options. I was wondering if there was a rule of thumb to this?

Say you have a table with half a billion rows and 4 non-clustered indexes and are only updating half a million rows then sometimes disabling every night and re-enabling can take way more time than the actual update. Haven't found an articles advising to disable them when a table is over X rows and you are updating Y% of them...

View 5 Replies View Related

Removal Of Selected Indexes / Script Index Create For List Of Indexes

Jul 1, 2014

I'm working to improve performance on a database I've inherited, and there are several thousand indexes. I've got a list of ones which should definitely exist within the database, and I'm looking to strip out all the others and start fresh, though this list is still quite large (1000 or so).

Is there a way I can remove all the indexes that are not in my list without too much trouble? I.e. without having to manually go through them all individually. The list is currently in a csv file.

I'm looking to either automate the removal of indexes not in the list, or possibly to generate the Create statements for the indexes on the list and simply remove all indexes and then run these statements.

As an aside, when trying to list all indexes in the database, I've found various scripts to do this, but found they all seem to produce differing results. What is the best script to list all indexes?

View 5 Replies View Related

A Question About Clustered Indexes Forcing Rebuild Of Non-clustered Indexes.

Sep 18, 2007

So I'm reading http://www.sql-server-performance.com/tips/clustered_indexes_p2.aspx and I come across this:
When selecting a column to base your clustered index on, try to avoid columns that are frequently updated. Every time that a column used for a clustered index is modified, all of the non-clustered indexes must also be updated, creating additional overhead. [6.5, 7.0, 2000, 2005] Updated 3-5-2004
Does this mean if I have say a table called Item with a clustered index on a column in it called itemaddeddate, and several non-clustered indexes associated with that table, that if a record gets modified and it's itemaddeddate value changes, that ALL my indexes on that table will get rebuilt? Or is it referring to the table structure changing?
If so does this "pseudocode" example also cause this to occur:
sqlstring="select * from item where itemid=12345"
rs.open sqlstring, etc, etc, etc
rs.Fields("ItemName")="My New Item Name"
rs.Fields("ItemPrice")=1.00
rs.Update
Note I didn't explicitly change the value of rs.fields("ItemAddedDate")...does rs.Fields("ItemAddedDate")=rs.Fields("ItemAddedDate") occur implicitly, which would force the rebuild of all the non-clustered indexes?

View 4 Replies View Related

SQL Server 2008 :: Logic To Rebuild Only Clustered Indexes / Skipping To Rebuild Non Clustered Indexes In Same Table

Jun 25, 2015

I have a requirement to only rebuild the Clustered Indexes in the table ignoring the non clustered indexes as those are taken care of by the Clustered indexes.

In order to do that, I have taken the records based on the fragmentation %.

But unable to come up with a logic to only consider rebuilding the clustered indexes in the table.

create table #fragmentation
(
FragIndexId BigInt Identity(1,1),
--IDENTITY(int, 1, 1) AS FragIndexId,
DBNAME nvarchar(4000),
TableName nvarchar(4000),

[Code] ....

View 5 Replies View Related

Indexes Vs Clustered Indexes

Sep 17, 2006

What is the difference please?

View 1 Replies View Related

Can We Disable A Trigger In SQL 7.0

Jun 14, 2002

Is there a way to disable trigger for a time window and enable it when desired.

View 1 Replies View Related

Disable Trigger

Jul 12, 2001

Is it possible to disable a trigger to manually manipulate data without completely removing it? Thank you.

View 2 Replies View Related

Disable Identity

Oct 26, 2000

A quick question, how can I disable identity for the identity column
without dropping that column? Thanks!
Xiao

View 1 Replies View Related

Disable Logs

Aug 28, 2000

Is there a way to disable logging ?
I'm about to split a 1000000 rows table into three other tables , and would prefere not to log this action ...
Does anyone know how to do it in a SQL 7.0 statement ?

View 1 Replies View Related

Disable Triggers

Nov 21, 2001

I don't seem to be able to find a command to disable triggers. Can this
be done in SQL7?

Thanks.

View 1 Replies View Related

Disable Trigger

May 11, 2001

Is it possible to disable a trigger in SQL Server 6.5?
Is so, how can i do that?

View 1 Replies View Related

How To Disable Locking?!?

Apr 2, 1999

read-only option
dbo-use option
...

Anyone any ideas ?!?

View 3 Replies View Related

Disable Trigger

Oct 25, 2004

Hi,

can I disable a trigger in Sqlserver 2000??? When i run a store procedure who works with one table i want that the trigger doesn´t work it. After that the trigger would be enabled again.

I know i can delete it and create it again but something like "ALTER TRIGGER DISABLED" would be ok.

Thanks.

View 6 Replies View Related

Disable Trigger

Mar 23, 2004

Sorry, may be it is very simple, but
how can I disable all trigger on a tabled under sql 2000

View 3 Replies View Related

SQL 2012 :: CDC Is Disable

May 20, 2014

CDC is disabling when we do bulkinsertsupdateschange schema .how to findout why CDC disabled and how to prevent it ?

View 3 Replies View Related

Is There Any Way To Disable The Primary Key ..?

Feb 24, 2007

Hi,

Is there any way to disable the primary key constraint?.I want to move the records from one table to another.say column 'x' in the source table doesnt contain a primay key.But my target table column 'x' contains primay key.
How to ovecome this problem?
Thanks in advance

View 2 Replies View Related

Disable DatabaseMail90.exe

Feb 28, 2008

I am looking for a way to disable DatabaseMail90.exe (temporarily) while still allowing emails to queue up.

At first, I thought the solution was sysmail_stop_sp... but if I use this... calls to sp_send_DBMail fail with the following message:

Mail not queued. Database Mail is stopped. Use sysmail_start_sp to start Database Mail.

I'd like the emails to be queued... I just want to postpone sending them. Anyone know how to do this?

- Alan D. Nelson

View 2 Replies View Related

Is It Possible To Disable All Restrictions On A Ms Sql DB?

Jul 20, 2005

In meen. primary keys, NOT NULL, IDENTETIES...et.cI have to do a maunally, one time, building of a database. Sometables has tostay an some are to be exchanged. The foreignkey inforcemnt ill do for myself so everything is correct. I just need to be allowed to de thede taskfor a while. Is it impossible?RegardsAnders

View 1 Replies View Related

Not Able To Disable Users

May 6, 2008

I am trying to disable certain users, but it is giving me this error. I am able to disable some accounts, but not all of them. It seems to happen with user that have been recently created.


TITLE: Microsoft SQL Server Management Studio
------------------------------

Disable Login. failed for Login 'domainuser'. (Microsoft.SqlServer.Smo)

For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=9.00.3042.00&EvtSrc=Microsoft.SqlServer.Management.Smo.ExceptionTemplates.FailedOperationExceptionText&EvtID=Disable+Login.+Login&LinkId=20476

------------------------------
ADDITIONAL INFORMATION:

An exception occurred while executing a Transact-SQL statement or batch. (Microsoft.SqlServer.ConnectionInfo)

------------------------------

Could not obtain information about Windows NT group/user 'domainuser', error code 0x5. (Microsoft SQL Server, Error: 15404)

For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=09.00.3042&EvtSrc=MSSQLServer&EvtID=15404&LinkId=20476


The links lead to a page that is no longer available.

I read somewhere that it had to do with the SQL Server service account and that if you change it to a Domain Administrator it would and it does, but I can not believe the solution. I would say that this even started happening after we applied SQL 2005 Service Pack 2.

Has anyone else seen this problem. Do I really need to make it a Domain Administrator?

Thanks

View 1 Replies View Related

Disable Sql Authentication

Apr 29, 2008

what is the disadvantage to disable sql authentication, what is it different from window authentication

View 4 Replies View Related

Trigger Disable

Aug 9, 2007

Sorry to reopen a post, but I'm having the same problem. Worse, I can't change the trigger code right now.

My concerns with disabling triggers are:

1) DISABLE TRIGGER affects all sessions, not just the session doing the mass load
2) DISABLE TRIGGER is permanant until re-enabled, so if the mass load process fails (and if our TRY/CATCH blocks aren't perfect), then the triggers would remain disabled for normal OLTP use.
Any ideas on ways around this? I can identify all the work the triggers would have done and do it on my own. The problem is getting them not to do it!

View 9 Replies View Related

Disable Grouping

Aug 20, 2007

I would like to be able to disable grouping depending on the value of parameter. At the moment I have the following expression for grouping:
=IIf(Parameters!Group2.Value.equals(""), false, Fields(Parameters!Group2.Value).Value)

What I am trying to do is if the value of the Group2 parameter = "" turn off grouping. Group2 is assigned a value from the following custom code:

Function Group2Value() As String
Dim Group As String
Group = ""
Select Case Report.Parameters!ReportType.Value
Case "1"

Group = ""
Case "2"

Group = "CategoryID"
Case "3"

Group = "StockFamilyID"
Case "4"

Group = "GroupID"
Case "5"

Group = ""
Case "6"

Group = "SaleableGLCodeID"
End Select
Return Group
End Function

However this is not working.

Can grouping be disabled and if so what am I doing wrong?

Thanks in advance.

View 3 Replies View Related

Disable Filter

Nov 11, 2006

i am having a query in front end like this..

func()

select * from table where cond1 and cond2 and col.port in <string> ... goes

end

i passing this string from other function, i may be not be needing this filter(underlined) for some functionality, but i will be using the same function for both the functionalities

i need a string that should tell the sql server to allow all the possible values for that column, so by disabling the filter which i am using...

pls tell me URGENT
Thanks in advance

View 2 Replies View Related

How To Disable Export

Feb 1, 2006

Hello, I am making a web application and I will show reports with the reportviewer, however the user can manage some parameters of the applicacion, the administrator can decide if he wants to allow the user to export or not export to PDF or XLS.

Anyway, I want to enable or disable those options in the reportview dinamically!

Is that possible??

View 12 Replies View Related

Disable Trans. Replication - HELP!

Mar 20, 2000

Hi,

I am trying to disable transactional replication, but am having some problems. I used the wizard, however, it has taken 7 hours so far and is still not done. SQL Server (7.0) is showing the connection as runnable but it seems as if nothing is being removed. Am I missing something? Should I have done something else before running the wizard? I can't even kill the SPID.

Can anyone help or offer some advice?

Thanks in advance...

View 1 Replies View Related

Disable SQL Guest Account

Jan 17, 2001

How do you disable Guest account in SQL Server.
can you do this thru registry?

Tahnk You,
Piyush Patel

View 3 Replies View Related

Can Not Disable Replication In SQL7

Oct 24, 2000

Hi, guys

I have an urgent problem in replication.

Yesterday I set up a Transaction replication with 1 publication
Server A (publisher)(push)(SQL 7)
Server B (distributor and subscriber)(SQL 7)

The replication was succesful and the suscriber can get correct data.

This morning I found the Red sigh in replication mornitor/miscellaneous agents.The error message is:
"The job failed. Unable to determine if the owner (domain nameuser ID) of job Agent history clean up: distribution has server access (reason: Could not obtain information about Windows NT group/user 'domain name'. [SQLSTATE 42000] (Error 8198))."

I tried to use the 'disable publishing and distribution wizard' to disable this replication, but it did not finish and the screen jusr freeze. I used the task manager to end the task.

then I check the replication monitor, the publication was gone but the RED sigh still there.

I tried to use sp_dropdistpublisher to drop a Publisher
but it said "the server A is not a distributor"

I tried to use sp_dropdistributiondb to delete the distribution database.
but it said "Could not drop the distribution database 'distribution'.
This distributor database is associated with a Publisher."

I tried to use sp_dropdistributor to remove the Distributor .
but it said "Could not drop the Distributor 'Server B'.
This Distributor has associated distribution databases."

Any suggestion? Thank you in advance.

Theresa

View 2 Replies View Related

Disable Specific Trigger

Jul 26, 2004

I have a dilema, I need to have a delete trigger enabled to track user deletes to update an external history table. However, when the posting process runs for the table for which the delete trigger runs, all the records from that table are deleted. Th end result is that instead of capturing the specific deletes, it shows all recods being deleted. I know you can disable foreign keys and triggers as a whole, can you do it for specific triggers?

View 1 Replies View Related

Windows Policy (disable)

May 23, 2007

What is the best way to disable using the Windows policy requirements when creating a new login?

example: I'm trying to create a login and the password doesn't meet the windows policy requirements. The easy thing to do would be to create a strong password. This isn't an option at the moment. I need to disable this so I can create new users that dont have strong passwords.

Thanks!

View 1 Replies View Related

How To Disable A Trigger In Duration?

Feb 21, 2005

Hello, everyone:

There is a trigger to monitor the modification on a table, and it turn on. For a special duration, I need to turn off this trigger to modify the table. And then turn on the trigger again.

Any help will be appreciated.

Thanks

ZYT

View 2 Replies View Related

Disable Jobs With TSQL

Dec 9, 2005

Does anyone know how to disable and re-enable jobs using tsql?

View 1 Replies View Related

How To Enable And Disable The Identity

Nov 17, 2006

Hello there :-)

Kindly help me find the answer on how to enable and disable the identity of a field on a table via SQL Script?

Thanks :-)

View 1 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved