Detect Changes On Indexes In A Published Table

Jul 27, 2006

Hi,

Regarding to my previous post at http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=553652&SiteID=1, just wondering if there's a way to detect any changes which is made on the existing indexes in a published table so that the device can determine whether reinitialization of subscrption is needed before every synchronization.

Cheers,
Justin

View 3 Replies


ADVERTISEMENT

Retrieve Fields List From A Published Report Data Model Published On The Reporting Server.

Jul 17, 2007

Can someone please tell me how to retrieve/query the list of fields from an entity of a report data model that has been published on the reporting server programmatically ?

I am trying to upload a report data model to the reporting server and planning to use that model as the data source and consume it through our existing web application?

Thank you ,

Rashid A. Khan

View 1 Replies View Related

Altering A Published Table

Feb 12, 2004

Hi! I've added a column to a published table in the Publisher using SP_REPLADDCOLUMN. After doing this the replication triggers for that table(i.e. del_%,upd_%,ins_%) are doubled both at the Publisher and at the Subscriber. If i update anyone of the column in the table at the Subscriber; i get the following error:

Server: Msg 208, Level 16, State 1, Procedure upd_3E6DE124B82D42A5AEB169557C0D757C, Line 60
Invalid object name 'ctsv_3E6DE124B82D42A5AEB169557C0D757C'.

Any ideas, what has gone wrong????

I have the following SQL setup.
Publisher: Enterprise Edition, SP3.
Subscriber: Standard-Edition, SP3.
The error is at the Subscriber.

View 5 Replies View Related

CAN NOT DROP TABLE Xxx BECAUSE IT IS PUBLISHED FOR REPLICATION

May 5, 2000

Good morning folks,
I'm getting the above error message when trying to drop a table. I'm not to familiar with the setup of this SQL server, so I not sure if the replication is enabled. I have never had to use replication so I don't know to much about it. Does anyone know how I guess to remove this table from the replication list so that it could be dropped?

Thanks much

Dom

View 1 Replies View Related

Cannot Alter Table Being Published For Replication

Jun 8, 2006

Hi all,I'm using SQL Server 2000 SP3 to store data for real time transactionprocessing.I have set up replication to another server using a push subscription togive me immediate backup.I need to alter the data type of one of the columns and am using thefollowing basic sql:alter table Voucheralter column SerialNumber varchar(20) NOT NULLHowever I keep getting this error message:Server: Msg 4929, Level 16, State 1, Line 1Cannot alter the table 'Terminals' because it is being published forreplication.Is there anything I can do to allow this update taking place, short ofdeleting the subscription and recreating it. (I want to try and avoidthis as the same update needs to be applied to about 10 databases thatare also replicated in the same way).All help is appreciated.Brian.*** Sent via Developersdex http://www.developersdex.com ***

View 4 Replies View Related

Add A Column To Published Table Without Replicating To Subscriber

May 25, 2006

I would like to add a column to a published table but not have that column replicated to subscribers. I can accomplish this via the UI by adding the column and then unchecking it. This adds the column to the publisher table but does not replicate it to the subscriber.

I am looking for a programmatic method to add a column to the base table and unmark it for replication.

Thanks for your assistance.

View 4 Replies View Related

How To Detect NULL In SQL-table With VB.net ?

Oct 29, 2005

Hi,I want to check with VB.net whether a field in a SQL-table is NULL or not.This code doesnot work:If xxx = NULL then<statements>End IfI got the error, that NULL is not supported ?How do I code the check ???Help is appreciated, Gr.

View 2 Replies View Related

Why Bcp Cannot Detect Temporary Table ?

Jul 22, 2006

hi, good day, i facing a problem


Code:


CREATE PROCEDURE [SP_TEST]

AS

SELECT *
INTO #TMP_CUSTOMER
FROM O_CUSTOMER

-------------------------------------------------------------------------
SELECT DISTINCT
COUNT(CUST_CD)

FROM
#TMP_CUSTOMER
GO




when i run in query analyzer , using "exec SP_TEST" , it work and display result

but when run
Exec Master..xp_CmdShell 'bcp "exec mydbtest..SP_TEST " queryout C:TEST.TXT -c -Slocalhost -Usa -Ppassword'

it give error "SQLState = S0002, NativeError = 208"
and show
Error = [Microsoft][ODBC SQL Server Driver][SQL Server]Invalid object name '#TMP_CUSTOMER'.


thanks for guidance

View 4 Replies View Related

SQL 2012 :: Cannot Truncate Table Because It Is Published For Replication Or Enabled For Change Data Capture

Jul 8, 2015

I get the following error message when a job calls a Stored Procedure that TRUNCATES a Table:

Cannot truncate table 'CombinedSurveyData' because it is published for replication or enabled for Change Data Capture

Is my only option to change the TRUNCATE to DELETE?

[URL]

View 2 Replies View Related

Querry 2 Detect Doubles In A Table

Jul 6, 1999

Hi,


I have a table which contain a field called 'company' of type 'int'.
I want to make a querry which returns all doubles ... for example:

I have: after querry the return must be:

company company:
1 1
3 3
3 3
11 3
7 2
3 1
2 2
1
4
2
5

Thank you,
Sebastian

View 1 Replies View Related

How To Detect That A Sqlserver Table Row Has Foreign Keys And Cannot Be Deleted?

Mar 27, 2006

What is the best way to detect that a sqlserver table row has foreign keys and cannot be deleted?Thanks,Keith

View 1 Replies View Related

Help: How To Detect Inserts, Updates, Deleted On A Table From Within C++ Application?

Jul 20, 2005

Hopefully someone can at least point me in the right direction for moreresearch (e.g.: correct terminology). My only previous experience was justdumping data into a database using ODBC, and that was some years ago so nowmostly forgotten.I need to write an NT Service/Application (in C/C++) that will be gettingdata sent to it via SQL Server 2000. The data will arrive in my SQL Server(read-only access), via replication of tables from another remote SQLServer.My application needs know when new row are inserted, or updated so it can toread this data (needs to be quick/timely so hopefully no polling) to theninterface with other remote proprietary systems.T.I.A.PS: If you can recommend appropriate books on SQL Server 2000 that wouldalso be useful.

View 2 Replies View Related

SQLSERVER 2000,How Can I Detect The Last Time Where The Table Has Changed (updated)?

Jan 2, 2008

Hi, I wonder where I can see last update over a table. Maybe sqlserver write some information about every table.

For example there are 300 tables in a database an I want to execute some query to see the last tables updated (list of tables updated > 2008-01-02 )

Hope to be clear,
Best regards
Ariel

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

SQL Server 2012 :: Why Indexes On Table Slow Down DML Operation On Table

Mar 7, 2014

Why the Indexes on table slow down the DML operation on table, what is the exact reason?

View 5 Replies View Related

Indexes On Table Variable Of Table Valued Function

Jan 6, 2004

Hi there,

Can someone tell me if it is possible to add an index to a Table variable that is declare as part of a table valued function ? I've tried the following but I can't get it to work.

ALTER FUNCTION dbo.fnSearch_GetJobsByOccurrence
(
@param1 int,
@param2 int
)
RETURNS @Result TABLE (resultcol1 int, resultcol2 int)
AS
BEGIN

CREATE INDEX resultcol2_ind ON @Result

-- do some other stuff

RETURN
END

View 2 Replies View Related

How To Find Filegroups For A Given Table And Table's Indexes

Oct 6, 2006

Hi

I am using SQL Server 2005 Developer Edition.

I want a list of the following things from the database: -

Table Name , FileGroup Table resides on

Table Name, Index Name, FileGroup index resides on

To put it simply, consider the following example:-

Lets say I have a table XYZ in my database created on Filegroup F1. It has a PK PK1 nonclustered index on Filegroup F2.

List1

-------

XYZ        F1

 

List2

---------

XYZ          PK1         F2

 

Please do not tell me of sp_help <table> option

Regards

Imtiaz

 

View 1 Replies View Related

Adding Indexes To Table

Feb 18, 2007

I'm looking for information on how to add indexes to a table in a SQL Server 2000 Database, why add them etc? Any source of good information on the web regarding this?

View 6 Replies View Related

Drop All The Indexes On A Table

Sep 20, 2005

is there a way to drop all the indexes on a table other than listing them out separately in a drop index statement?

View 2 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

Indexes Update When Table Is Modified

Jun 8, 2004

Hello again,

Two Short questions this time,

I have a table with several indexes, currently most of them are very narrow (one column), and the question is, when I modify the table by updating a record, does all the indexes are calculated again?? Even if the modified field isn't indexed??? Or the server is smart and knows what indexes to calculate if any.

Second question, can I give to a query a low priority(In dynamic SQL), for example when I don't want my query to exploit too many system resources so it won't interfere the main system ?


Inon.

View 12 Replies View Related

Query To List Indexes From A Table ?

Sep 1, 2006

How can I list indexes with a (SQL) query ?
Thanks

View 1 Replies View Related

Repairing Indexes In A Table But Getting Errors

Feb 8, 2007

Hi ALL,

Somehow one of tables in my database with clustered index got tempered and the pageid are not in proper order. I tried the checkdb command with repair_rebuild option but it is giving the following error.

Table error: Object ID 1984530649, index ID 1. Page (1:254682) is missing a reference from previous page (1:254681). Possible chain linkage problem.

Server: Msg 8936, Level 16, State 1, Line 1

Table error: Object ID 1984530649, index ID 1. B-tree chain linkage mismatch. (1:254680)->next = (1:256198), but (1:256198)->Prev = (1:256197).

Not able to reindex the index of table. I can not even export the data to any other table with same structure.

Please help me...........


Thanks,
Pracheer

View 2 Replies View Related

Table Copy Misses Indexes

Sep 9, 2005

Hi,I simply want to create a duplicate of an existing table with adifferent name. I've tried the "select * into newtable fromorgtable", which works great, except that it doesn't mark the primarykey field from orgtable in the newtable. I tried creating thenewtable prior to using this select, but then sql server cries aboutthe table already existing. I tried creating the index after theselect "CREATE UNIQUE INDEX FieldAIndex ON newtable (FieldA)" - thatdidn't give a error, but also failed to mark the field as primary.Suggestions?

View 2 Replies View Related

Script Table With Secondary Indexes

May 26, 2006

I used the option "Script Table" --> "Create to" in SQL Server Management Studio Express for a table with secondary index (like IX_IndexName), but in the .sql script file there is only the instruction for the primary key and not for the secondary (I expected something like CREATE INDEX). What can I do?

View 3 Replies View Related

Tunning Indexes On A Billon Row Table

Jun 27, 2007

In our environment we have a very high insert intensive OLTP table, this has 60 million rows. From some of our applications we are very rarely getting timeouts when inserting data into this table. We are expecting that this table would soon run into billion rows and continue to grow. below is the table description and indexes. What indexes should we keep/remove on this table?








Column Name Datatype computed Length Precision Scale Nullable
Col1 int no 4 10 0 no
Col2 smallint no 2 5 0 no
Col3 smallint no 2 5 0 yes
Col4 int no 4 10 0 yes
Col5 int no 4 10 0 yes
Col6 int no 4 10 0 yes
Col7 char no 10 yes
Col8 int no 4 10 0 yes
Col9 uniqueidentifier no 16 yes
Col10 datetime no 8 yes
Col11 smallint no 2 5 0 yes
Col12 varchar no 15 yes
Col13 varchar no 30 yes
Col14 varchar no 50 yes
Col15 int no 4 10 0 yes
Col16 int no 4 10 0 yes
Col17 varchar no 12 yes
Col18 smallint no 2 5 0 yes
Col19 smallint no 2 5 0 yes
Col20 int no 4 10 0 yes
Col21 bit no 1 no
Col22 int no 4 10 0 yes
Col23 bit no 1 no
Col24 bit no 1 no
Col25 datetime no 8 no
Col26 char no 6 yes
Col27 char no 6 yes
Col28 smallint no 2 5 0 yes
Col29 char no 2 yes
Col30 int no 4 10 0 yes
Col31 smallint no 2 5 0 yes
Col32 smallint no 2 5 0 yes
Col33 bit no 1 yes




Index1 nonclustered, stats no recompute located on FileGroup2 Col9, Col10, Col12
Index2 nonclustered, stats no recompute located on FileGroup2 Col9, Col12, Col11, Col10, Col4
Index3 nonclustered, stats no recompute located on FileGroup2 Col6
Index4 nonclustered, stats no recompute located on FileGroup2 Col6, Col4
Index5 nonclustered, stats no recompute located on FileGroup2 Col5, Col9
Index6 nonclustered, stats no recompute located on FileGroup2 Col4, Col9
Index7 nonclustered, stats no recompute located on FileGroup2 Col29
Index8 nonclustered, stats no recompute located on FileGroup2 Col9
Index9 nonclustered, stats no recompute located on FileGroup2 Col6, Col9
Index10 nonclustered, stats no recompute located on FileGroup2 Col7
Index11 nonclustered, stats no recompute located on FileGroup2 Col12
Index12 clustered, unique, primary key, stats no recompute located on FileGroup3 Col1






Any links to MS best practises on indexes for sqlserver 2000 appreciated.



thanks a lot in advance.





View 6 Replies View Related

SQL 2012 :: Identify Unused Indexes In Table

Jan 15, 2015

How to find if there is a query that can be written on DMV's which will be able to retrieve the indexes that are not being used in a table.

View 2 Replies View Related

Transact SQL :: Create Table Indexes In SSMS2012

May 26, 2015

I use Indexes Fundamentals of Microsoft SQL Server - Lesson 30: Indexes in the website of URL... to learn the basic things of Indexes. In my SQL Server 2012 Management Studio (SSMS2012), I executed the following code..

-- scFTX_CreateTableEmployees.sql
-- saved in C:/Documents/SQLServerIndexes_downloadCode
-- 26 May 2015 10:52 AM
USE ScottChangDB;
GO
CREATE TABLE Employees

[code]....

Where the SCHEMA and the index 'IX_Employees are located in the Object Explorer of the database "ScottChangDB" of my SSMS2012. 

View 3 Replies View Related

SQL Server Admin 2014 :: Backup Of Indexes For A Particular Table?

Aug 9, 2014

how to take backup of indexes for a particular table.

View 1 Replies View Related

SQL Server Admin 2014 :: Backup Of Indexes For A Particular Table

Aug 9, 2014

How to take backup of indexes for a particular table.

View 5 Replies View Related

SQL 2012 :: Way To Remove All Indexes From A Table With One Single Command

Sep 29, 2015

IS there a way to remove all indexes from a table with one single command ( without having to know what the index name is ) ;

View 2 Replies View Related

Creating Indexes On Large Table To Increase Performance

Mar 5, 2008

Dear all,
I'm using SQL Server 2005 Standard Edetion.
I have the following stored procedure that is executed against two tables (RecrodedCalls) and (RecordedCallsTags)
The table RecordedCalls has more than 10000000 Records and RecordedCallsTags is about 7500000 Records
Now the lines marked in baby blue are dynamic (Dynamic where statement) that varies every time this stored procedure is executed, may it contains 7 columns in condetion statement or may it contains 10 columns, or 2 coulmns.....etc
Now I want to create non-clustered indexes on the columns used in the where statement, THE DTA suggests different indexing whenever the where statement changes.
So what is the right way to created indexes, to create one index on all the columns once, or to create separate indexes on each columns, sometimes the DTA suggests 5 columns together at one if I€™m using 5 conditions, I can€™t accumulate all the possible indexes hence the where statement always vary from situation to situation, below the SP:


CREATE TABLE #tempLookups (ID int identity(0,1),Code NVARCHAR(100),NameE NVARCHAR(500),NameA NVARCHAR(500))

CREATE TABLE #tempTable (ID int identity(0,1),TypesCount INT,CallsType NVARCHAR(50))



INSERT INTO #tempLookups SELECT Code, NameE, NameA FROM lookups WHERE [Type] = 'CALLTYPES' ORDER BY Ordering ASC

INSERT INTO #tempTable SELECT COUNT(DISTINCT(RecordedCalls.ID)) As TypesCount,RecordedCalls.CallType as CallsType

FROM RecordedCalls LEFT OUTER JOIN RecordedCallsTags ON RecordedCalls.ID = RecordedCallsTags.CallID

WHERE RecordedCalls.ID <= '9369907'

AND (RecordedCalls.CallDate BETWEEN cast ('01 Jan 1910 00:00:00:000' as datetime ) AND cast ( '01 Jan 2210 00:00:00:000' as datetime ))

AND (RecordedCalls.Duration BETWEEN 0 AND 1000000)

AND RecordedCalls.ChannelID NOT IN('62061','62062','62063','62064','64110','64111','64112','64113','64114','69860','69861','69862','69863','69866','69867','69868')

AND RecordedCalls.ServerID NOT IN('2')

AND RecordedCalls.AgentID NOT IN('1000010000')

AND (RecordedCallsTags.TagID is null OR RecordedCallsTags.TagID NOT IN('100','200'))

AND RecordedCalls.IsDeleted='false'

GROUP BY RecordedCalls.CallType

SELECT IsNull(#tempTable.TypesCount, 0) AS TypesCount, CASE('English')

WHEN 'Arabic' THEN #tempLookups.NameA

ELSE #tempLookups.NameE

END AS CallsType FROM

#tempTable RIGHT OUTER JOIN #tempLookups ON #tempTable.CallsType = #tempLookups.Code

DROP TABLE #tempLookups

DROP TABLE #tempTable


Thanks all,
Tayseer

Any suggestions how to create efficient indexes??!!

View 2 Replies View Related

Creating Full-text Indexes On A Table In A Publication

Sep 13, 2006

I have a table that is in a one way transactional publication. I need to create a full-text catalog on this table and have that catalog exist on the subscriber as well. I understand simply creating a FTC for an object in a publication will not cause that FTC to be replicated to the subscribers. I have scripted out the command and tried to use sp_addscriptexec to push it to the subscriber. When I do this, I get the following error:

Last 183 characters in 'sqlcmd' output buffer: Changed database context to 'database'.
Msg 574, Level 16, State 1, Server SQLSERVER, Line 2
CREATE FULLTEXT CATALOG statement cannot be used inside a user transaction.

Also, when this script is run directly from the subscriber, it works fine (but since the subscriber is our production machine, I'd prefer to not have to do it that way). I believe I can reinitialize the publication and have the FTC pushed to the subscriber, but this is not ideal either, since some of our databases can be very large and take a long time to initialize.

Is there a better way to accomplishing this other then connecting directly to the subscriber and running the script or by reinitializing the publication? Thanks for your help!

-mike

View 12 Replies View Related







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