CREATE INDEX Statement For SQL Mobile Not Documented?

Nov 16, 2005

Hello,

View 5 Replies


ADVERTISEMENT

SQL Server 2012 :: Using Function In Create Index Statement

Jun 10, 2015

Can we use a sql function() in create index as below is giving error , what would be work around if cannt use the function in below scenario

CREATE NONCLUSTERED INDEX [X_ADDRESS_ADDR1_UPPER] ON [dbo].[ADDRESS]
(
UPPER([ADDR_LINE_1]) ASC
)
WITH (SORT_IN_TEMPDB = OFF, DROP_EXISTING = OFF, IGNORE_DUP_KEY = OFF, ONLINE = OFF) ON [PRIMARY]
GO

View 3 Replies View Related

ADD INDEX In SQL Server Mobile

Feb 13, 2007

new to MS SQL

please help.

How do you add an Index  in SQL server Mobile ?

I tried

ALTER TABLE customers ADD INDEX (CUSTOMER_NAME)

did not work

ALTER TABLE customers ADD  INDEX custname (CUSTOMER_NAME)

did not work

ALTER TABLE customers ADD custname  INDEX (CUSTOMER_NAME)

did not work

is ADD INDEX supported in mobile?

is there a  complete sql syntax reference for mobile?

BTW I'm using Sql Mobile query analyser directy on PDA

View 3 Replies View Related

Clustered Index On Client_ID+ORderNO+OrdersubNo, If I Create 3 Noncluster Index On Said Column Will It Imporve Performance

Dec 5, 2007



Dear All.

We had Teradata 4700 SMP. We have moved data from TD to MS_SQL SERVER 2003. records are 19.65 Millions.

table is >> Order_Dtl

Columns are:-

Client_ID varchar 10
Order_ID varchar 50
Order_Sub_ID decimal
.....
...
..
.
Pk is (ClientID+OrderId+OrderSubID)

Web Base application or PDA devices use to initiate the order from all over the country. The issue is this table is not Partioned but good HP with 30 GB RAM is installed. this is main table that receive 18,0000 hits or more. All brokers and users are using this table to see the status of their order.

The always search by OrderID, or ClientID or order_SubNo, or enter any two like (Client_ID+Order_Sub_ID) or any combination.

Query takes to much time when ever server receive more querys. some orther indexes are also created on the same table like (OrderDate, OrdCreate Date and Status)

My Question are:-


Q1. IF Person "A" query to DB on Client_ID, then what Index will use ? (If any one do Query on any two combination like Client_ID+Order_ID, So what index will be uesd.? How does MS-SQL SERVER deal with these kind of issues.?

Q2. If i create 3 more indexes on ClientID, ORderID and OrdersubID. will this improve the performance of query.if person "A" search record on orderNo so what index will be used. (Mind it their would be 3 seprate indexes for Each PK columns) and composite-Clustered index is also available.?

Q3. I want to check what indexes has been used? on what search?

Q4. How can i check what table was populated when, or last date of update (DML)?

My Limitation is i Dont Create a Partioned table. I dont have permission to do it.



In Teradata we had more than 4 tb record of CRM data with no issue. i am not new baby in db line but not expert in sql server 2003.


I am thank u to all who read or reply.

Arshad

Manager Database
Esoulconsultancy.com

(Teradata Master)
10g OCP










View 3 Replies View Related

Index/performance Index For SELECT.... IN Statement

Sep 10, 2007



Hi All,

I 'm working to improve some sql performance.


One of the major syntax inside the SELECT statment is ..

WHERE FIELDA IN (SELECT PARAVALUE FROM PARATABLE WHERE SESSIONID = "XXXXX" AND PARATYPE='A') AND
WHERE FIELDB IN (SELECT PARAVALUE FROM PARATABLE WHERE SESSIONID = "XXXXX" AND PARATYPE='B') AND
WHERE FIELDC IN (SELECT PARAVALUE FROM PARATABLE WHERE SESSIONID = "XXXXX" AND PARATYPE='C') AND
WHERE FIELDD IN (SELECT PARAVALUE FROM PARATABLE WHERE SESSIONID = "XXXXX" AND PARATYPE='D') AND
WHERE FIELDE IN (SELECT PARAVALUE FROM PARATABLE WHERE SESSIONID = "XXXXX" AND PARATYPE='E') AND
WHERE FIELDF IN (SELECT PARAVALUE FROM PARATABLE WHERE SESSIONID = "XXXXX" AND PARATYPE='F')

(It's to compare the field content with some user input parameter inside a parameter table... )

I think properly is that the SELECT ... IN is causing much slowness in the sql statement. I have indexed FIELDA , FIELDB, FILEDC etc and those PARAVALUE and PARATYPE in the PARATABLE table. But perfromance is still slow and execution takes >20 seconds for 200000 rows of records.

Do any one know if still any chance to improvide the performance like this?

Much Thanks,

Andy

View 14 Replies View Related

Dynamic Create Table, Create Index Based Upon A Given Database

Jul 20, 2005

Can I dynamically (from a stored procedure) generatea create table script of all tables in a given database (with defaults etc)a create view script of all viewsa create function script of all functionsa create index script of all indexes.(The result will be 4 scripts)Arno de Jong,The Netherlands.

View 1 Replies View Related

Sql Mobile Alter Statement

Jul 19, 2006

Here is the alter statement that I am trying to use to create a relationship between 2 tables. This does not seem to work on mobile. What am I doing wrong?

ALTER TABLE [SubCategory] CONSTRAINT [FK_SubCategory_Category] FOREIGN KEY([CategoryID])
REFERENCES [Category] ([CategoryID])
ON UPDATE CASCADE
ON DELETE CASCADE


This is the error:



There was an error parsing the query. [ Token line number = 1,Token line offset = 27,Token in error = CONSTRAINT ]

View 1 Replies View Related

Create Mobile Database From Xls, Csv, Text Or Mdb

Nov 28, 2006

Hello,

Since my experience in VS is extremely limited, i'd like to be exused if questions sound silly.

My problem is that, at my device application project, i want to build a database that will retrieve data from .xls, or .csv, or .txt, or .mbd files. If i've noticed well, there is no support for OLEDB or ODBC, since by the time that i add tableadapter to my database.xsd and use these, after insertion i get multiple errors informing that system.data.oledb. .... or .odbc "type is not defined".

If it cannot be done, and since i still try to figure out how smart devices function, transact with databases, e.c.t. is there any suggestion?



Thank you in advance

Kostas

View 8 Replies View Related

SQL Mobile Create Sdf File From SQL 2005 DB

Dec 28, 2006

Hi,

I'm trying to create a SQL Mobile .sdf file from my SQL Server 2005 database and cannot. I read the ms support docs for doing this and have had no luck . I created the respective publication and SQL Subscription for the db and when i run the process (not sure if i'm running the right process - docs don't say) it creates a directory under a "unc" directory with all my table objects (articles) with subscription/replication files for each table such as .cft, .bcp, .dri, .prc, .sch, and .trg. But no .sdf file for my SQL Server 2005 database.

All I want is the .sdf file so that i can copy it to my Pocket PC device and then connect my mobile application to it. I want to copy my SQL Server 2005 database to my device so that the mobile app uses the db on the device. Sounds easy - but it's not. Can someone tell me the easiest way to do this or point me to a doc that explains it. I checked the ms support docs and they state "after the .sdf file has been created..." in "Pre-building a SQL Server Mobile Database" doc. Where/How is the .sdf file created is what I would like to know?

Any help would be appreciated.

Thanks - Dave





View 16 Replies View Related

Create A Mobile Database On Desktop

Jan 21, 2006

I have searched through this forum and the news group

microsoft.public.sqlserver.ce

for this topic. I only find a post from Darren Shaffer and I requested a document.

Unfortunately, there is not a clear example of how to create a mobile database (sdf) on a desktop machine which contains VS 2005 and SQL server 2005 by using Visual Basic 2005.

I am sure a clear example in VB for this problem would help a lot of people. Hence anybody who knows how to perform this task, Please help these people.

Thanks in advance

Talat

View 1 Replies View Related

Connections Are Not Selected As Documented

Dec 2, 2007

The following test seems to contradict documented behavior....

1) Running SQL Server 2005 Express with Shared Memory (SM) and TCP enabled connect via ADO.

2) Connect with "localhost", it connects using SM.

3) Disable SM and restart the Server Service.

4) Connect with "localhost", it connects using TCP.

5) Enable SM and restart the Server Service.

6) Connect with "localhost", it still connects using TCP!!

To restore a SM connection, the only way that I have figure out is...

7) Disable TCP and restart the Server Service.

8) Connect with "localhost", it connects using SM.

And then restoring TCP does not change the connection

9) Enable TCP and restart the Server Service.

10) Connect with "localhost", it still connects using SM.

If you run steps 1 - 6 but skip #4, step #6 will connect with SM. So one concludes that the TCP connection is somehow "sticky".

Any ideas on how to force a shared memory connection in step #6?

View 3 Replies View Related

Documented T-sql For File Space ?

Jun 27, 2006

Hi There

I would like to write sql to check that space used by any given data file in SS2000.

sp_spaceused only returns the total space used by the DB or object in the DB, not for a specific data file.

DBCC SHOWFILESTATS does give me this information , but it is not documented in BOL, i would prefer not to use an undocumented command to ensure future use in later versions. Is DBCC SHOWFILESTATS an undocumented T-SQL command ? If so what documented t-sql command will provide me with this information ?

I could query system table's and work this out , but as mentioned this may not not work in future versions of SS.

Thanx

View 1 Replies View Related

Unable To Create SQL Server Mobile Subscription

May 1, 2006

I have been following Creating a Mobile Application with SQL Server Mobile:

http://msdn2.microsoft.com/en-us/library/ms171908.aspx

I have successfully created the snapshot.

When performing the following:

Configure the publication for Web synchronization






In SQL Server Management Studio, in Object Explorer, expand the (local) computer node.


Right-click the Replication folder, and then choose Configure Web Synchronization

There is no option when Right-clicking the Replication folder under my local server, however there IS an option for Configuring Web Synchronization on the Replication folder under SQL Server Mobile. (Unfortunately the Configure the publication for Web Synchronization is listed BEFORE the SQLServer Mobile Task, so it is pretty confusing) So, assuming this is what the author meant, I successfully configured the Web Server and the SQLMobile shows under my default web site.



When I attempt to create a Subscription under SQLServer Mobile, I get the following error:



- Synchronizing Data (Error)



Messages

Unexpected HTTP status returned. [ 415,status = ]
HRESULT 0x80004005 (28632)


The operation could not be completed.


Am I missing something? Should the web configuration be done on my local SQL Server, not the SQLServer Mobile replication directory? If so, how come I do not have that option as suggested in the directions?

I have checked and rechecked permissions. As I mentioned, the snapshot is successfully created (verified by Right-clicking the publication and viewing the snapshot agent status)



View 9 Replies View Related

Working With A Poorly Documented SQL Database.

Feb 6, 2008

One of the primary parts of my job is working with the SQL database of our Enterprise ERP software. One of my primary responsibilities is writing reports based on it's data and since it is not well documented and this is one of my biggest challenges. To top it all off, it's hard to even use their reports to learn the links between tables as the reports run completely in Visual Foxpro.

Is there reasonably priced software that will analyze the database for me and make it easier for me to figure out the relationships between certain tables and such?

TIA,

Dave

View 1 Replies View Related

Bug - SSRS WS Render Method Not Working As Documented?

Dec 31, 2007



Hello all, according to the documentation for the DeviceInfo parameter of the ReportingService.Render method the Xml string fragment of PageHeight and PageWidth for the Image Device Information Settings should and I quote.


The page height, in inches, to set for the report. You must include an integer or decimal value followed by "in" (for example, 11in). This value overrides the report's original settings.


Emphasis mine. Page width is similar. However when I change that value to what is desired for the IMAGE format it has no effect whatsoever no matter what value I place in there.

Indeed the size that is rendered is more related to the current display resolution setting rather than the PageHeight/PageWidth values passed in. In otherwords if my laptop has a higher resolution of 1920x1200 and the server that I deploy this WS to has a lower resolution of 1280x1024, the image rendered on the higher resolution display fits on to an 8.5x11.0 in page with room to spare but on the lower resolution display it is clipped because it does not fit the page.

Is there something that I am doing wrong or is this indeed a bug?

Thank you,
John

View 4 Replies View Related

Create Tables And Insert Data In Sql Server Mobile On Dekstop

Mar 2, 2006

Hello (sorry my bad english, im brazilian)

I was using Visual Studio 2003 and SQL Server CE 2.0 for C# mobile applications. The .sdf database were created in the emulator or in the mobile device itself using Query Analizer.

The application developed need some initial data to run, and this data is obtained executing one service that reads a postgree database, and insert the data in the SQL CE database of the mobile device. But, given the size of the database (maybe 10.000 rows), it tooks too much time (sometimes 6 hours).

Now we are migrating to Visual Studio 2005 and SQL Server 2005 Mobile Edition.

I want to know if its possible to create the .sdf database and load the data into this database on the desktop. Maybe through the execution of a .sql script, or through a service executed on the desktop.

After this, its just upload de .sdf file to the mobile device.

Thanks

Robson

View 8 Replies View Related

Create INDEX Within CREATE TABLE DDL

Jan 27, 2006

Hi Minor and inconsequential but sometimes you just gotta know: Is it possible to define a non-primary key index within a Create Table statement? I can create a constraint and a PK. I can create the table and then add the index. I just wondered if you can do it in one statement. e.g. I have: CREATE TABLE MyT (MyT_ID INT Identity(1, 1) CONSTRAINT MyT_PK PRIMARY KEY Clustered, MyT_Desc Char(40) NOT NULL CONSTRAINT MyT_idx1 UNIQUE NONCLUSTERED ON [DEFAULT])which creates a table with a PK and unique constraint. I would like (pseudo SQL):CREATE TABLE MyT (MyT_ID INT Identity(1, 1) CONSTRAINT MyT_PK PRIMARY KEY Clustered, MyT_Desc Char(40) NOT NULL CONSTRAINT MyT_idx1 UNIQUE INDEX NONCLUSTERED ON [DEFAULT]) No big deal - just curious :D Once I know I can stop scouring BOL for clues. Tks in advance

View 2 Replies View Related

SQL Server 2012 :: Create Dynamic Update Statement Based On Return Values In Select Statement

Jan 9, 2015

Ok I have a query "SELECT ColumnNames FROM tbl1" let's say the values returned are "age,sex,race".

Now I want to be able to create an "update" statement like "UPATE tbl2 SET Col2 = age + sex + race" dynamically and execute this UPDATE statement. So, if the next select statement returns "age, sex, race, gender" then the script should create "UPDATE tbl2 SET Col2 = age + sex + race + gender" and execute it.

View 4 Replies View Related

Can Not Create SQL Mobile Database On Server: The Operating System Does Not Support Encryption

Oct 12, 2007

I have code that creates a SQL Mobile database on a server. It has worked in many environments, but I have one customer experiencing an issue. It will not create the database on their server. I would appreciate any thoughts.

The exact error message I get is "the operating system does not support encryption"

I am getting it on the line: SQLCeEngine.CreateDatabase()

Here is the code:
SQLCeEngine = New SqlServerCe.SqlCeEngine(SQLConnectionString)
ReturnValue += ": Declare new"
SQLCeEngine.CreateDatabase()
ReturnValue += ":Create"
SQLCeEngine.Dispose()
ReturnValue += ": Dispose"

Here is the error message I get from our application- the part after Err: is the actual error message from the system:
Data Source = D:EVADATAWebServiceDownloads est;Password=test;Persist Security Info=False;: Declare new:Error!:Err:The operating system does not support encryption.

When I go into SQL Express and create a SQL Mobile database using it, it can be created. So, I have to believe it can be done on the server, but I don't know why the code can not do it.
(e.g. FileConnect Object ExplorerServer Type: SQL Server compact Edition and create a database). The database is successfully created if I do it manually this way. It even creates fine if I select the 'Encrypt' button.

The machine is a Windows 2000 Server sp4 version 5.00.2195
SQL 2000 is installed
SQL 2005 Express is installed
I ran the SQLServerCE31-EN.msi file and it is installed. (I have also re-run and repaired it)
I have also copied over the newest version of our code from scratch.

SQL Server mgmt Studio: 9.00.3042.00
MDAC 2000.085.1128.00
MSXML 2.3 3.1 4.0 5.0 6.0
IE 6.0.2800.1106
.NET Framework 2.0.50727.42
Operating System 5.0.2195

View 13 Replies View Related

IID_IDBDataSourceAdmin Error Trying To Create A Database Using Query Analyzer On A Mobile Device

Sep 25, 2007



Hi,

Please provide some help regarding the "Interface Defining Error: IID_IDBDataSourceAdmin" error while trying to create a SDF database using Query Analyzer on a Windows CE 5.0 mobile device (Symbol MC3000).

Error: 0x80004005 E_FAIL
Native Error: 28558
Description: SQL Mobile encountered problems when creating database [,,,,]

Param. 0: 0
Param. 1: 0

Param. 2: 0
Param. 3:
Param. 4:
Param. 5:

A list of (related) installed packages:

NETCFv2.wce5.armv4i.cab
sqlce30.dev.ENU.wce5.armv4i.CAB
sqlce30.repl.wce5.armv4i.CAB
sqlce30.wce5.armv4i.CAB


PS.
Basically I have developed a mobile application that programmatically creates the database, the code worked on a similar device (Win CE 50), trying to run the application on a new device resulted in database creation errors. I tried creating a test database manually .. and this is what I got.

Browsing MSDN or searching on the Forum did not help.

~Zarko Gajic

View 3 Replies View Related

Failure To Create First Replicated Database (SQL Mobile/SQL Server 2005) / Err 28627

Jan 8, 2006

Hi,

I'm trying to get my first replication going, and I have set up a database successfully, along with merge replication, however when I attempt to create the first subscriber, I get a permissions issue, regardless of what I do. In the SQLCESA30.LOG file, I get the following entries:

2006/01/07 16:59:36 Hr=00000000 SQLCESA30.DLL loaded 0
2006/01/07 16:59:58 Hr=80004005 ERR:OpenDB failed getting pub version 28627


I posted the initial thread under the "Replication" forum, but am including this 'pointer' post here due to a lack of replies there, and the relevance of this thread to this forum. Please see http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=193693&SiteID=1 for more details.

 

Thanks.

View 1 Replies View Related

I Am Having A Problem With Percision Which Appears To Be A Documented Bug Is There A Work Around Of Solution In Sqlserver 2005

Aug 23, 2006

I have been working on an application which require as much percision as we can get. We have defined all numeric values as (38,16) however when ever we divide a number by the result of a built in function it truncate the percision to 5 decimal place this cause us to have a small but enoying loss in the numbers being caculated we need a minimuim of 8 decimal places or better is there a work around or solution for this problem in sql server 2005. The more percision the better.

 

example: select tna/(select sum(tna) from taum) from taum where fund_id = 2345

 

the result is always 5 decimal places even though fund_id tna = 2569698.23 and sum(tna) =98745612325879.36 which should equal .00000002602341683313994 instead the result = .00000

 

 

 

View 2 Replies View Related

Create Index

Jul 17, 2006

I need to check if an index available on table T1 and field F1. If not, create a  non-clustered on F1. How can I do this in a stored procedure?

View 1 Replies View Related

Need Help To Create An Index

May 15, 2008

SET QUOTED_IDENTIFIER ON
GO
SET ANSI_NULLS ON
GO

/****** Object: Stored Procedure dbo.carr_summary_Datewise Script Date: 5/15/2008 10:20:37 AM ******/
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[carr_summary_Datewise]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure [dbo].[carr_summary_Datewise]
GO


CREATE proc carr_summary_Datewise --2007,9,27,30,'COMPUTERTEL'

@pYear int,
@pMonth int,
@pDay1 int,
@pDay2 int,
@pOperator varchar(32) -- DisplayName

as
begin

declare @sql varchar(4000)
declare @Service varchar(32)
declare @Operator varchar(32)
declare @tDiff int
declare @pDate1 varchar(32)
declare @pDate2 varchar(32)
declare @pD1 datetime
declare @pD2 datetime
declare @sD varchar(2)
declare @eD varchar(2)
declare @eM varchar(2)
declare @tb1 varchar (32)

set @pDate1 = dbo.AsString(@pYear,@pMonth,@pDay1,0,0,0)
set @pDate2= dbo.AsString(@pYear,@pMonth,@pDay2,23,59,59)
--print @pDate1
--print @pDate2

select @Operator=SystemName,@tDiff=timeDiff from Report..Carriers where DisplayName=@pOperator
select @Service=serviceName from Report..Carriers where SystemName=@Operator
--print @tDiff

set @pD1=dateadd(hh,@tDiff,(cast(@pDate1 as datetime)))
set @pD2=dateadd(hh,@tDiff,(cast(@pDate2 as datetime)))
--print @pD1
--print @pD2

/*set @sD=datepart(dd,@pD1)
set @eD=datepart(dd,@pD2)
set @eM=datepart(mm,@pD1)*/
--print @eM

if @pDay1=1
begin
set @sD=1
end
else
begin
set @sD=datepart(dd,@pD1)
end

if @pDay2=30
begin
set @eD=30
end
else
begin
set @eD=datepart(dd,@pD2)
end

if @pDay2=31
begin
set @eD=31
end
--else
-- begin
-- set @eD=datepart(dd,@pD2)
-- end

--print @sD
--print @eD
--print 'Operator=' + @pOperator
--print 'Service=' + @Service

--set @tb1='ob_sep07'


if @pMonth=1
begin
set @tb1='ob_Jan08'
end
if @pMonth=2
begin
set @tb1='ob_Feb08'
end
if @pMonth=3
begin
set @tb1='ob_Mar08'
end
if @pMonth=4
begin
set @tb1='ob_Apr08'
end
if @pMonth=5
begin
set @tb1='ob_May08'
end
if @pMonth=6
begin
set @tb1='ob_Jun08'
end
if @pMonth=7
begin
set @tb1='ob_Jul08'
end
if @pMonth=8
begin
set @tb1='ob_Aug08'
end
if @pMonth=9
begin
set @tb1='ob_Sep08'
end
if @pMonth=10
begin
set @tb1='ob_Oct08'
end
if @pMonth=11
begin
set @tb1='ob_Nov08'
end
if @pMonth=12
begin
set @tb1='ob_Dec08'
end


set @sql='

select Callyy,Callmm,Calldd,CallDate,dbo.Acc_NearestZone_Tracks(Operatorout,routepfx,CallDate) zone,
routepfx,Talktime,RefUploader.dbo.WhichTimeClass(''' + @pOperator + ''',CallDate) TimeCls,Cost
from
(

select Callyy,Callmm,Calldd,dbo.asString(Callyy,Callmm,Calldd,Callhh,0,0) CallDate,Routepfx,Operatorout,
cast(sum(Talktime/60.) as decimal(10,2)) Talktime,Cost
from Report.dbo.'+@tb1+' (nolock)
where Operatorout=''' + @Operator + '''
and Callyy=' + ltrim(str(@pYear)) + '
and Callmm=' + ltrim(str(@pMonth)) + '
and calldd between ' + ltrim(str(@sD)) + ' and ' + ltrim(str(@eD)) + '
group by Callyy,Callmm,Calldd,dbo.asString(Callyy,Callmm,Calldd,Callhh,0,0),
Routepfx,Operatorout,Cost
)x
where CallDate between ''' + convert(varchar(20),@pD1,120) + ''' and ''' + convert(varchar(20),@pD2,120) + '''
'
--print(@sql)
--exec (@sql)

set @sql=
'select Callyy,Callmm,Calldd,Routepfx Prefix,case when zone is not null then zone else ''--NOT FOUND--'' end zone,
case when TimeCls is not null then TimeCls else ''--NOT FOUND--'' end TimeCls,
''' + @Operator+ ''' Operatorout,Sum(Talktime) Talktime,Cost
from ('+@sql+') x
group by Callyy,Callmm,Calldd,Routepfx,zone,TimeCls,Cost
order by Callyy,Callmm,Calldd,Routepfx,zone,TimeCls
'
--print (@sql)
exec (@sql)
end







GO

SET QUOTED_IDENTIFIER OFF
GO
SET ANSI_NULLS ON
GO

this procedure takes more time to run


we need make it fastly


what should i need



if i create one index how it works



where should i create index please write one index for me

View 3 Replies View Related

Create Index

Dec 2, 2007

Hi all

Recently we are having issues with one of the indexes during our maintenance. There is one index that which usually would have taken 10-15 mins continues to run even after 3 hrs. Other indexes on the same table finish nicely. Just this one gets stuck. Our index creation scripts drops existing index and creates new one..

CREATE INDEX ... ON ... WITH DROP_EXISTING, SORT_IN_TEMPDB ...etc

So last week when I got woken up because of this, I tried to drop the index explicitly and re create the index (by removing the DROP_EXISTING in above script). Even though it took about 45 mins it still finished in time during the maintenance window.

We had the same issue this week. I was looking at sp_who2 during the index creation, I noticed very low CPU activity and high DiskIO.
example: CPU : 4k cycles, DiskIO 50000.

There is 20% of free space on the index file group. Generally index creation takes higher CPU and lower DiskIO.

How do I find out what the issue is with this index? The table has 40 million rows. this is a non-clustered index. There are 2 other indexes on the table - one clustered. they both finished properly in less than 10 mins.

Thanks in advance,
Don

View 1 Replies View Related

Create Index

Jul 17, 2006

I need to check if an index available on table T1 and field F1. If not, create a non-clustered on F1. How can I do this in a stored procedure?

View 6 Replies View Related

How To Create Index (Case When)

Oct 20, 2004

How to create index when there is a SQL statement like
Select count(1) as [Total],
sum(Case when Field1 < Field2 then 1 else 0 End) as [Selected]
from Table1


Thx in Adv
XLDB

View 3 Replies View Related

Can't Create An Index On My View

Dec 1, 2004

G'day all.

I am trying to create an index on a view that joins two tables.

I get the classic error of course:
'Cannot index the view 'dbname.dbo.HJC_net'. It contains one or more disallowed constructs.'

Thing that gets me is that it all seems pretty normal stuff and I can't see what is stopping it.

Code is below and any help greatly appreciated.

CREATE VIEW dbo.HJC_net WITH SCHEMABINDING AS
SELECTt_number
FROM dbo.ticket_cancellations RIGHT OUTER JOIN
dbo.tickets ON dbo.ticket_cancellations.tc_system_ref = dbo.tickets.t_number
WHERE dbo.tickets.t_cancelled <> - 1 OR
-- Add all cancellation codes that are to be excluded from the NET view below
(dbo.ticket_cancellations.tc_cancellation_code <> 83943
AND dbo.ticket_cancellations.tc_cancellation_code <> 83946)

GO
-- Create a clustered index, it MUST be unique
CREATE UNIQUE CLUSTERED INDEX t_number_unique ON HJC_net(t_number)

View 1 Replies View Related

Create INDEX WITH DROP_EXISTING

Jul 24, 2007

Hello,

Can I create an index ( which is not clustered) with DROP_EXISTING ON ?
Shall I still use on [PRIMARY]?

Create INDEX [name] ON [table name] ([column])
WITH DROP_EXISTING ON [PRIMARY]

Thank you,
Y
:rolleyes:

View 2 Replies View Related

Unable To Re Create Index

Oct 22, 2007

Hi

I was asked to import some data from excel into a table within a sqlserver 2000 db the import was complaining about an index so then I deleted the index imported the data succesfilly but I'm now unable to re create the index, please see the error that I'm getting below. Can someone please help.
Thanks

- Unable to create index 'trainingGo'.
ODBC error: [Microsoft][ODBC SQL Server Driver][SQL Server]CREATE UNIQUE INDEX terminated because a duplicate key was found for index ID 32. Most significant primary key is '439'.
[Microsoft][ODBC SQL Server Driver][SQL Server]The statement has been terminated.

View 14 Replies View Related

Any Need To Create An Index For A PK Field?

May 6, 2008

Are Primary Key fields automatically indexed, or do you have to create a seperate index for a PK in order for it to be indexed? I'm using SQL Server 2005.

View 7 Replies View Related

CREATE INDEX ON VIEW

May 28, 2008

Cannot create index on
view 'View name ' because the view is not schema bound." What is the
Schema bound ? How can i create the view Schema bound ?

Pls help me out Sir


Yaman

View 1 Replies View Related

Drop/create Index

Feb 16, 2007

Hi, all,
I want to re-create an index on a production table.
I got an error 644 "could not find index entry...".
The DBCC CHECKDB and CHECKTABLE gave me this:

Server: Msg 8928, Level 16, State 1, Line 1
Object ID 37575172, index ID 6: Page (1:939782) could not be processed. See other errors for details.
Server: Msg 8939, Level 16, State 1, Line 1
Table error: Object ID 37575172, index ID 6, page (1:939782). Test (*(((int*) &m_reservedB) + i) == 0) failed. Values are 7 and 36.
DBCC results for 'Mfg_DFSFNSF'.
There are 1142314 rows in 326143 pages for object 'Mfg_DFSFNSF'.
CHECKTABLE found 0 allocation errors and 2 consistency errors in table 'Mfg_DFSFNSF' (object ID 37575172).

The table script for the index is like this:

CREATE UNIQUE INDEX [Mfg_ITMDH_MbrIdx] ON [dbo].[Mfg_DFSFNSF]([_ITMDH_OwnRow], [_ITMDH_MbrKey], [RECTYPE]) WITH FILLFACTOR = 70 ON [PRIMARY]

My question is that can I drop it and run above create it to fix the problem in live mode?

I know the other option will be:
DBCC CHECKTABLE (FSDBMR.dbo.Mfg_DFSFNSF, repair_allow_data_loss)
But that has to put the db under single user mode.

Thanks!

View 6 Replies View Related







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