Showing posts with label script. Show all posts
Showing posts with label script. Show all posts

Friday, March 30, 2012

Regarding Database Tuning Advisor

Hi guys, I am new to use Database Tuning Advisor. Right now I just save a workload as a sql and runs it in Database Tuning Advisor. The script that I wrote is kinda simple ( Select EID,EName,EDescription From Events Where EID = 300) . However, after I finish analyzed it, there's nothing to display on the recommendations session. Is it suppose got any details in it ? Or does it mean I no need to tune my query performance ? Hope someone can help me out here. Thx guys.

Best Regards,

Hans

It sounds like there were no recommendations -which I would suspect for such a simplistic script if you had basic indexes.

Normally, to generate a 'workload', you would run Profiler for a period of time, capturing all work on the server to a file (or table), and then use the DTA with that workload. I normally recommend, depending upon the amount of 'traffic', to capture a 24 hours block of work, or several key one hour segments during a day.

The primary idea with DTA is to try and reproduce what is happening on the server so that it can try to determine if the indexing is appropriate considering all that is being requested.

Friday, March 23, 2012

reformatting DATE

I currently have a date column that draws from the now() function in my
asp script. The date looks like this:

2/5/2004 10:09:52 AM

As you can see, there is the day and the time data all in the same
string.

What I would like to do is run a group by clause that groups
all the dates that are on the same day togeather. But how do I seperate
this data in SQL? I know there are VB functions that can do this, but in
order for the group function to work when running a sql statement, I
have to do it in SQL itself. Does anyone know how this is done?

Thank you!

Bill

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!"Bill" <BillZimmerman@.gospellight.com> wrote in message
news:4023cc79$0$196$75868355@.news.frii.net...
> I currently have a date column that draws from the now() function in my
> asp script. The date looks like this:
> 2/5/2004 10:09:52 AM
> As you can see, there is the day and the time data all in the same
> string.
> What I would like to do is run a group by clause that groups
> all the dates that are on the same day togeather. But how do I seperate
> this data in SQL? I know there are VB functions that can do this, but in
> order for the group function to work when running a sql statement, I
> have to do it in SQL itself. Does anyone know how this is done?
> Thank you!
> Bill
> *** Sent via Developersdex http://www.developersdex.com ***
> Don't just participate in USENET...get rewarded for it!

I'm not completely sure what you're looking for, but perhaps something like
this?

select convert(char(8), DateColumn, 112) as 'Day', sum(SomeColumn) as
'Total'
from dbo.MyTable
group by convert(char(8), DateColumn, 112)

Simon

Monday, March 12, 2012

Reference variables with identical names but different scopes

Hi,
I have a script task that can "see" 2 variables with identical names. The only difference is that they are scoped differently.

As far as I know my script task will use the most locally scoped variable by default. Is there any way to make it use the other one?

-JamieHi it seems as tho I'm going to get much reply so I've submitted this at betaplace: 708844227

-Jamie|||

Give people a chance, you only posted a few hours ago! Saying that from all we have learnt about the “precedence” behaviour of variables and scope, I certainly don’t think it can be done. Did you suggest a fully qualified syntax to access higher variables? I’d quite like that, but not a big deal for me (yet).

|||

DarrenSQLIS wrote:

Give people a chance, you only posted a few hours ago! Saying that from all we have learnt about the “precedence” behaviour of variables and scope, I certainly don’t think it can be done. Did you suggest a fully qualified syntax to access higher variables? I’d quite like that, but not a big deal for me (yet).

Yeah I know, sorry, but when I said I didn't think i was going to get a reply I meant because I'm convinced this can't be done so I wanted to get the bug in ASAP. Also Doug contacted me offline and as-near-as-makes-no-difference confirmed my suspicions.

A fully qualified syntax is what I had in mind but I didn't suggest it - better let the dev team come up with their own ideas I reckon. Besides, in my scenario that wouldn't work because it could be akin to hardcoding the scope and I want a generic event handler that works for all containers, but basically ignores the "most local" scope. Does that make sense?
A fully qualified syntax is a good idea though.

The more and more I look at this though the more I'm becoming convinced that this system variable that is scoped to the task in the event handler is something new in June CTP. I'm pretty sure that before then:

-there was only ever one occurence of System::ContainerStartTime
-it contained the start time of the container raising the event
-and it was scoped to the event handler

That is EXACTLY the same as System::SourceName, System::SourceDescription, System::SourceID, etc...

-Jamie

Reference Package Level Variables in a Script Component.

I am trying to reference a package level variable in a script component (in the Code) and am unable to do so successfully. I have it listed as a ReadOnlyVariables in the custom properties of the script component, however unable to reference it in the code.

Any help will be appreciated.

Thanks,

Andy.

Type "Me." and let intellisense help you from there.

-Jamie

|||

Jamie,

Thanks for your suggestion. I did that and I was able to locate the variable. What does "ME" refer to? Is it refering to the Script Component? Does typing ME in different procedures/functions within the Script Component refer to different things?

Thanks,

Andy.

|||

Now that I can reference the variable I am getting script component errors.

I am basically using the RowCount Component variable and reading into the script and writing it out to the destination.

I put the RowCount Variable in the ReadWriteVariables property of the Script Component since having it in the ReadOnlyVariables was hanging the application. But when I put it under the ReadWriteVariables, I get the following error.

The collection of variables locked for read and write access is not available outside of PostExecute.

at Microsoft.SqlServer.Dts.Pipeline.ScriptComponent.get_ReadWriteVariables()

at ScriptComponent_e27beb91ebac4849bc732f8d8577fd5c.Variables.get_CountID()

at ScriptComponent_e27beb91ebac4849bc732f8d8577fd5c.ScriptMain.WriteTrailerCount2()

at ScriptComponent_e27beb91ebac4849bc732f8d8577fd5c.ScriptMain.Input0_ProcessInput(Input0Buffer Buffer)

at ScriptComponent_e27beb91ebac4849bc732f8d8577fd5c.UserComponent.ProcessInput(Int32 InputID, PipelineBuffer Buffer)

at Microsoft.SqlServer.Dts.Pipeline.ScriptComponentHost.ProcessInput(Int32 inputID, PipelineBuffer buffer)

|||

OK, a couple of things:

1) Are your script and rowcount components in the same data-flow? This is not a good idea because the Rowcount component will not populate the variable until the data-flow is complete. If you want to use that value in the script component then you will have to break the data-flow into 2 and pass the data between the 2 using a raw file.

2) You can't reference variables listed in ReadWriteVariables inside the Input0_ProcessInputRow(Row) method. You can override the PostExecute() method which gets called when all the rows in the pipeline have passed through the component. ReadWriteVariables CAN be accessed in there.

What is it you're trying to achieve here?

-Jamie

|||

Jamie,

Firstly, I am very new to SSIS with no prior DTS experience, so please pardon my stupidity while asking questions.

1) Yes, RowCount and Script component are in the same dataflow. I wasn't aware that the RowCount variable gets populated once the data flow is completed.

2) By the time I reference my variable in the PostExecute() method isn't it too late since I need to write it out to the output buffer? I was able to programatically count the input rows and write it out. I was trying another way of accomplishing the same thing but instead of me programatically counting, I was wanting the RowCount Component to do that for me and me just grabbing the variable with the count in it and writing it out to the destination. Having the variable as ReadOnly on the script component basically hangs the entire dataflow and having it as ReadWrite causes an error when it reaches the script component.

3) Is there any documentation on the sequence of execution of methods in the script component?

|||

Andy_1979 wrote:

Jamie,

Firstly, I am very new to SSIS with no prior DTS experience, so please pardon my stupidity while asking questions.

No problem. We're all here to learn right? :)

Andy_1979 wrote:

1) Yes, RowCount and Script component are in the same dataflow. I wasn't aware that the RowCount variable gets populated once the data flow is completed.

Well this may not actually physically be the case but logically that is how you should think of it. There is certainly no guarantee that a variable populated in a component will be readable by another component in the same data-flow. You should never attempt to do this.

Don't think of the components as seperate "things". The lowest unit of execution is a data-flow. The components are just the constituent parts of that and it helps to think of them as of they are actually all executing at the same time

Andy_1979 wrote:

2) By the time I reference my variable in the PostExecute() method isn't it too late since I need to write it out to the output buffer?

Well it depends what you want to do. If you want to write it to the output buffer then you should be able to do this by splitting the data-flow into 2 as I previously suggested.

I'm actually more concerned about why you want to do this. I know I don't know your requirement but do you really need to put the same value into every single row in the pipeline? That strikes me as a strange thing to do.

Andy_1979 wrote:

I was able to programatically count the input rows and write it out. I was trying another way of accomplishing the same thing but instead of me programatically counting, I was wanting the RowCount Component to do that for me and me just grabbing the variable with the count in it and writing it out to the destination. Having the variable as ReadOnly on the script component basically hangs the entire dataflow and having it as ReadWrite causes an error when it reaches the script component.

The reason putting it in ReadOnlyVariables causes it to hang is because you are trying to read from it before the Rowcount component has finished with it. The Rowcount component has locked the variable. I refer you to my earlier point about how a data-flow executes. it is not as simple as just a series of sequential operations even though it looks as though it is.

Andy_1979 wrote:

3) Is there any documentation on the sequence of execution of methods in the script component?

Errr... probably yeah. Its fairly intuitive though. Perhaps this article in BOL will help: ms-help://MS.SQLCC.v9/MS.SQLSVR.v9.en/dtsref9/html/2a0aae82-39cc-4423-b09a-72d2f61033bd.htm

Why do you want to put this value into the pipeline?

-Jamie

|||

Jamie,

Thank you so much for taking time to explain all of this. The RowCount Variable is written out to destination at the end of processing as a new row. It is not outputted on every single row. I basically want to count the number of input rows coming into my script component, process them and write them out but at the end write out an additional line which has the count of total rows processed.

Andy.

|||

Well it sounds as though the extra row you want to output will most likely have different column metadata to the rest of the pipeline and if that's the case then you won't be able to do this.

But...if you do want to...then here's what you should do.

Use a script component|||This whole variable story is a joke isn't it?|||

orbit wrote:

This whole variable story is a joke isn't it?

That's not a particularly useful statement. What do you mean? Do you have feedback for the product? If so, submit it at Microsoft Conenct.

-Jamie

Reference Package Level Variables in a Script Component.

I am trying to reference a package level variable in a script component (in the Code) and am unable to do so successfully. I have it listed as a ReadOnlyVariables in the custom properties of the script component, however unable to reference it in the code.

Any help will be appreciated.

Thanks,

Andy.

Type "Me." and let intellisense help you from there.

-Jamie

|||

Jamie,

Thanks for your suggestion. I did that and I was able to locate the variable. What does "ME" refer to? Is it refering to the Script Component? Does typing ME in different procedures/functions within the Script Component refer to different things?

Thanks,

Andy.

|||

Now that I can reference the variable I am getting script component errors.

I am basically using the RowCount Component variable and reading into the script and writing it out to the destination.

I put the RowCount Variable in the ReadWriteVariables property of the Script Component since having it in the ReadOnlyVariables was hanging the application. But when I put it under the ReadWriteVariables, I get the following error.

The collection of variables locked for read and write access is not available outside of PostExecute.

at Microsoft.SqlServer.Dts.Pipeline.ScriptComponent.get_ReadWriteVariables()

at ScriptComponent_e27beb91ebac4849bc732f8d8577fd5c.Variables.get_CountID()

at ScriptComponent_e27beb91ebac4849bc732f8d8577fd5c.ScriptMain.WriteTrailerCount2()

at ScriptComponent_e27beb91ebac4849bc732f8d8577fd5c.ScriptMain.Input0_ProcessInput(Input0Buffer Buffer)

at ScriptComponent_e27beb91ebac4849bc732f8d8577fd5c.UserComponent.ProcessInput(Int32 InputID, PipelineBuffer Buffer)

at Microsoft.SqlServer.Dts.Pipeline.ScriptComponentHost.ProcessInput(Int32 inputID, PipelineBuffer buffer)

|||

OK, a couple of things:

1) Are your script and rowcount components in the same data-flow? This is not a good idea because the Rowcount component will not populate the variable until the data-flow is complete. If you want to use that value in the script component then you will have to break the data-flow into 2 and pass the data between the 2 using a raw file.

2) You can't reference variables listed in ReadWriteVariables inside the Input0_ProcessInputRow(Row) method. You can override the PostExecute() method which gets called when all the rows in the pipeline have passed through the component. ReadWriteVariables CAN be accessed in there.

What is it you're trying to achieve here?

-Jamie

|||

Jamie,

Firstly, I am very new to SSIS with no prior DTS experience, so please pardon my stupidity while asking questions.

1) Yes, RowCount and Script component are in the same dataflow. I wasn't aware that the RowCount variable gets populated once the data flow is completed.

2) By the time I reference my variable in the PostExecute() method isn't it too late since I need to write it out to the output buffer? I was able to programatically count the input rows and write it out. I was trying another way of accomplishing the same thing but instead of me programatically counting, I was wanting the RowCount Component to do that for me and me just grabbing the variable with the count in it and writing it out to the destination. Having the variable as ReadOnly on the script component basically hangs the entire dataflow and having it as ReadWrite causes an error when it reaches the script component.

3) Is there any documentation on the sequence of execution of methods in the script component?

|||

Andy_1979 wrote:

Jamie,

Firstly, I am very new to SSIS with no prior DTS experience, so please pardon my stupidity while asking questions.

No problem. We're all here to learn right? :)

Andy_1979 wrote:

1) Yes, RowCount and Script component are in the same dataflow. I wasn't aware that the RowCount variable gets populated once the data flow is completed.

Well this may not actually physically be the case but logically that is how you should think of it. There is certainly no guarantee that a variable populated in a component will be readable by another component in the same data-flow. You should never attempt to do this.

Don't think of the components as seperate "things". The lowest unit of execution is a data-flow. The components are just the constituent parts of that and it helps to think of them as of they are actually all executing at the same time

Andy_1979 wrote:

2) By the time I reference my variable in the PostExecute() method isn't it too late since I need to write it out to the output buffer?

Well it depends what you want to do. If you want to write it to the output buffer then you should be able to do this by splitting the data-flow into 2 as I previously suggested.

I'm actually more concerned about why you want to do this. I know I don't know your requirement but do you really need to put the same value into every single row in the pipeline? That strikes me as a strange thing to do.

Andy_1979 wrote:

I was able to programatically count the input rows and write it out. I was trying another way of accomplishing the same thing but instead of me programatically counting, I was wanting the RowCount Component to do that for me and me just grabbing the variable with the count in it and writing it out to the destination. Having the variable as ReadOnly on the script component basically hangs the entire dataflow and having it as ReadWrite causes an error when it reaches the script component.

The reason putting it in ReadOnlyVariables causes it to hang is because you are trying to read from it before the Rowcount component has finished with it. The Rowcount component has locked the variable. I refer you to my earlier point about how a data-flow executes. it is not as simple as just a series of sequential operations even though it looks as though it is.

Andy_1979 wrote:

3) Is there any documentation on the sequence of execution of methods in the script component?

Errr... probably yeah. Its fairly intuitive though. Perhaps this article in BOL will help: ms-help://MS.SQLCC.v9/MS.SQLSVR.v9.en/dtsref9/html/2a0aae82-39cc-4423-b09a-72d2f61033bd.htm

Why do you want to put this value into the pipeline?

-Jamie

|||

Jamie,

Thank you so much for taking time to explain all of this. The RowCount Variable is written out to destination at the end of processing as a new row. It is not outputted on every single row. I basically want to count the number of input rows coming into my script component, process them and write them out but at the end write out an additional line which has the count of total rows processed.

Andy.

|||

Well it sounds as though the extra row you want to output will most likely have different column metadata to the rest of the pipeline and if that's the case then you won't be able to do this.

But...if you do want to...then here's what you should do.

Use a script component|||This whole variable story is a joke isn't it?|||

orbit wrote:

This whole variable story is a joke isn't it?

That's not a particularly useful statement. What do you mean? Do you have feedback for the product? If so, submit it at Microsoft Conenct.

-Jamie

Friday, March 9, 2012

Reference for SSIS "C-like" script needed

Consider the Conditional Split task. I can use a C-like language to create statements such as

Ltrim ([Col1] =”A”) ||Ltrim([Col1] =”B”)

This sure ain’t VB-like and the list of functions in the upper right-hand pane of the task(“expression editor”) does not help me construct such statements.

Where is the reference manual describing this language?

TIA,

Barkingdog

P.S. I have found fragments in BOL but the info does not seem complete and the BOL topic fragmentation impedes learning.

P.P.S.Why MS uses this language instead of VB.NET, which they use in their Script tasks, is beyond me.

A few hours of looking around gave me this pointer:

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

|||

>P.P.S. Why MS uses this language instead of VB.NET, which they use in their Script tasks, is beyond me.

One of the key reasons is that languages such as VB.Net, or SQL for that matter, include flow of control and procedural constructs which would be unsuitable for use in an expression language. So does C, of course, but it is easier to create a subset of the C grammar without those constructs.

I used to worry that the expression syntax would be a real problem for folks, but I have to admit that (a) most people appear to be using very simple expressions and get the hang of it pretty quickly and (b) those that do need complex expressions are on the whole able to get to grips with the syntax, with the help of the reference you found.

I'd be interested to hear other opinions, of course ...

Donald

Wednesday, March 7, 2012

Redundant Indexes?

Hello,
Ive got a table called 'prd_movcomision' (Ive attached a script with its
structure) which has several indexes as you can see. There are several
indexes which are contained in others. For example:
CREATE INDEX [A] ON [dbo].[prd_movcomision]([pers_rutcia], [poli_codigo],
[itpo_codigo]) ON [PRIMARY]
GO
CREATE INDEX [B] ON [dbo].[prd_movcomision]([poli_codigo], [itpo_codigo])
ON [PRIMARY]
GO
CREATE INDEX [C] ON [dbo].[prd_movcomision]([prop_codigo]) ON [PRIMARY]
GO
Given the previous indexes, [B] is contained within [A] and [C] is
contained within [B]. The question is if this is really neccessary or once
I have an index A the other indexes (B and C) are redundant. Im having too
many problems with the size of the database, it is growing too fast.
Any advice on this would be very much appreciated.
Jorge Luzarraga
begin 666 prd_movcomision.sql
M:68@.97AI<W1S("AS96QE8W0@.*B!F<F]M(&1B;RYS>7-O8FIE8W1S('=H97)E
M(&ED(#T@.;V)J96-T7VED*$XG6V1B;UTN6W!R9%]M;W9C;VUI<VEO;ETG*2!A
M;F0@.3T)*14-44%)/4$525%DH:60L($XG27-5<V5R5&%B;&4G*2 ](#$I#0ID
M<F]P('1A8FQE(%MD8F]=+EMP<F1?;6]V8V]M:7-I;VY=#0I'3PT*#0I#4D5!
M5$4@.5$%"3$4@.6V1B;UTN6W!R9%]M;W9C;VUI<VEO;ET@.* T*"5MM;W9C7V-O
M9&EG;UT@.6VYU;65R:6-=*#$X+" P*2!.3U0@.3E5,3" L#0H)6VUO=F-?9F5C
M;6]V72!;9&%T971I;65=($Y/5"!.54Q,("P-"@.E;<&5R<U]R=71C:6%=(%MN
M=6UE<FEC72@.Y+" P*2!.54Q,("P-"@.E;:6YF:5]C;V1I9V]=(%MV87)C:&%R
M72 H-2D@.0T],3$%412!344Q?3&%T:6XQ7T=E;F5R86Q?0U Q7T-)7T%3($Y5
M3$P@.+ T*"5MD;V-O7VYU;65R;UT@.6VYU;65R:6-=*#$X+" P*2!.54Q,("P-
M"@.E;<&]L:5]C;V1I9V]=(%MN=6UE<FEC72@.Q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<')O<%]C;V1I9V]=+ T*"0E;:71P
M<E]C;V1I9V]=#0H)*2P-"@.E#3TY35%)!24Y4(%MF:U]R7VUN9%]M;W9C;VU=
M($9/4D5)1TX@.2T59( T*"2@.-"@.D)6VUO;F5?8V]D:6=O70T*"2D@.4D5&15)%
M3D-%4R!;9&)O72Y;861M7VUO;F5D85T@.* T*"0E;;6]N95]C;V1I9V]=#0H)
M*0T*1T\-"@.T*86QT97(@.=&%B;&4@.6V1B;UTN6W!R9%]M;W9C;VUI<VEO;ET@.
M;F]C:&5C:R!C;VYS=')A:6YT(%MF:U]R7V5S=%]M;W9C;VU=#0I'3PT*#0IA
M;'1E<B!T86)L92!;9&)O72Y;<')D7VUO=F-O;6ES:6]N72!N;V-H96-K(&-O
M;G-T<F%I;G0@.6V9K7W)?97-T8VEE<E]M;W9C;VU=#0I'3PT*#0IA;'1E<B!T
M86)L92!;9&)O72Y;<')D7VUO=F-O;6ES:6]N72!N;V-H96-K(&-O;G-T<F%I
M;G0@.6V9K7W)?:71M<')?;6]V8V]M70T*1T\-"@.T*86QT97(@.=&%B;&4@.6V1B
M;UTN6W!R9%]M;W9C;VUI<VEO;ET@.;F]C:&5C:R!C;VYS=')A:6YT(%MF:U]R
47VUN9%]M;W9C;VU=#0I'3PT*#0H`
`
end
Hi
I would get rid or A and B. If there is no clustered index on that table,
make C clustered too, assuming it has good selectivity.
Without the data types, it is not possible to tell and be 100% sure (your
attachment gets blocked by Outlook Express)
Regards
Mike Epprecht, Microsoft SQL Server MVP
Zurich, Switzerland
IM: mike@.epprecht.net
MVP Program: http://www.microsoft.com/mvp
Blog: http://www.msmvps.com/epprecht/
"Jorge Luzarraga Castro" <jluzarraga@.fidens.cl> wrote in message
news:eM97v2b6EHA.2032@.tk2msftngp13.phx.gbl...
> Hello,
>
> Ive got a table called 'prd_movcomision' (Ive attached a script with its
> structure) which has several indexes as you can see. There are several
> indexes which are contained in others. For example:
> CREATE INDEX [A] ON [dbo].[prd_movcomision]([pers_rutcia], [poli_codigo],
> [itpo_codigo]) ON [PRIMARY]
> GO
> CREATE INDEX [B] ON [dbo].[prd_movcomision]([poli_codigo],
[itpo_codigo])
> ON [PRIMARY]
> GO
> CREATE INDEX [C] ON [dbo].[prd_movcomision]([prop_codigo]) ON [PRIMARY]
> GO
>
> Given the previous indexes, [B] is contained within [A] and [C] is
> contained within [B]. The question is if this is really neccessary or
once
> I have an index A the other indexes (B and C) are redundant. Im having
too
> many problems with the size of the database, it is growing too fast.
>
> Any advice on this would be very much appreciated.
>
> Jorge Luzarraga
>
>
|||Hello Mike,
Are you talking about getting rid of the one which contains the others? Any
help is very much appreciated.
this is the script:
************************************************** ********************
if exists (select * from dbo.sysobjects where id =
object_id(N'[dbo].[prd_movcomision]') and OBJECTPROPERTY(id, N'IsUserTable')
= 1)
drop table [dbo].[prd_movcomision]
GO
CREATE TABLE [dbo].[prd_movcomision] (
[movc_codigo] [numeric](18, 0) NOT NULL ,
[movc_fecmov] [datetime] NOT NULL ,
[pers_rutcia] [numeric](9, 0) NULL ,
[infi_codigo] [varchar] (5) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
[doco_numero] [numeric](18, 0) NULL ,
[poli_codigo] [numeric](18, 0) NULL ,
[itpo_codigo] [numeric](18, 0) NULL ,
[esta_codigo] [numeric](4, 0) NULL ,
[mone_codigo] [char] (3) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
[prop_codigo] [numeric](18, 0) NULL ,
[itpr_codigo] [numeric](18, 0) NULL ,
[cone_codigo] [numeric](18, 0) NULL ,
[prop_fecdocum] [datetime] NULL ,
[prop_fecemision] [datetime] NULL ,
[prop_fecinicio] [datetime] NULL ,
[itpr_fecinicio] [datetime] NULL ,
[poli_fecemision] [datetime] NULL ,
[poli_fecinicio] [datetime] NULL ,
[itpo_fecinicio] [datetime] NULL ,
[movc_concepto] [char] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
[movc_tipointerm] [char] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
[movc_periodo] [numeric](6, 0) NULL ,
[movc_motnopago] [varchar] (255) COLLATE SQL_Latin1_General_CP1_CI_AS NULL
,
[movc_indcriterio] [char] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
[movc_tipo] [char] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
[movc_unidadcom] [char] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
[movc_fijo] [numeric](18, 4) NULL ,
[movc_variable] [numeric](7, 3) NULL ,
[movc_prima] [numeric](18, 4) NULL ,
[movc_montomo] [numeric](18, 4) NOT NULL ,
[movc_montomc] [numeric](18, 4) NULL ,
[movc_fecvalor] [datetime] NULL ,
[movc_feccierre] [datetime] NULL ,
[movc_observacion] [varchar] (255) COLLATE SQL_Latin1_General_CP1_CI_AS
NULL ,
[movc_tiporango] [char] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
[cier_tipo] [char] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
[cier_correlativo] [numeric](18, 0) NULL ,
[cuot_codigo] [numeric](18, 0) NULL ,
[cuot_numero] [numeric](4, 0) NULL ,
[movc_fecmeta] [datetime] NULL ,
[movc_primaneta] [t_dom_monto] NULL ,
[movc_fecpagocomis] [t_dom_fecha] NULL
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[prd_movcomision] WITH NOCHECK ADD
CONSTRAINT [pk_movcomision] PRIMARY KEY CLUSTERED
(
[movc_codigo]
) ON [PRIMARY]
GO
CREATE INDEX [AK_prd_movcomision] ON
[dbo].[prd_movcomision]([movc_tipointerm], [pers_rutcia], [movc_concepto],
[cone_codigo], [poli_codigo]) ON [PRIMARY]
GO
CREATE INDEX [Ai_prd_movcomision2] ON
[dbo].[prd_movcomision]([pers_rutcia], [poli_codigo], [itpo_codigo]) ON
[PRIMARY]
GO
CREATE INDEX [IX_prd_movcomision] ON
[dbo].[prd_movcomision]([poli_codigo], [itpo_codigo]) ON [PRIMARY]
GO
CREATE INDEX [IX_prd_movcomision1] ON
[dbo].[prd_movcomision]([prop_codigo]) ON [PRIMARY]
GO
CREATE INDEX [IX_prd_movcomision2] ON
[dbo].[prd_movcomision]([poli_codigo]) ON [PRIMARY]
GO
/****** The index created by the following statement is for internal use
only. ******/
/****** It is not a real index but exists as statistics only. ******/
if (@.@.microsoftversion > 0x07000000 )
EXEC ('CREATE STATISTICS [Statistic_movc_fecpagocomis] ON
[dbo].[prd_movcomision] ([movc_fecpagocomis]) ')
GO
ALTER TABLE [dbo].[prd_movcomision] ADD
CONSTRAINT [fk_r_cone_movcom] FOREIGN KEY
(
[cone_codigo]
) REFERENCES [dbo].[prd_comnegocio] (
[cone_codigo]
),
CONSTRAINT [fk_r_cuot_movcom] FOREIGN KEY
(
[cuot_codigo],
[cuot_numero]
) REFERENCES [dbo].[prd_cuota] (
[cuot_codigo],
[cuot_numero]
),
CONSTRAINT [fk_r_doccom_movcom] FOREIGN KEY
(
[pers_rutcia],
[infi_codigo],
[doco_numero]
) REFERENCES [dbo].[prd_doccomision] (
[pers_rutcia],
[infi_codigo],
[doco_numero]
),
CONSTRAINT [fk_r_est_movcom] FOREIGN KEY
(
[esta_codigo]
) REFERENCES [dbo].[adm_estado] (
[esta_codigo]
),
CONSTRAINT [fk_r_estcier_movcom] FOREIGN KEY
(
[movc_periodo],
[cier_tipo],
[cier_correlativo]
) REFERENCES [dbo].[prd_estadocierre] (
[cier_periodo],
[cier_tipo],
[cier_correlativo]
),
CONSTRAINT [fk_r_itmpr_movcom] FOREIGN KEY
(
[prop_codigo],
[itpr_codigo]
) REFERENCES [dbo].[vta_itmpropuesta] (
[prop_codigo],
[itpr_codigo]
),
CONSTRAINT [fk_r_mnd_movcom] FOREIGN KEY
(
[mone_codigo]
) REFERENCES [dbo].[adm_moneda] (
[mone_codigo]
)
GO
alter table [dbo].[prd_movcomision] nocheck constraint [fk_r_est_movcom]
GO
alter table [dbo].[prd_movcomision] nocheck constraint [fk_r_estcier_movcom]
GO
alter table [dbo].[prd_movcomision] nocheck constraint [fk_r_itmpr_movcom]
GO
alter table [dbo].[prd_movcomision] nocheck constraint [fk_r_mnd_movcom]
GO
************************************************** ***************
"Mike Epprecht (SQL MVP)" <mike@.epprecht.net> escribi en el mensaje
news:ODK5Ric6EHA.1392@.tk2msftngp13.phx.gbl...
> Hi
> I would get rid or A and B. If there is no clustered index on that table,
> make C clustered too, assuming it has good selectivity.
> Without the data types, it is not possible to tell and be 100% sure (your
> attachment gets blocked by Outlook Express)
> Regards
> --
> Mike Epprecht, Microsoft SQL Server MVP
> Zurich, Switzerland
> IM: mike@.epprecht.net
> MVP Program: http://www.microsoft.com/mvp
> Blog: http://www.msmvps.com/epprecht/
> "Jorge Luzarraga Castro" <jluzarraga@.fidens.cl> wrote in message
> news:eM97v2b6EHA.2032@.tk2msftngp13.phx.gbl...
> [itpo_codigo])
> once
> too
>
|||Hi
All those columns are nullable, so making a compound index (multiple
columns) is not a good idea. From my experience, the query processor will
think of them as 2nd choice.
Having 1 index on poli_codigo and one on poli_codigo will cover your
queries, and will improve Insert/Update performance as compound index add a
lot to index maintenance.
Regards
Mike Epprecht, Microsoft SQL Server MVP
Zurich, Switzerland
IM: mike@.epprecht.net
MVP Program: http://www.microsoft.com/mvp
Blog: http://www.msmvps.com/epprecht/
"Jorge Luzarraga Castro" <jluzarraga@.fidens.cl> wrote in message
news:u0fD$1c6EHA.208@.TK2MSFTNGP12.phx.gbl...
> Hello Mike,
> Are you talking about getting rid of the one which contains the others?
Any
> help is very much appreciated.
> this is the script:
> ************************************************** ********************
> if exists (select * from dbo.sysobjects where id =
> object_id(N'[dbo].[prd_movcomision]') and OBJECTPROPERTY(id,
N'IsUserTable')
> = 1)
> drop table [dbo].[prd_movcomision]
> GO
> CREATE TABLE [dbo].[prd_movcomision] (
> [movc_codigo] [numeric](18, 0) NOT NULL ,
> [movc_fecmov] [datetime] NOT NULL ,
> [pers_rutcia] [numeric](9, 0) NULL ,
> [infi_codigo] [varchar] (5) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
> [doco_numero] [numeric](18, 0) NULL ,
> [poli_codigo] [numeric](18, 0) NULL ,
> [itpo_codigo] [numeric](18, 0) NULL ,
> [esta_codigo] [numeric](4, 0) NULL ,
> [mone_codigo] [char] (3) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
> [prop_codigo] [numeric](18, 0) NULL ,
> [itpr_codigo] [numeric](18, 0) NULL ,
> [cone_codigo] [numeric](18, 0) NULL ,
> [prop_fecdocum] [datetime] NULL ,
> [prop_fecemision] [datetime] NULL ,
> [prop_fecinicio] [datetime] NULL ,
> [itpr_fecinicio] [datetime] NULL ,
> [poli_fecemision] [datetime] NULL ,
> [poli_fecinicio] [datetime] NULL ,
> [itpo_fecinicio] [datetime] NULL ,
> [movc_concepto] [char] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
> [movc_tipointerm] [char] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
> [movc_periodo] [numeric](6, 0) NULL ,
> [movc_motnopago] [varchar] (255) COLLATE SQL_Latin1_General_CP1_CI_AS
NULL
> ,
> [movc_indcriterio] [char] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
> [movc_tipo] [char] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
> [movc_unidadcom] [char] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
> [movc_fijo] [numeric](18, 4) NULL ,
> [movc_variable] [numeric](7, 3) NULL ,
> [movc_prima] [numeric](18, 4) NULL ,
> [movc_montomo] [numeric](18, 4) NOT NULL ,
> [movc_montomc] [numeric](18, 4) NULL ,
> [movc_fecvalor] [datetime] NULL ,
> [movc_feccierre] [datetime] NULL ,
> [movc_observacion] [varchar] (255) COLLATE SQL_Latin1_General_CP1_CI_AS
> NULL ,
> [movc_tiporango] [char] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
> [cier_tipo] [char] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
> [cier_correlativo] [numeric](18, 0) NULL ,
> [cuot_codigo] [numeric](18, 0) NULL ,
> [cuot_numero] [numeric](4, 0) NULL ,
> [movc_fecmeta] [datetime] NULL ,
> [movc_primaneta] [t_dom_monto] NULL ,
> [movc_fecpagocomis] [t_dom_fecha] NULL
> ) ON [PRIMARY]
> GO
> ALTER TABLE [dbo].[prd_movcomision] WITH NOCHECK ADD
> CONSTRAINT [pk_movcomision] PRIMARY KEY CLUSTERED
> (
> [movc_codigo]
> ) ON [PRIMARY]
> GO
> CREATE INDEX [AK_prd_movcomision] ON
> [dbo].[prd_movcomision]([movc_tipointerm], [pers_rutcia], [movc_concepto],
> [cone_codigo], [poli_codigo]) ON [PRIMARY]
> GO
> CREATE INDEX [Ai_prd_movcomision2] ON
> [dbo].[prd_movcomision]([pers_rutcia], [poli_codigo], [itpo_codigo]) ON
> [PRIMARY]
> GO
> CREATE INDEX [IX_prd_movcomision] ON
> [dbo].[prd_movcomision]([poli_codigo], [itpo_codigo]) ON [PRIMARY]
> GO
> CREATE INDEX [IX_prd_movcomision1] ON
> [dbo].[prd_movcomision]([prop_codigo]) ON [PRIMARY]
> GO
> CREATE INDEX [IX_prd_movcomision2] ON
> [dbo].[prd_movcomision]([poli_codigo]) ON [PRIMARY]
> GO
> /****** The index created by the following statement is for internal use
> only. ******/
> /****** It is not a real index but exists as statistics only. ******/
> if (@.@.microsoftversion > 0x07000000 )
> EXEC ('CREATE STATISTICS [Statistic_movc_fecpagocomis] ON
> [dbo].[prd_movcomision] ([movc_fecpagocomis]) ')
> GO
> ALTER TABLE [dbo].[prd_movcomision] ADD
> CONSTRAINT [fk_r_cone_movcom] FOREIGN KEY
> (
> [cone_codigo]
> ) REFERENCES [dbo].[prd_comnegocio] (
> [cone_codigo]
> ),
> CONSTRAINT [fk_r_cuot_movcom] FOREIGN KEY
> (
> [cuot_codigo],
> [cuot_numero]
> ) REFERENCES [dbo].[prd_cuota] (
> [cuot_codigo],
> [cuot_numero]
> ),
> CONSTRAINT [fk_r_doccom_movcom] FOREIGN KEY
> (
> [pers_rutcia],
> [infi_codigo],
> [doco_numero]
> ) REFERENCES [dbo].[prd_doccomision] (
> [pers_rutcia],
> [infi_codigo],
> [doco_numero]
> ),
> CONSTRAINT [fk_r_est_movcom] FOREIGN KEY
> (
> [esta_codigo]
> ) REFERENCES [dbo].[adm_estado] (
> [esta_codigo]
> ),
> CONSTRAINT [fk_r_estcier_movcom] FOREIGN KEY
> (
> [movc_periodo],
> [cier_tipo],
> [cier_correlativo]
> ) REFERENCES [dbo].[prd_estadocierre] (
> [cier_periodo],
> [cier_tipo],
> [cier_correlativo]
> ),
> CONSTRAINT [fk_r_itmpr_movcom] FOREIGN KEY
> (
> [prop_codigo],
> [itpr_codigo]
> ) REFERENCES [dbo].[vta_itmpropuesta] (
> [prop_codigo],
> [itpr_codigo]
> ),
> CONSTRAINT [fk_r_mnd_movcom] FOREIGN KEY
> (
> [mone_codigo]
> ) REFERENCES [dbo].[adm_moneda] (
> [mone_codigo]
> )
> GO
> alter table [dbo].[prd_movcomision] nocheck constraint [fk_r_est_movcom]
> GO
> alter table [dbo].[prd_movcomision] nocheck constraint
[fk_r_estcier_movcom][vbcol=seagreen]
> GO
> alter table [dbo].[prd_movcomision] nocheck constraint [fk_r_itmpr_movcom]
> GO
> alter table [dbo].[prd_movcomision] nocheck constraint [fk_r_mnd_movcom]
> GO
> ************************************************** ***************
> "Mike Epprecht (SQL MVP)" <mike@.epprecht.net> escribi en el mensaje
> news:ODK5Ric6EHA.1392@.tk2msftngp13.phx.gbl...
table,[vbcol=seagreen]
(your[vbcol=seagreen]
[PRIMARY]
>
|||It looks like Mike has this handled, but I'd like to interject here.
First, histogram statistics are only stored for the first attribute in any
index, composite or not. That means the QA selectivity evaluation is based
on the leading attribute...alone, regardless if it is singlet or composite.
Second, since SQL Server version 7.0, the Query Optimizer can use index
intersection to make better search conditions...viz., you are not limited to
using a single index in a query expression. Either an index is highly
selective, or it is not. Having multiple single-attribute indexes is more
desirble than fewer composite indexes. And, never should you require
overlapping indexes; SQL Server will only choose one based on selectivity,
the others would only be a waste of space.
That being said, after a set of well chosen, single-attribute indexes have
been created, and every table--and I mean EVERY table--should have a
clustered index defined, then a few--VERY FEW--customized, query targeted,
mission-critical, composite indexes can be built, but only after proving the
multiple single-attribute indexes are not producing sufficient response.
Everything else will only produce storage and processing overhead whenever
you do CRUD or reorg operations.
Sincerely,
Anthony Thomas

"Jorge Luzarraga Castro" <jluzarraga@.fidens.cl> wrote in message
news:u0fD$1c6EHA.208@.TK2MSFTNGP12.phx.gbl...
Hello Mike,
Are you talking about getting rid of the one which contains the others? Any
help is very much appreciated.
this is the script:
************************************************** ********************
if exists (select * from dbo.sysobjects where id =
object_id(N'[dbo].[prd_movcomision]') and OBJECTPROPERTY(id, N'IsUserTable')
= 1)
drop table [dbo].[prd_movcomision]
GO
CREATE TABLE [dbo].[prd_movcomision] (
[movc_codigo] [numeric](18, 0) NOT NULL ,
[movc_fecmov] [datetime] NOT NULL ,
[pers_rutcia] [numeric](9, 0) NULL ,
[infi_codigo] [varchar] (5) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
[doco_numero] [numeric](18, 0) NULL ,
[poli_codigo] [numeric](18, 0) NULL ,
[itpo_codigo] [numeric](18, 0) NULL ,
[esta_codigo] [numeric](4, 0) NULL ,
[mone_codigo] [char] (3) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
[prop_codigo] [numeric](18, 0) NULL ,
[itpr_codigo] [numeric](18, 0) NULL ,
[cone_codigo] [numeric](18, 0) NULL ,
[prop_fecdocum] [datetime] NULL ,
[prop_fecemision] [datetime] NULL ,
[prop_fecinicio] [datetime] NULL ,
[itpr_fecinicio] [datetime] NULL ,
[poli_fecemision] [datetime] NULL ,
[poli_fecinicio] [datetime] NULL ,
[itpo_fecinicio] [datetime] NULL ,
[movc_concepto] [char] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
[movc_tipointerm] [char] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
[movc_periodo] [numeric](6, 0) NULL ,
[movc_motnopago] [varchar] (255) COLLATE SQL_Latin1_General_CP1_CI_AS NULL
,
[movc_indcriterio] [char] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
[movc_tipo] [char] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
[movc_unidadcom] [char] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
[movc_fijo] [numeric](18, 4) NULL ,
[movc_variable] [numeric](7, 3) NULL ,
[movc_prima] [numeric](18, 4) NULL ,
[movc_montomo] [numeric](18, 4) NOT NULL ,
[movc_montomc] [numeric](18, 4) NULL ,
[movc_fecvalor] [datetime] NULL ,
[movc_feccierre] [datetime] NULL ,
[movc_observacion] [varchar] (255) COLLATE SQL_Latin1_General_CP1_CI_AS
NULL ,
[movc_tiporango] [char] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
[cier_tipo] [char] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
[cier_correlativo] [numeric](18, 0) NULL ,
[cuot_codigo] [numeric](18, 0) NULL ,
[cuot_numero] [numeric](4, 0) NULL ,
[movc_fecmeta] [datetime] NULL ,
[movc_primaneta] [t_dom_monto] NULL ,
[movc_fecpagocomis] [t_dom_fecha] NULL
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[prd_movcomision] WITH NOCHECK ADD
CONSTRAINT [pk_movcomision] PRIMARY KEY CLUSTERED
(
[movc_codigo]
) ON [PRIMARY]
GO
CREATE INDEX [AK_prd_movcomision] ON
[dbo].[prd_movcomision]([movc_tipointerm], [pers_rutcia], [movc_concepto],
[cone_codigo], [poli_codigo]) ON [PRIMARY]
GO
CREATE INDEX [Ai_prd_movcomision2] ON
[dbo].[prd_movcomision]([pers_rutcia], [poli_codigo], [itpo_codigo]) ON
[PRIMARY]
GO
CREATE INDEX [IX_prd_movcomision] ON
[dbo].[prd_movcomision]([poli_codigo], [itpo_codigo]) ON [PRIMARY]
GO
CREATE INDEX [IX_prd_movcomision1] ON
[dbo].[prd_movcomision]([prop_codigo]) ON [PRIMARY]
GO
CREATE INDEX [IX_prd_movcomision2] ON
[dbo].[prd_movcomision]([poli_codigo]) ON [PRIMARY]
GO
/****** The index created by the following statement is for internal use
only. ******/
/****** It is not a real index but exists as statistics only. ******/
if (@.@.microsoftversion > 0x07000000 )
EXEC ('CREATE STATISTICS [Statistic_movc_fecpagocomis] ON
[dbo].[prd_movcomision] ([movc_fecpagocomis]) ')
GO
ALTER TABLE [dbo].[prd_movcomision] ADD
CONSTRAINT [fk_r_cone_movcom] FOREIGN KEY
(
[cone_codigo]
) REFERENCES [dbo].[prd_comnegocio] (
[cone_codigo]
),
CONSTRAINT [fk_r_cuot_movcom] FOREIGN KEY
(
[cuot_codigo],
[cuot_numero]
) REFERENCES [dbo].[prd_cuota] (
[cuot_codigo],
[cuot_numero]
),
CONSTRAINT [fk_r_doccom_movcom] FOREIGN KEY
(
[pers_rutcia],
[infi_codigo],
[doco_numero]
) REFERENCES [dbo].[prd_doccomision] (
[pers_rutcia],
[infi_codigo],
[doco_numero]
),
CONSTRAINT [fk_r_est_movcom] FOREIGN KEY
(
[esta_codigo]
) REFERENCES [dbo].[adm_estado] (
[esta_codigo]
),
CONSTRAINT [fk_r_estcier_movcom] FOREIGN KEY
(
[movc_periodo],
[cier_tipo],
[cier_correlativo]
) REFERENCES [dbo].[prd_estadocierre] (
[cier_periodo],
[cier_tipo],
[cier_correlativo]
),
CONSTRAINT [fk_r_itmpr_movcom] FOREIGN KEY
(
[prop_codigo],
[itpr_codigo]
) REFERENCES [dbo].[vta_itmpropuesta] (
[prop_codigo],
[itpr_codigo]
),
CONSTRAINT [fk_r_mnd_movcom] FOREIGN KEY
(
[mone_codigo]
) REFERENCES [dbo].[adm_moneda] (
[mone_codigo]
)
GO
alter table [dbo].[prd_movcomision] nocheck constraint [fk_r_est_movcom]
GO
alter table [dbo].[prd_movcomision] nocheck constraint [fk_r_estcier_movcom]
GO
alter table [dbo].[prd_movcomision] nocheck constraint [fk_r_itmpr_movcom]
GO
alter table [dbo].[prd_movcomision] nocheck constraint [fk_r_mnd_movcom]
GO
************************************************** ***************
"Mike Epprecht (SQL MVP)" <mike@.epprecht.net> escribi en el mensaje
news:ODK5Ric6EHA.1392@.tk2msftngp13.phx.gbl...
> Hi
> I would get rid or A and B. If there is no clustered index on that table,
> make C clustered too, assuming it has good selectivity.
> Without the data types, it is not possible to tell and be 100% sure (your
> attachment gets blocked by Outlook Express)
> Regards
> --
> Mike Epprecht, Microsoft SQL Server MVP
> Zurich, Switzerland
> IM: mike@.epprecht.net
> MVP Program: http://www.microsoft.com/mvp
> Blog: http://www.msmvps.com/epprecht/
> "Jorge Luzarraga Castro" <jluzarraga@.fidens.cl> wrote in message
> news:eM97v2b6EHA.2032@.tk2msftngp13.phx.gbl...
> [itpo_codigo])
> once
> too
>
|||Jorge Luzarraga Castro (jluzarraga@.fidens.cl) writes:
> Ive got a table called 'prd_movcomision' (Ive attached a script with its
> structure) which has several indexes as you can see. There are several
> indexes which are contained in others. For example:
> CREATE INDEX [A] ON [dbo].[prd_movcomision]([pers_rutcia], [poli_codigo],
> [itpo_codigo]) ON [PRIMARY]
> GO
> CREATE INDEX [B] ON [dbo].[prd_movcomision]([poli_codigo],
> [itpo_codigo])
> ON [PRIMARY]
> GO
> CREATE INDEX [C] ON [dbo].[prd_movcomision]([prop_codigo]) ON [PRIMARY]
> GO
>
> Given the previous indexes, [B] is contained within [A] and [C] is
> contained within [B]. The question is if this is really neccessary or
> once I have an index A the other indexes (B and C) are redundant.
There are no redudant indexes in your table. There may be unused indexes,
that I can't tell, because that depends on your queries.
While the columns index B is included in index A, a query like:
SELECT * FROM tbl WHERE poli_coidgo = @.val1 AND itpo_codigo = @.val2
cannot seek index A to find any rows. It can scan the index, though.
The difference here is that "seek" means that SQL Server finds the
value by walking the fast way through the index tree. "scan" means
that SQL Server searches all leaf pages of the index, which is considerably
slower. In reality, SQL Server will probably scan the entire table instead,
which is even slower. (As a scan. Beside the scanning the index, SQL Server
will also have to access data pages, and with many hits, that can be more
data-pages access than a table scan.)
The same goes for index C, assuming that you mean to have itpo_codigo hear.
So the important issue here, is whether you actually have any queries for
which these indexes are useful.

> Im having too many problems with the size of the database, it is
> growing too fast.
I don't think dropping indexes is a very good help to address that. In
such case it's better to examine whether there is data that is inserted
multiple times, data which is not removed as it should be etc.
Dropping an index can conserve some space - but it can also kill
performance, if there is a query which needs the index.
Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se
Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techinf...2000/books.asp

Redundancy

Is there any untility, program, or script that I can use to backup a SQL
database and will look for the main SQL server? If for anyreason that server
is not seen on the network a backup server will pick up from the last back up
and carry on where the first server left off. It seems logical there would
be.
For starters, check out Fail-over Clustering in the SQL Server Books Online.
Hope this helps.
Dan Guzman
SQL Server MVP
"Paul" <Paul@.discussions.microsoft.com> wrote in message
news:64D81DCB-E75E-437C-9FE4-D007EB19B016@.microsoft.com...
> Is there any untility, program, or script that I can use to backup a SQL
> database and will look for the main SQL server? If for anyreason that
> server
> is not seen on the network a backup server will pick up from the last back
> up
> and carry on where the first server left off. It seems logical there
> would
> be.
|||Hi
For the various highg availablility options check out:
http://www.microsoft.com/sql/techinf...ailability.asp
John
"Paul" <Paul@.discussions.microsoft.com> wrote in message
news:64D81DCB-E75E-437C-9FE4-D007EB19B016@.microsoft.com...
> Is there any untility, program, or script that I can use to backup a SQL
> database and will look for the main SQL server? If for anyreason that
> server
> is not seen on the network a backup server will pick up from the last back
> up
> and carry on where the first server left off. It seems logical there
> would
> be.
|||Dan,
Would this only work on either NT or 2k Server or could this be done on any
MS OS? Exactly what I am trying to solve is this: I am working with a Point
of Sale software that uses either MSDE or SQL Server for the larger sites to
control the databases. My problem is what happens if the main server goes
down? Clustering could be an option. Any other ideas?
"Dan Guzman" wrote:

> For starters, check out Fail-over Clustering in the SQL Server Books Online.
> --
> Hope this helps.
> Dan Guzman
> SQL Server MVP
> "Paul" <Paul@.discussions.microsoft.com> wrote in message
> news:64D81DCB-E75E-437C-9FE4-D007EB19B016@.microsoft.com...
>
>
|||> Would this only work on either NT or 2k Server or could this be done on
> any
> MS OS?
You need SQL Server Enterprise edition as well as one of the server OS
editions below. From the Books Online Fail-over Clustering overview:
<Excerpt href-"adminsql.chm::/ad_clustering_7t9v.htm">
Before installing failover clustering, you must install Microsoft Windows
NT 4.0, Enterprise Edition, Microsoft Windows 2000 Advanced Server or
Windows 2000 Datacenter Server, and the Microsoft Cluster Service (MSCS).
</Excerpt>
Additionally, you need to have supported hardware, including shared disks.
Clustering may be an option for you larger POS implementations but not for
the MSDE ones.
There are some new high-availability features in the upcoming SQL 2005
version that don't require specialized clustering hardware. See the
high-availability demo at
http://www.microsoft.com/sql/2005/pr...mos/hademo.asp
Hope this helps.
Dan Guzman
SQL Server MVP
"Paul" <Paul@.discussions.microsoft.com> wrote in message
news:3D25F3F5-E235-41CA-9693-2E176116AA8A@.microsoft.com...[vbcol=seagreen]
> Dan,
> Would this only work on either NT or 2k Server or could this be done on
> any
> MS OS? Exactly what I am trying to solve is this: I am working with a
> Point
> of Sale software that uses either MSDE or SQL Server for the larger sites
> to
> control the databases. My problem is what happens if the main server goes
> down? Clustering could be an option. Any other ideas?
> "Dan Guzman" wrote:
|||Paul,
SQL Server Enterprise Edition is going to cost you a fair bit. One of the
best third party products I have seen is XOSoft's WANYSyncHA.
see: www.xosoft.com
The WANYSyncHA product allows automatic failover to another server, with
continously replicating changes at the byte level.
It also includes Data Rewind which allows you to restore the database to a
particular snapshot should both databases become corrupt.
Regards,
Andrew
"Paul" <Paul@.discussions.microsoft.com> wrote in message
news:3D25F3F5-E235-41CA-9693-2E176116AA8A@.microsoft.com...
> Dan,
> Would this only work on either NT or 2k Server or could this be done on
any
> MS OS? Exactly what I am trying to solve is this: I am working with a
Point
> of Sale software that uses either MSDE or SQL Server for the larger sites
to[vbcol=seagreen]
> control the databases. My problem is what happens if the main server goes
> down? Clustering could be an option. Any other ideas?
> "Dan Guzman" wrote:
Online.[vbcol=seagreen]
SQL[vbcol=seagreen]
back[vbcol=seagreen]
|||Correction, product is WANSynchHA, not WANYSyncHA..
Andrew
"Andrew" <me@.anonymous.com> wrote in message
news:41bf7b50$1_1@.news.iprimus.com.au...[vbcol=seagreen]
> Paul,
> SQL Server Enterprise Edition is going to cost you a fair bit. One of the
> best third party products I have seen is XOSoft's WANYSyncHA.
> see: www.xosoft.com
> The WANYSyncHA product allows automatic failover to another server, with
> continously replicating changes at the byte level.
> It also includes Data Rewind which allows you to restore the database to a
> particular snapshot should both databases become corrupt.
> Regards,
> Andrew
> "Paul" <Paul@.discussions.microsoft.com> wrote in message
> news:3D25F3F5-E235-41CA-9693-2E176116AA8A@.microsoft.com...
> any
> Point
sites[vbcol=seagreen]
> to
goes[vbcol=seagreen]
> Online.
> SQL
that[vbcol=seagreen]
last[vbcol=seagreen]
> back
there
>

Redundancy

Is there any untility, program, or script that I can use to backup a SQL
database and will look for the main SQL server? If for anyreason that server
is not seen on the network a backup server will pick up from the last back up
and carry on where the first server left off. It seems logical there would
be.For starters, check out Fail-over Clustering in the SQL Server Books Online.
--
Hope this helps.
Dan Guzman
SQL Server MVP
"Paul" <Paul@.discussions.microsoft.com> wrote in message
news:64D81DCB-E75E-437C-9FE4-D007EB19B016@.microsoft.com...
> Is there any untility, program, or script that I can use to backup a SQL
> database and will look for the main SQL server? If for anyreason that
> server
> is not seen on the network a backup server will pick up from the last back
> up
> and carry on where the first server left off. It seems logical there
> would
> be.|||Hi
For the various highg availablility options check out:
http://www.microsoft.com/sql/techinfo/administration/2000/availability.asp
John
"Paul" <Paul@.discussions.microsoft.com> wrote in message
news:64D81DCB-E75E-437C-9FE4-D007EB19B016@.microsoft.com...
> Is there any untility, program, or script that I can use to backup a SQL
> database and will look for the main SQL server? If for anyreason that
> server
> is not seen on the network a backup server will pick up from the last back
> up
> and carry on where the first server left off. It seems logical there
> would
> be.|||Dan,
Would this only work on either NT or 2k Server or could this be done on any
MS OS? Exactly what I am trying to solve is this: I am working with a Point
of Sale software that uses either MSDE or SQL Server for the larger sites to
control the databases. My problem is what happens if the main server goes
down? Clustering could be an option. Any other ideas?
"Dan Guzman" wrote:
> For starters, check out Fail-over Clustering in the SQL Server Books Online.
> --
> Hope this helps.
> Dan Guzman
> SQL Server MVP
> "Paul" <Paul@.discussions.microsoft.com> wrote in message
> news:64D81DCB-E75E-437C-9FE4-D007EB19B016@.microsoft.com...
> > Is there any untility, program, or script that I can use to backup a SQL
> > database and will look for the main SQL server? If for anyreason that
> > server
> > is not seen on the network a backup server will pick up from the last back
> > up
> > and carry on where the first server left off. It seems logical there
> > would
> > be.
>
>|||> Would this only work on either NT or 2k Server or could this be done on
> any
> MS OS?
You need SQL Server Enterprise edition as well as one of the server OS
editions below. From the Books Online Fail-over Clustering overview:
<Excerpt href-"adminsql.chm::/ad_clustering_7t9v.htm">
Before installing failover clustering, you must install Microsoft Windows
NT® 4.0, Enterprise Edition, Microsoft Windows® 2000 Advanced Server or
Windows 2000 Datacenter Server, and the Microsoft Cluster Service (MSCS).
</Excerpt>
Additionally, you need to have supported hardware, including shared disks.
Clustering may be an option for you larger POS implementations but not for
the MSDE ones.
There are some new high-availability features in the upcoming SQL 2005
version that don't require specialized clustering hardware. See the
high-availability demo at
http://www.microsoft.com/sql/2005/productinfo/demos/hademo.asp
--
Hope this helps.
Dan Guzman
SQL Server MVP
"Paul" <Paul@.discussions.microsoft.com> wrote in message
news:3D25F3F5-E235-41CA-9693-2E176116AA8A@.microsoft.com...
> Dan,
> Would this only work on either NT or 2k Server or could this be done on
> any
> MS OS? Exactly what I am trying to solve is this: I am working with a
> Point
> of Sale software that uses either MSDE or SQL Server for the larger sites
> to
> control the databases. My problem is what happens if the main server goes
> down? Clustering could be an option. Any other ideas?
> "Dan Guzman" wrote:
>> For starters, check out Fail-over Clustering in the SQL Server Books
>> Online.
>> --
>> Hope this helps.
>> Dan Guzman
>> SQL Server MVP
>> "Paul" <Paul@.discussions.microsoft.com> wrote in message
>> news:64D81DCB-E75E-437C-9FE4-D007EB19B016@.microsoft.com...
>> > Is there any untility, program, or script that I can use to backup a
>> > SQL
>> > database and will look for the main SQL server? If for anyreason that
>> > server
>> > is not seen on the network a backup server will pick up from the last
>> > back
>> > up
>> > and carry on where the first server left off. It seems logical there
>> > would
>> > be.
>>|||Paul,
SQL Server Enterprise Edition is going to cost you a fair bit. One of the
best third party products I have seen is XOSoft's WANYSyncHA.
see: www.xosoft.com
The WANYSyncHA product allows automatic failover to another server, with
continously replicating changes at the byte level.
It also includes Data Rewind which allows you to restore the database to a
particular snapshot should both databases become corrupt.
Regards,
Andrew
"Paul" <Paul@.discussions.microsoft.com> wrote in message
news:3D25F3F5-E235-41CA-9693-2E176116AA8A@.microsoft.com...
> Dan,
> Would this only work on either NT or 2k Server or could this be done on
any
> MS OS? Exactly what I am trying to solve is this: I am working with a
Point
> of Sale software that uses either MSDE or SQL Server for the larger sites
to
> control the databases. My problem is what happens if the main server goes
> down? Clustering could be an option. Any other ideas?
> "Dan Guzman" wrote:
> > For starters, check out Fail-over Clustering in the SQL Server Books
Online.
> >
> > --
> > Hope this helps.
> >
> > Dan Guzman
> > SQL Server MVP
> >
> > "Paul" <Paul@.discussions.microsoft.com> wrote in message
> > news:64D81DCB-E75E-437C-9FE4-D007EB19B016@.microsoft.com...
> > > Is there any untility, program, or script that I can use to backup a
SQL
> > > database and will look for the main SQL server? If for anyreason that
> > > server
> > > is not seen on the network a backup server will pick up from the last
back
> > > up
> > > and carry on where the first server left off. It seems logical there
> > > would
> > > be.
> >
> >
> >|||Correction, product is WANSynchHA, not WANYSyncHA..
Andrew
"Andrew" <me@.anonymous.com> wrote in message
news:41bf7b50$1_1@.news.iprimus.com.au...
> Paul,
> SQL Server Enterprise Edition is going to cost you a fair bit. One of the
> best third party products I have seen is XOSoft's WANYSyncHA.
> see: www.xosoft.com
> The WANYSyncHA product allows automatic failover to another server, with
> continously replicating changes at the byte level.
> It also includes Data Rewind which allows you to restore the database to a
> particular snapshot should both databases become corrupt.
> Regards,
> Andrew
> "Paul" <Paul@.discussions.microsoft.com> wrote in message
> news:3D25F3F5-E235-41CA-9693-2E176116AA8A@.microsoft.com...
> > Dan,
> >
> > Would this only work on either NT or 2k Server or could this be done on
> any
> > MS OS? Exactly what I am trying to solve is this: I am working with a
> Point
> > of Sale software that uses either MSDE or SQL Server for the larger
sites
> to
> > control the databases. My problem is what happens if the main server
goes
> > down? Clustering could be an option. Any other ideas?
> >
> > "Dan Guzman" wrote:
> >
> > > For starters, check out Fail-over Clustering in the SQL Server Books
> Online.
> > >
> > > --
> > > Hope this helps.
> > >
> > > Dan Guzman
> > > SQL Server MVP
> > >
> > > "Paul" <Paul@.discussions.microsoft.com> wrote in message
> > > news:64D81DCB-E75E-437C-9FE4-D007EB19B016@.microsoft.com...
> > > > Is there any untility, program, or script that I can use to backup a
> SQL
> > > > database and will look for the main SQL server? If for anyreason
that
> > > > server
> > > > is not seen on the network a backup server will pick up from the
last
> back
> > > > up
> > > > and carry on where the first server left off. It seems logical
there
> > > > would
> > > > be.
> > >
> > >
> > >
>