Showing posts with label secondary. Show all posts
Showing posts with label secondary. Show all posts

Monday, March 19, 2012

Choosing DB Edition (Std vs Ent)

I need to decided between Standard and Enterprise Edition (Cost is a
criteria - but its secondary to performance - <!--and I am not paying for
it myself-->)

The server spec under consideration: Dual Xeon, 1GB RAM, 36GB - RAID 1
(Dell PowerEdge 1850).

Application: Windows 2003 Std Server, ASP.NET, MS SQL Server 2000 based
data driven web application.

Approximately 25 simultaneous clients. Peak activity would probably be 50
transactions/activities per second (2 per second per client). I expect
the database size to grow up to 4GB in 1 year.

The application would use only basic OLAP features (if at all)...so
feature set wise I believe that standard edition is good enough.

What I am concerned about is when MS documentation says that Standard
Edition is for "organization that do not require the advanced scalability,
availability, performance, or analysis features of the SQL Server 2000
Enterprise Edition"

Is there a difference in performance between Std and Ent editions? In
terms of number of transactions per second that can be serviced?

What other criteria should I be aware of before deciding to go one way or
the other?

Any ideas?"Jonas Hei" <maps_263@.hotmail.com> wrote in message
news:opsehfbjyzr0m89z@.fx1025...
>I need to decided between Standard and Enterprise Edition (Cost is a
>criteria - but its secondary to performance - <!--and I am not paying for
>it myself-->)
> The server spec under consideration: Dual Xeon, 1GB RAM, 36GB - RAID 1
> (Dell PowerEdge 1850).
> Application: Windows 2003 Std Server, ASP.NET, MS SQL Server 2000 based
> data driven web application.
> Approximately 25 simultaneous clients. Peak activity would probably be 50
> transactions/activities per second (2 per second per client). I expect
> the database size to grow up to 4GB in 1 year.
> The application would use only basic OLAP features (if at all)...so
> feature set wise I believe that standard edition is good enough.
> What I am concerned about is when MS documentation says that Standard
> Edition is for "organization that do not require the advanced scalability,
> availability, performance, or analysis features of the SQL Server 2000
> Enterprise Edition"
> Is there a difference in performance between Std and Ent editions? In
> terms of number of transactions per second that can be serviced?
> What other criteria should I be aware of before deciding to go one way or
> the other?
> Any ideas?

I'd guess that we're referring to features in the section you quoted even
though it makes it sound like the Enterprise Edition is inherently faster
than the Standard Edition. That's simply not the case. For example,
Clustering is a high availability option that is only available in the
Enterprise Edition. You can get more information about features by Edition
and choosing a particular Edition here:
http://www.microsoft.com/sql/evalua...es/choosing.asp.

There is nothing in either the Standard or Enterprise Edition engine that
I'm aware of that throttles performance based on the Edition that you're
using. The only Edition that has a performance throttle based on the Edition
is MSDE.

If the Standard Edition contains the features your application needs, my
guess is that it will run it just fine. Of course, without testing that's
impossible to know for sure.

--
Sincerely,
Stephen Dybing

This posting is provided "AS IS" with no warranties, and confers no rights.|||Hi

The engine is the same for both editions, the Enterprise edition has
additional features, such as failover clustering, built in log shipping and
automatic use of indexed views.

See
http://msdn.microsoft.com/library/d..._ar_ts_1cdv.asp

If you don't want to use these features or if you are happy to "manually"
implement the features or can provide your own solutions, then standard
edition should be ok. All editions should be supported on your hardware.

John

"Jonas Hei" <maps_263@.hotmail.com> wrote in message
news:opsehfbjyzr0m89z@.fx1025...
> I need to decided between Standard and Enterprise Edition (Cost is a
> criteria - but its secondary to performance - <!--and I am not paying for
> it myself-->)
> The server spec under consideration: Dual Xeon, 1GB RAM, 36GB - RAID 1
> (Dell PowerEdge 1850).
> Application: Windows 2003 Std Server, ASP.NET, MS SQL Server 2000 based
> data driven web application.
> Approximately 25 simultaneous clients. Peak activity would probably be 50
> transactions/activities per second (2 per second per client). I expect
> the database size to grow up to 4GB in 1 year.
> The application would use only basic OLAP features (if at all)...so
> feature set wise I believe that standard edition is good enough.
> What I am concerned about is when MS documentation says that Standard
> Edition is for "organization that do not require the advanced scalability,
> availability, performance, or analysis features of the SQL Server 2000
> Enterprise Edition"
> Is there a difference in performance between Std and Ent editions? In
> terms of number of transactions per second that can be serviced?
> What other criteria should I be aware of before deciding to go one way or
> the other?
> Any ideas?|||Stephen Dybing [MSFT] (stephd@.online.microsoft.com) writes:
> There is nothing in either the Standard or Enterprise Edition engine
> that I'm aware of that throttles performance based on the Edition that
> you're using. The only Edition that has a performance throttle based on
> the Edition is MSDE.

There are however features in Enterprise Edition that may help to
improve performance. One such features in indexed views. You can use
indexed views in Std Edition too, but there situations where the optimizer
will not consider the view.

Then again, if you are not using indexed views, this will not make a
difference.

--
Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se

Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techin.../2000/books.asp|||True, but in my defense, it's listed on the Features page I pointed
everybody at. :-)

--
Sincerely,
Stephen Dybing

This posting is provided "AS IS" with no warranties, and confers no rights.

"Erland Sommarskog" <esquel@.sommarskog.se> wrote in message
news:Xns956828A66F7CYazorman@.127.0.0.1...
> Stephen Dybing [MSFT] (stephd@.online.microsoft.com) writes:
>> There is nothing in either the Standard or Enterprise Edition engine
>> that I'm aware of that throttles performance based on the Edition that
>> you're using. The only Edition that has a performance throttle based on
>> the Edition is MSDE.
> There are however features in Enterprise Edition that may help to
> improve performance. One such features in indexed views. You can use
> indexed views in Std Edition too, but there situations where the optimizer
> will not consider the view.
> Then again, if you are not using indexed views, this will not make a
> difference.
>
> --
> Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se
> Books Online for SQL Server SP3 at
> http://www.microsoft.com/sql/techin.../2000/books.asp

Sunday, February 19, 2012

Checking for row existence with secondary key

Hi -
I'm no SQL wizard (obviously). I have a table (conceivably very
large (500k+rows)) with a non-unique secondary index. I need an
efficient query to check for row existence using that secondary index.
Any ideas will be appreciated...
Thanks,
BryanIF EXISTS (SELECT * FROM yourTable AS a WHERE a.Col = YourCondition)
-- do your stuff here
Andrew J. Kelly SQL MVP
"Bryan" <bryan@.newsgroups.nospam> wrote in message
news:bijqk11p4ls4fq0dem7gnfee1n6e8vd8d6@.
4ax.com...
> Hi -
> I'm no SQL wizard (obviously). I have a table (conceivably very
> large (500k+rows)) with a non-unique secondary index. I need an
> efficient query to check for row existence using that secondary index.
> Any ideas will be appreciated...
> Thanks,
> Bryan|||Bryan,
DDL would help but try:
SELECT ID
FROM TABLE1
WHERE NOT EXISTS(SELECT * FROM TABLE2 WHERE TABLE2.ID = TABLE1.ID)
HTH
Jerry
"Bryan" <bryan@.newsgroups.nospam> wrote in message
news:bijqk11p4ls4fq0dem7gnfee1n6e8vd8d6@.
4ax.com...
> Hi -
> I'm no SQL wizard (obviously). I have a table (conceivably very
> large (500k+rows)) with a non-unique secondary index. I need an
> efficient query to check for row existence using that secondary index.
> Any ideas will be appreciated...
> Thanks,
> Bryan

Friday, February 10, 2012

Check SQL syntax

First of all, hello and good morning, my question is, you can check SQL syntax in SQL Server with secondary button mouse or "Check SQL" button in toolbar (Microsoft Management Console 1.2).
Id like to know if theres a way to use these Server tools from Visual Basic 6 SP6, something like APIs ...
If theres no solution, can anybody give me an idea of how to check SQL syntax in VB.
The application wants the users to make their own SQL sentences, (they just can write whatever they want ???)Ive solved it with transactions, commit and rollback.
Thanks for your patience|||Hi pucca,

Could u kindly explain how u done it. Atleast briefly when u r free...

thnks in advance

With regards
Sudar|||because I noticed that I hadnt to check the sintax, I just had to wait VB would do the SQL Statement, if it couldnt do it then the sentence the user wrote was wrong or there were constraints in the server side.
Sorry for my english, Ill try to explain the situation.
The application has a form called frmConsultasCampanya where the users can see the stored consults and manage them (add new, delete, modify ...), the users just write the consult as they need, so we can find some consults that return the same results, and as these data are stored in other table the application can stop execution. My idea was to check the consult before its execution, and if everything was right execute it, but I realized that I could check the syntax, not the logica.
I had heard of transactions, and I discovered you could do it in vb 6.
My solution is the following:

Public Function ejecutar_consulta() As Long
Dim cmd As Command
Dim rs As Recordset
Dim rs_2 As Recordset
Dim cont As Long
Dim ident_pers As Long
Dim encontrado As Boolean
Dim habilitado As Boolean
Dim sql As String

Set cmd = New Command
Set cmd.ActiveConnection = cn

'En primer lugar, antes de ejecutar nada ver si esa consulta ya se ha procesado para
'esa campaa. Si se ha procesado ya, se sale de la funcion, devolviendo el valor -1
'para que se pueda mostrar un mensaje adecuado indicando que la consulta ya se ha
'ejecutado.
cmd.CommandText = "select * from Consultas_campanya where Id_Campanya = '" & Campanya & "' and Id_Consulta = '" & Ident_Consulta & "' and habilitado=1"
Set rs = cmd.Execute
If Not rs.EOF Then
'Ya se ha procesado esta consulta para esta campaa, salir de la funcion
ejecutar_consulta = -1
Exit Function
End If

cmd.CommandText = Consulta_SQL
'Set rs = cmd.Execute '(1)

'------INICIO BARRA DE PROGRESO
'Si se quita la barra de progreso, quitar el comentario de la linea anterior
Set rs = New Recordset
rs.CursorType = adOpenStatic
rs.Open Consulta_SQL, cn

'Iniciar una transaccion para que en caso de que haya errores se pueda recuperar el
'ultimo estado correcto de los datos. En caso de que se produzca algun error durante
'la manipulacion de los mismos se va a la rutina ControlDeErrores, donde se deshacen los
'cambios que se hayan podido producir.
cn.BeginTrans
On Error GoTo ControlDeErrores

ProgressBar1.Min = 0
If (rs.RecordCount > 0) Then
ProgressBar1.Max = rs.RecordCount
Else
ProgressBar1.Max = 1
End If
ProgressBar1.Value = 0
Frame1.Visible = True
Frame1.Refresh
'------FIN BARRA DE PROGRESO

Dim numeroregistros As Long
Set rs_2 = New Recordset
rs_2.CursorType = adOpenStatic

'sql = "select * from Lista_Procesados_Campanya where Id_Campanya = '" & Campanya & "'"
sql = "select * from Lista_Procesados_Campanya_PRUEBAS where Id_Campanya = '" & Campanya & "' and Id_Consulta = '" & Ident_Consulta & "'"

rs_2.Open sql, cn
numeroregistros = rs_2.RecordCount

cont = 0
Do While Not rs.EOF
ident_pers = rs("Id_Persona")
If (persona_disponible(ident_pers)) Then
If numeroregistros <> 0 Then
rs_2.MoveFirst
End If
encontrado = False
Do While Not rs_2.EOF And Not encontrado
If rs_2("Id_Persona") = rs("Id_Persona") Then
encontrado = True
habilitado = rs_2("Habilitado")
End If
rs_2.MoveNext
Loop
If Not encontrado Then
'cmd.CommandText = "insert into Lista_Procesados_Campanya (Id_Campanya, Id_Persona, Habilitado, Usuario) values ('" & Campanya & "', '" & rs("Id_Persona") & "', '1', '" & Usuario & "')"
cmd.CommandText = "insert into Lista_Procesados_Campanya_PRUEBAS (Id_Campanya, Id_Persona, Id_Consulta, Habilitado, Usuario) values ('" & Campanya & "', '" & rs("Id_Persona") & "', '" & Ident_Consulta & "', '1', '" & Usuario & "')"
cmd.Execute
cont = cont + 1
Else
If Not habilitado Then
'cmd.CommandText = "update Lista_Procesados_Campanya set Habilitado = '1' where Id_Campanya = '" & Campanya & "' and Id_Persona = '" & rs("Id_Persona") & "'"
cmd.CommandText = "update Lista_Procesados_Campanya_PRUEBAS set Habilitado = '1' where Id_Campanya = '" & Campanya & "' and Id_Persona = '" & rs("Id_Persona") & "' and Id_Consulta = '" & Ident_Consulta & "'"
cmd.Execute
cont = cont + 1
End If
End If
End If
rs.MoveNext
'------INICIO BARRA DE PROGRESO
If (ProgressBar1.Value < ProgressBar1.Max - 1) Then
ProgressBar1.Value = ProgressBar1.Value + 1
End If
'------FIN BARRA DE PROGRESO
Loop

If cont <> 0 Then
cmd.CommandText = "select * from Consultas_campanya where Id_Campanya = '" & Campanya & "' and Id_Consulta = '" & Ident_Consulta & "'"
Set rs = cmd.Execute
If rs.EOF Then
cmd.CommandText = "insert into Consultas_Campanya (Id_Consulta, Id_Campanya, Habilitado, Usuario) values ('" & Ident_Consulta & "', '" & Campanya & "', '1', '" & Usuario & "')"
Else
If Not rs("Habilitado") Then
cmd.CommandText = "update Consultas_Campanya set Habilitado = '1' where Id_Campanya = '" & Campanya & "' and Id_Consulta = '" & Ident_Consulta & "'"
End If
End If
cmd.Execute
End If

'Si no ha habido ningun problema con los datos grabar los cambios en la base de datos
cn.CommitTrans

If rs.State = adStateOpen Then rs.Close
Set rs = Nothing

If rs_2.State = adStateOpen Then rs_2.Close
Set rs_2 = Nothing
Set cmd = Nothing

'------INICIO BARRA DE PROGRESO
Frame1.Visible = False
'------FIN BARRA DE PROGRESO

ejecutar_consulta = cont
'End Function
Exit Function 'Suprimir esta linea si se quita el control de errores y quitar el comentario de la anterior

ControlDeErrores:
'En caso de que haya habido cualquier problema durante la manipulacion de los datos se
'deshace la transaccion y se deja la base de datos como estaba.
'Se devuelve el valor -2 para que se pueda mostrar un mensaje avisando de que la consulta
'no se ejecuto.
cn.RollbackTrans
Frame1.Visible = False
ejecutar_consulta = -2
End Function|||SEE the Command

SET NOEXEC ON { ON | OFF }

AS in

SET NOEXEC ON

SELECT * FROM table

SET NOEXEC OFF

This might do what you want in VB not sure works in QA I think.

Edit: Not as good a QA check Syntax because it does not valid objects

Tim S|||Thank you very much pica.. for ur ellobrate explanatio...and all for sparing ur time to explain.

with regards
Sudar