Thursday, March 29, 2012
Can I index a table in View ?
A.
When I do a sql query like "select .. from vMyView as MyView,tblB
where tblB.colA = MyView.A", will it use the index on tblA column A , or do
I
need to (and can I) create an index on the view ?
CREATE view vMyView()
select a,b,c...from tblA --> tblA.a is indexed
Thank you very much.Look up "Indexed views" in Books online.
Note - This feature is only supported in Enterprise/Developer editions.
Immy
"Paul fpvt2" <Paulfpvt2@.discussions.microsoft.com> wrote in message
news:16F4C4B5-1006-4A73-9BDF-BF7C2CC36B80@.microsoft.com...
>I create a view based on table. The table (say tblA) has an index on column
>A.
> When I do a sql query like "select .. from vMyView as MyView,tblB
> where tblB.colA = MyView.A", will it use the index on tblA column A , or
> do I
> need to (and can I) create an index on the view ?
> CREATE view vMyView()
> select a,b,c...from tblA --> tblA.a is indexed
> Thank you very much.|||The base table index will be used, unless you create an indexed view. See
Books Online for details on how to create indexed views.
Indexed views basically allow you to index only a subset of data.
What exactly are you trying to achieve?
ML
http://milambda.blogspot.com/|||Not entirely true. From Books Online:
"
Indexed views can be created in any edition of SQL Server 2000. In SQL
Server 2000 Enterprise Edition, the query optimizer will automatically
consider the indexed view. To use an indexed view in all other editions, the
NOEXPAND hint must be used.
"
ML
http://milambda.blogspot.com/|||It will use the base table index if it is useful to do so (based on many
factors, like the selectivity of the index and your search argument)
You can index the view, provided it meets the strict requirements for doing
so. You can do it in any version, but as noted only in Enterprise Edition
will it use the index transparently, other versions require you to use the
NOEXPAND keyword so he text of the view isn't brought into the plan creation
(so you manually force it to treat the view as a table, more or less)
So the main reason I piped up and said basically the same things that were
said before is this. Do you know how to tell if an index is being used
using Management Studio / Query Analyzer? When it comes to predicting what
index may or may not be used, it generally behooves you to try it out.
There are menu items on both for displaying estimated plans, and then actual
plans that were used to execute the query. So execute the query and look at
the plan, and fiddle about with it for a while and you will get the hang of
when an index will be used.
----
Louis Davidson - http://spaces.msn.com/members/drsql/
SQL Server MVP
"Arguments are to be avoided: they are always vulgar and often convincing."
(Oscar Wilde)
"Paul fpvt2" <Paulfpvt2@.discussions.microsoft.com> wrote in message
news:16F4C4B5-1006-4A73-9BDF-BF7C2CC36B80@.microsoft.com...
>I create a view based on table. The table (say tblA) has an index on column
>A.
> When I do a sql query like "select .. from vMyView as MyView,tblB
> where tblB.colA = MyView.A", will it use the index on tblA column A , or
> do I
> need to (and can I) create an index on the view ?
> CREATE view vMyView()
> select a,b,c...from tblA --> tblA.a is indexed
> Thank you very much.|||Thanks.
I guess I am worry that in a sql query like the following
"select .. from vMyView as MyView,tblB where tblB.colA = MyView.A", the
query will be slow if it does not use the base table index.
CREATE view vMyView()
select a,b,c...from tblA --> tblA.a is indexed
"ML" wrote:
> The base table index will be used, unless you create an indexed view. See
> Books Online for details on how to create indexed views.
> Indexed views basically allow you to index only a subset of data.
> What exactly are you trying to achieve?
>
> ML
> --
> http://milambda.blogspot.com/|||If you post more DDL (see here for details:
http://www.aspfaq.com/etiquette.asp?id=5006) , we can provide better help.
select .. from vMyView as MyView,tblB where tblB.colA = MyView.A
This may not be optimal. For one the old (deprecated) join syntax is used.
Compare the execution plan of your current query to the execution plan of
something like this:
select <columns>
from tblA
inner join tblB
on tblB.colA = tblA.colA
ML
http://milambda.blogspot.com/sql
Can I index a table in UDF ?
A.
When I do a sql query like "select .. from dbo.udfMyProc() as MyProc,tblB
where tblB.colA = MyProc.A", will it use the index on tblA column A , or do
I
need to (and can I) create an index on the UDF ?
CREATE function dbo.udfMyProc()
returns @.myTable TABLE(a int, b bit, c varchar(50), d varchar(50), e
varchar(50), ...)
AS BEGIN
INSERT INTO @.myTable(a,b,c,d,e...)
select a,b,c...from tblA --> tblA.a is indexed
return
end
Thank you very much.That query will not use the index on "tblA" - you need to create one on the
temp table returned by the UDF. You cannot create a regular index on table
variables though (a CREATE INDEX statement), but you can use PRIMARY KEY and
UNIQUE constraints:
...
RETURNS @.tmp TABLE
(
somestring varchar(50) NOT NULL PRIMARY KEY
)
If the index can have non-unique records you can fake an index by adding an
identity column so that each record will be unique:
...
RETURNS @.tmp TABLE
(
somestring varchar(50) NOT NULL
, meaningless_column int NOT NULL IDENTITY(1,1)
, PRIMARY KEY (somestring, meaningless_column)
)
Make sure to make the IDENTITY column last in the PK/UNIQUE definition so
the index is still useful.
KH
"Paul fpvt2" wrote:
> I create a UDF based on a table. The table (say tblA) has an index on colu
mn A.
> When I do a sql query like "select .. from dbo.udfMyProc() as MyProc,tblB
> where tblB.colA = MyProc.A", will it use the index on tblA column A , or d
o I
> need to (and can I) create an index on the UDF ?
> CREATE function dbo.udfMyProc()
> returns @.myTable TABLE(a int, b bit, c varchar(50), d varchar(50), e
> varchar(50), ...)
> AS BEGIN
> INSERT INTO @.myTable(a,b,c,d,e...)
> select a,b,c...from tblA --> tblA.a is indexed
> return
> end
> Thank you very much.|||What do you mean by "use the index"? It will not copy the index onto
@.table, if that's what you mean. The only indexes you can create on a table
variable are via PRIMARY KEY or UNIQUE constraints... if you're talking
about ordering, that's a different conversation altogether...
"Paul fpvt2" <Paulfpvt2@.discussions.microsoft.com> wrote in message
news:1BA572FB-C5DA-4528-BAB2-A484FA8837A8@.microsoft.com...
>I create a UDF based on a table. The table (say tblA) has an index on
>column A.
> When I do a sql query like "select .. from dbo.udfMyProc() as MyProc,tblB
> where tblB.colA = MyProc.A", will it use the index on tblA column A , or
> do I
> need to (and can I) create an index on the UDF ?
> CREATE function dbo.udfMyProc()
> returns @.myTable TABLE(a int, b bit, c varchar(50), d varchar(50), e
> varchar(50), ...)
> AS BEGIN
> INSERT INTO @.myTable(a,b,c,d,e...)
> select a,b,c...from tblA --> tblA.a is indexed
> return
> end
> Thank you very much.|||"Paul fpvt2" <Paulfpvt2@.discussions.microsoft.com> wrote in message
news:1BA572FB-C5DA-4528-BAB2-A484FA8837A8@.microsoft.com...
>I create a UDF based on a table. The table (say tblA) has an index on
>column A.
> When I do a sql query like "select .. from dbo.udfMyProc() as MyProc,tblB
> where tblB.colA = MyProc.A", will it use the index on tblA column A , or
> do I
> need to (and can I) create an index on the UDF ?
> CREATE function dbo.udfMyProc()
> returns @.myTable TABLE(a int, b bit, c varchar(50), d varchar(50), e
> varchar(50), ...)
> AS BEGIN
> INSERT INTO @.myTable(a,b,c,d,e...)
> select a,b,c...from tblA --> tblA.a is indexed
> return
> end
> Thank you very much.
If your function truly consists of a single INSERT... SELECT statement then
you should turn it into an inline function rather than a multi-statement
one. That way your query against the function will be more likely to benefit
from an index on the base table. An example version of an inline function is
given below. This looks subtly different from what you posted but in terms
of the way the function works the difference is very significant.
CREATE function dbo.udfMyProc()
RETURNS TABLE
AS
RETURN (SELECT a,b,c...FROM tblA)
GO
BTW, if the function doesn't have any parameters then why use a function at
all? You could use a view for that.
Hope this helps.
David Portas
SQL Server MVP
--|||Thank you everybody for your replies.
I tried the view and it works a lot faster, I will use it instead.
But, I have a question about inline function. The example that you posted
looks the same with the UDF that I posted (CREATE function dbo.udfMyProc() )
What is the difference between UDF and inline function ?
Thanks a lot.
"David Portas" wrote:
> "Paul fpvt2" <Paulfpvt2@.discussions.microsoft.com> wrote in message
> news:1BA572FB-C5DA-4528-BAB2-A484FA8837A8@.microsoft.com...
> If your function truly consists of a single INSERT... SELECT statement the
n
> you should turn it into an inline function rather than a multi-statement
> one. That way your query against the function will be more likely to benef
it
> from an index on the base table. An example version of an inline function
is
> given below. This looks subtly different from what you posted but in terms
> of the way the function works the difference is very significant.
> CREATE function dbo.udfMyProc()
> RETURNS TABLE
> AS
> RETURN (SELECT a,b,c...FROM tblA)
> GO
> BTW, if the function doesn't have any parameters then why use a function a
t
> all? You could use a view for that.
> Hope this helps.
> --
> David Portas
> SQL Server MVP
> --
>
>|||One more question about inline function and views.
I understand that the ORDER BY clause is invalid in views and inline
functions.
If I need to use ORDER BY clause in my query inside the views or inline
function, Is there a way around it ?
Thanks.
"David Portas" wrote:
> "Paul fpvt2" <Paulfpvt2@.discussions.microsoft.com> wrote in message
> news:1BA572FB-C5DA-4528-BAB2-A484FA8837A8@.microsoft.com...
> If your function truly consists of a single INSERT... SELECT statement the
n
> you should turn it into an inline function rather than a multi-statement
> one. That way your query against the function will be more likely to benef
it
> from an index on the base table. An example version of an inline function
is
> given below. This looks subtly different from what you posted but in terms
> of the way the function works the difference is very significant.
> CREATE function dbo.udfMyProc()
> RETURNS TABLE
> AS
> RETURN (SELECT a,b,c...FROM tblA)
> GO
> BTW, if the function doesn't have any parameters then why use a function a
t
> all? You could use a view for that.
> Hope this helps.
> --
> David Portas
> SQL Server MVP
> --
>
>|||> What is the difference between UDF and inline function ?
there are two types of UDFs:
Inline. Consists of only one query. Think of it as a view or "macro".
Multi-statement. Here you define a table variable and populate that table va
riable, and when
function code exist at run-time the data is selected from the variable, All
that work is overhead.
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
Blog: http://solidqualitylearning.com/blogs/tibor/
"Paul fpvt2" <Paulfpvt2@.discussions.microsoft.com> wrote in message
news:B7BABDF8-B1A1-4735-BBFA-5A250B92B1F6@.microsoft.com...
> Thank you everybody for your replies.
> I tried the view and it works a lot faster, I will use it instead.
> But, I have a question about inline function. The example that you posted
> looks the same with the UDF that I posted (CREATE function dbo.udfMyProc()
)
> What is the difference between UDF and inline function ?
> Thanks a lot.
>
> "David Portas" wrote:
>|||Thanks.
Is the following UDF considered inline (because it only has 1 query: select
a,b,c...) ?
CREATE function dbo.udfMyProc()
returns @.myTable TABLE(a int, b bit, c varchar(50), d varchar(50), e
varchar(50), ...)
AS BEGIN
INSERT INTO @.myTable(a,b,c,d,e...)
select a,b,c...from tblA --> tblA.a is indexed
return
end
"Tibor Karaszi" wrote:
> there are two types of UDFs:
> Inline. Consists of only one query. Think of it as a view or "macro".
> Multi-statement. Here you define a table variable and populate that table
variable, and when
> function code exist at run-time the data is selected from the variable, Al
l that work is overhead.
> --
> Tibor Karaszi, SQL Server MVP
> http://www.karaszi.com/sqlserver/default.asp
> http://www.solidqualitylearning.com/
> Blog: http://solidqualitylearning.com/blogs/tibor/
>
> "Paul fpvt2" <Paulfpvt2@.discussions.microsoft.com> wrote in message
> news:B7BABDF8-B1A1-4735-BBFA-5A250B92B1F6@.microsoft.com...
>|||No, that is a multi-statement UDF. An Inline is:
CREATE FUNCTION f(...)
RETURNS TABLE
AS
RETURN (SELECT ...)
For above, SQL Server doesn't have to populate a table variable and then ret
urn the result. SQL
Server can, and will "inline" above query in the outer query, just like it d
oes with a view. Or
think of it as a macro, if you wish.
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
Blog: http://solidqualitylearning.com/blogs/tibor/
"Paul fpvt2" <Paulfpvt2@.discussions.microsoft.com> wrote in message
news:D30F1F9A-E3D1-412A-B9D5-30A0F265B8C8@.microsoft.com...
> Thanks.
> Is the following UDF considered inline (because it only has 1 query: selec
t
> a,b,c...) ?
> CREATE function dbo.udfMyProc()
> returns @.myTable TABLE(a int, b bit, c varchar(50), d varchar(50), e
> varchar(50), ...)
> AS BEGIN
> INSERT INTO @.myTable(a,b,c,d,e...)
> select a,b,c...from tblA --> tblA.a is indexed
> return
> end
> "Tibor Karaszi" wrote:
>|||Thanks.
In the sample query that you posted, does it mean that you return a table
that is populated with the select statement ?
"Tibor Karaszi" wrote:
> No, that is a multi-statement UDF. An Inline is:
> CREATE FUNCTION f(...)
> RETURNS TABLE
> AS
> RETURN (SELECT ...)
> For above, SQL Server doesn't have to populate a table variable and then r
eturn the result. SQL
> Server can, and will "inline" above query in the outer query, just like it
does with a view. Or
> think of it as a macro, if you wish.
> --
> Tibor Karaszi, SQL Server MVP
> http://www.karaszi.com/sqlserver/default.asp
> http://www.solidqualitylearning.com/
> Blog: http://solidqualitylearning.com/blogs/tibor/
>
> "Paul fpvt2" <Paulfpvt2@.discussions.microsoft.com> wrote in message
> news:D30F1F9A-E3D1-412A-B9D5-30A0F265B8C8@.microsoft.com...
>
Thursday, March 22, 2012
Can I define a query governor limit in a connection string rather then the server based op
Can I use a query governor option in a connection string?
if yes, what is the property name I have to add in the connection string?
I don't want to setup this at the server level but only in specific
connection strings used by my users when then do ad-hoc reporting using
Report Builder.
I want to limit these users only when they create reports. (to insure that
they don'T execute bad queries which can kill the server)
other reports generated by developpers and some complex queries must always
run. and some of them are really big; if I activate the query governor of
the server, then the server always refuse to execute them. So I can't
activate the query governor at the server level to allow the developpers to
do their job.
thanks.
Jerome.Hi Jerome
I don't think that this is possible, what you may want to do is report of a
snapshot rather than any live system to reduce the impact of such problems.
John
"Jéjé" wrote:
> Hi,
> Can I use a query governor option in a connection string?
> if yes, what is the property name I have to add in the connection string?
> I don't want to setup this at the server level but only in specific
> connection strings used by my users when then do ad-hoc reporting using
> Report Builder.
> I want to limit these users only when they create reports. (to insure that
> they don'T execute bad queries which can kill the server)
> other reports generated by developpers and some complex queries must always
> run. and some of them are really big; if I activate the query governor of
> the server, then the server always refuse to execute them. So I can't
> activate the query governor at the server level to allow the developpers to
> do their job.
> thanks.
> Jerome.
>
>
Can I create a database schema from a DataSet and/or .xsd file?
I have some questions about creating SQL Server CE databases. Based on my experiments and what I've read on these forums, it looks like there are a couple ways to create a database schema. I can edit the database schema via the Server Explorer in Visual Studio, or use an external program like SQL Server Management Studio and somehow convert those files to .sdf files.
I find Visual Studio's built in tools to be cumbersome to use and limited in functionality, and using SSMS seems like a roundabout way of approaching the problem. I understand Microsoft will be releasing better tools with Orcas, but in the meantime, I'm wondering if there are alternative ways to generate database schemas.
For instance, I find Visual Studio's DataSet designer fairly easy to use. The DataSet designer generates schema definitions (.xsd files), and an instantiated DataSet can both read and write schema definitions via Read/WriteXMLSchema. Furthermore, DataAdapter's Fill and FillSchema methods can be used to push a schema from a database to a DataSet. So, can I somehow go the other direction and push a schema from a DataSet to a database? It seems like all the tools are there...
For example, if I create the DataSet schema, could I use a small app to create a new .sdf file, instantiate a DataSet, write the schema from the DataSet to the database, and then save the .sdf file? Or given the generated .xsd file, is there any way to create a SQL database from that?
Thanks in advance for any replies.
You can do that by loading schema into DataSet and looping through DataSet's tables, columns, relations, etc., generating respective SQL command and executing them. E.g. you loop through tables in DataSet and execute "Create Table" command for each.
I would not say it’s easier than using designers but by all means you can do it.
|||Thank you for the reply, Ilya. I agree that doesn't necessarily sound easier than using designers.
If you would indulge me, perhaps you can answer a related and probably more appropriate question. What options are available for creating databases at run time?
The samples I've seen in the SDK and online assume that an application will have access to an existing database. But what if the application is responsible for creating the database? For example, I was using Microsoft Money a few minutes ago, and it occurred to me that such an application would be well suited for SQL Server CE. At its heart, the content is just a relational database. I can imagine Money's .mny files just being rebranded .sdf files. But Money doesn't ship with an existing database. Rather, it allows you to create your own via a traditional File->New command. I imagine the code would look something like the following in CE:
String connString = "Data Source='NewDatabaseFile.sdf'";
SqlCeEngine engine = new SqlCeEngine( connString );
engine.CreateDatabase();
But then what? You have an emtpy file and a database with no schema. If the answer is to run a bunch of CREATE TABLE commands or loop through a DataSet like your example above, then so be it. It would be a shame, however, if there were no way to leverage the database design tools available when creating databases at runtime.
I apologize if I am being naive with these questions. I am new to CE, and am just trying to get a sense of what can be done with it.
Thanks.
|||Yes, you need to run appropriate SQL command to create schema at runtime after you’ve created the database.
If you need runtime designers then you'd need to implement these designers yourself. They would translate the schema in whatever form to... yes, SQL commands.
sqlSunday, March 11, 2012
can excel view drill throughs in a pivot table
Analysis Services. Is there anyway to view the drill down from the data
fields in a Excel pivot table? I try doubleclicking in a data field cell
and get a message saying that I can only get detail from rows or columns.
****************************************
*********
Andy S.
MCSE NT/2000, MCDBA SQL 7/2000
andymcdba1@.noreply.yahoo.com
Please remove "noreply" before replying.
****************************************
*********Oh, the message you are receiving is because you are clicking on a cell and
Excel does not have native drillthrough capabilities. A good example of
modifying Excel (via VBA) to have drillthrough capabilities can be found at:
http://www.windowsitpro.com/SQLServ...0382/40382.html
HTH!
Denny Lee
<dennyglee_at_hotmail_dot_com>
Blog at:: http://spaces.msn.com/members/denster/
"Andy S." <andymcdba1@.noreply.yahoo.com> wrote in message
news:%23WCO5Op9FHA.808@.TK2MSFTNGP09.phx.gbl...
> I'm building pivot tables in Excel 2000 based on data cubes from SQL 2000
> Analysis Services. Is there anyway to view the drill down from the data
> fields in a Excel pivot table? I try doubleclicking in a data field cell
> and get a message saying that I can only get detail from rows or columns.
>
> --
> ****************************************
*********
> Andy S.
> MCSE NT/2000, MCDBA SQL 7/2000
> andymcdba1@.noreply.yahoo.com
> Please remove "noreply" before replying.
> ****************************************
*********
>
can excel view drill throughs in a pivot table
Analysis Services. Is there anyway to view the drill down from the data
fields in a Excel pivot table? I try doubleclicking in a data field cell
and get a message saying that I can only get detail from rows or columns.
*************************************************
Andy S.
MCSE NT/2000, MCDBA SQL 7/2000
andymcdba1@.noreply.yahoo.com
Please remove "noreply" before replying.
*************************************************
Oh, the message you are receiving is because you are clicking on a cell and
Excel does not have native drillthrough capabilities. A good example of
modifying Excel (via VBA) to have drillthrough capabilities can be found at:
http://www.windowsitpro.com/SQLServe...382/40382.html
HTH!
Denny Lee
<dennyglee_at_hotmail_dot_com>
Blog at:: http://spaces.msn.com/members/denster/
"Andy S." <andymcdba1@.noreply.yahoo.com> wrote in message
news:%23WCO5Op9FHA.808@.TK2MSFTNGP09.phx.gbl...
> I'm building pivot tables in Excel 2000 based on data cubes from SQL 2000
> Analysis Services. Is there anyway to view the drill down from the data
> fields in a Excel pivot table? I try doubleclicking in a data field cell
> and get a message saying that I can only get detail from rows or columns.
>
> --
> *************************************************
> Andy S.
> MCSE NT/2000, MCDBA SQL 7/2000
> andymcdba1@.noreply.yahoo.com
> Please remove "noreply" before replying.
> *************************************************
>
Can Events be fired in a certain order?
I am getting my arms around Notification Services (NS). We need to generate notifications based on about 5 different subscriptions. The 5 events that feed the subscriptions will be SQL based and will read from a work table. I would like to populate that work table with a subset of our high volume transaction data, run the events, and then clear the data for the next run...say 5 minutes later. So my question is, how do I know when the last of the 5 events has fired so I can clean out the data. In other words, I'd like the 5 events to fire in a certain order and have the last event clean up. Is there a way to tell the events in what order they can fire? Or other suggestions on how to solve this? I read up on Chronicles but it wasn't clear to me if that would solve my problem.
Secondly, if my events and subscriptions created notifications for 5 different subscriptions, can they be combined into one e-mail to be delivered to the subscriber? In other words, there are several subscription events that may happen during the day for a subscriber. The subscriber only wants one e-mail at the end of the day. Will NS combine it?
There are several ways to recognize new events in the SQL Server Event Provider. A couple that I've used in the past is:
1) Use a postprocessing query to update a column in the data source indicating that the row has been processed.
2) Use a Chronicles table to track the datetime of the last query and only look for rows that have been added since then.
HTH...
Joe|||Thanks Joe. That does help.
Can DBLocks cause problems?
reports based on the counter used in Perf Mon. This alert was based on
Locks-- Lock Wait Time(MS). Anyways, 7 minutes later my 5 Web Servers which
are load balanced were unable to connect to the DB and reported an error. A
few minutes later the sites recovered and the lock issue was resolved. Im
not able to tell which of these two things occured first though. Also around
this time I got an error in the SQL Error Log:
Error: 17883, Severity: 1, State: 0
2005-08-09 00:21:06.02 server The Scheduler 3 appears to be hung. SPID 4,
ECID 0, UMS Context 0x04A13268.
I read up on this but it doesnt say that it has anything to do with locks.
http://support.microsoft.com/default.aspx?kbid=810885
Any way I can figure out if the two are related? Any way to figure out why I
had long wait times on locks?
TIA, ChrisRMy guess would be the symptoms were as the result of the error you posted.
I would go by the KB and seeif you can address the issues that caused that
error and resolve it.
--
Andrew J. Kelly SQL MVP
"ChrisR" <noemail@.bla.com> wrote in message
news:ejLY9sQnFHA.2852@.TK2MSFTNGP15.phx.gbl...
> We have a monitoring service that reported an alert last night at 12:17.
> It
> reports based on the counter used in Perf Mon. This alert was based on
> Locks-- Lock Wait Time(MS). Anyways, 7 minutes later my 5 Web Servers
> which
> are load balanced were unable to connect to the DB and reported an error.
> A
> few minutes later the sites recovered and the lock issue was resolved. Im
> not able to tell which of these two things occured first though. Also
> around
> this time I got an error in the SQL Error Log:
> Error: 17883, Severity: 1, State: 0
> 2005-08-09 00:21:06.02 server The Scheduler 3 appears to be hung. SPID
> 4,
> ECID 0, UMS Context 0x04A13268.
> I read up on this but it doesnt say that it has anything to do with locks.
> http://support.microsoft.com/default.aspx?kbid=810885
> Any way I can figure out if the two are related? Any way to figure out why
> I had long wait times on locks?
> TIA, ChrisR
>
Can DBLocks cause problems?
reports based on the counter used in Perf Mon. This alert was based on
Locks-- Lock Wait Time(MS). Anyways, 7 minutes later my 5 Web Servers which
are load balanced were unable to connect to the DB and reported an error. A
few minutes later the sites recovered and the lock issue was resolved. Im
not able to tell which of these two things occured first though. Also around
this time I got an error in the SQL Error Log:
Error: 17883, Severity: 1, State: 0
2005-08-09 00:21:06.02 server The Scheduler 3 appears to be hung. SPID 4,
ECID 0, UMS Context 0x04A13268.
I read up on this but it doesnt say that it has anything to do with locks.
http://support.microsoft.com/default.aspx?kbid=810885
Any way I can figure out if the two are related? Any way to figure out why I
had long wait times on locks?
TIA, ChrisR
My guess would be the symptoms were as the result of the error you posted.
I would go by the KB and seeif you can address the issues that caused that
error and resolve it.
Andrew J. Kelly SQL MVP
"ChrisR" <noemail@.bla.com> wrote in message
news:ejLY9sQnFHA.2852@.TK2MSFTNGP15.phx.gbl...
> We have a monitoring service that reported an alert last night at 12:17.
> It
> reports based on the counter used in Perf Mon. This alert was based on
> Locks-- Lock Wait Time(MS). Anyways, 7 minutes later my 5 Web Servers
> which
> are load balanced were unable to connect to the DB and reported an error.
> A
> few minutes later the sites recovered and the lock issue was resolved. Im
> not able to tell which of these two things occured first though. Also
> around
> this time I got an error in the SQL Error Log:
> Error: 17883, Severity: 1, State: 0
> 2005-08-09 00:21:06.02 server The Scheduler 3 appears to be hung. SPID
> 4,
> ECID 0, UMS Context 0x04A13268.
> I read up on this but it doesnt say that it has anything to do with locks.
> http://support.microsoft.com/default.aspx?kbid=810885
> Any way I can figure out if the two are related? Any way to figure out why
> I had long wait times on locks?
> TIA, ChrisR
>
Thursday, March 8, 2012
Can DBLocks cause problems?
reports based on the counter used in Perf Mon. This alert was based on
Locks-- Lock Wait Time(MS). Anyways, 7 minutes later my 5 Web Servers which
are load balanced were unable to connect to the DB and reported an error. A
few minutes later the sites recovered and the lock issue was resolved. Im
not able to tell which of these two things occured first though. Also around
this time I got an error in the SQL Error Log:
Error: 17883, Severity: 1, State: 0
2005-08-09 00:21:06.02 server The Scheduler 3 appears to be hung. SPID 4,
ECID 0, UMS Context 0x04A13268.
I read up on this but it doesnt say that it has anything to do with locks.
http://support.microsoft.com/default.aspx?kbid=810885
Any way I can figure out if the two are related? Any way to figure out why I
had long wait times on locks?
TIA, ChrisRMy guess would be the symptoms were as the result of the error you posted.
I would go by the KB and seeif you can address the issues that caused that
error and resolve it.
Andrew J. Kelly SQL MVP
"ChrisR" <noemail@.bla.com> wrote in message
news:ejLY9sQnFHA.2852@.TK2MSFTNGP15.phx.gbl...
> We have a monitoring service that reported an alert last night at 12:17.
> It
> reports based on the counter used in Perf Mon. This alert was based on
> Locks-- Lock Wait Time(MS). Anyways, 7 minutes later my 5 Web Servers
> which
> are load balanced were unable to connect to the DB and reported an error.
> A
> few minutes later the sites recovered and the lock issue was resolved. Im
> not able to tell which of these two things occured first though. Also
> around
> this time I got an error in the SQL Error Log:
> Error: 17883, Severity: 1, State: 0
> 2005-08-09 00:21:06.02 server The Scheduler 3 appears to be hung. SPID
> 4,
> ECID 0, UMS Context 0x04A13268.
> I read up on this but it doesnt say that it has anything to do with locks.
> http://support.microsoft.com/default.aspx?kbid=810885
> Any way I can figure out if the two are related? Any way to figure out why
> I had long wait times on locks?
> TIA, ChrisR
>
Can create access form layout based on table from sql?
Hi,
Can this be done? Please advise. Thanks.Is there any template available in sql for creating forms?
YOu will have to use any coding language for this like the .NET language. If you are aware of that, which platform will you use for accessing the data (Windows Forms, Web Forms, etc.). SQL Server does ot provide such a feature beside the table editor.
HTH, Jens K. Suessmeyer.
http://www.sqlserver2005.de
Wednesday, March 7, 2012
can anything other than an image be used in custom toolbox items
I have developed a renderer that renders the xml to paint a rectangle with textboxes in all the right places based on the data retrieved off the database. When i render the a complete report to the reportviewer i have no problem.
I need however to render the rectangle into a custom report item for reusability and different scenarios. This just seem to be impossible since it seems like I cant use anything other than an imagemap to render custom report items. Is this true?
To make sure you understand....in other words....
Is there a way to develop a Microsoft.ReportingServices.ReportRendering.IRenderingExtension that renders the required xml like rectangles/textboxes etc. and then migrate this to a custom toolbox item. It just seems like this should be a very easy thing to do and something regularly needed. For example when you want to use textboxes in certain positions within a rectangle to draw a organisational chart.
CRIs can output only images.
|||If that is the case which i take as unnessary and very easy to fix on Micsoft's part....I have a follow up question:
Can one in any way put a custom assembly in some container like a rectangle instead of just a textbox to have it render your custom xml into a report. I have tried this in many ways and it does not seem to be an option?
and if that answer is also no.....I have a follow-up question:
How do one change the RDL of a report to reference a custom assembly that renders XML as part of the report RDL?
and if that is not possible...am i missing something here....is there anyway in which i can on runtime decide where to represent my data?
My problem is a very simple one, i have written a report rdl generator that generates a pedigree of a horse where each horse in the hierarchichal structure has a Name, birth, color etc, and a picture. If the only way I can do this is the way I am doing it I have to write every part of the report everytime I want the pedigree to appear in a different layout instead of being able too user the fantastic report designer.
A similar issue should exist in project management with pert and cpm/ workflow/ flowcharts/human resouce management etc. etc. etc.
Any direction will be appreciated...
|||Can one in any way put a custom assembly in some container like a rectangle instead of just a textbox to have it render your custom xml into a report.
Not sure what you mean by "a custom assembly in some container" means but I wonder if the following approach will work for you since you've mentioned that you can programatically generate the report definition.
1. The report will have a single dataset with a single row and as many columns as the number of horses. Each column according to its place in the hierarchy in an ever-increasing order from top to bottom and left to right, e.g.; 1Name, 1Color, 1Photo, 2Name, 2Color.
2. You generate a free-form report programatically by walking the hierarchy and binding each textbox to its corresponding field.
It looks like you have considered a similar aproach, haven't you? Granted, you won't be able to use the Report Designer. As SSRS involves, it will undoubtedly offer more runtime flexibility but for now you cannot change the report definition at runtime.
If you can wait, another option with SSRS 2008 could be a pert chart. If you can't wait, Dundas offers this chart now.
|||Teo, thank you for your time and effort with this. Well yes i know i can do it that way but the problem with that is then you limit yourself to a fixed format. You can not change the number of levels or even the specific data to be included on the fly. I now have decided that I wil just have to use my own renderer and forget about the designer.
You see i have developed this recursive sql procedure and recursive report painter that will do the whole thing based on the property settings including the size of the page, the number of levels and what data to include and what not. I was just hoping I could put it all into a custom item to make life easier when you want to print a 44x60in poster versus a 8x10 or 15 genearations versus 5.
I must say i can think of no logical reason why Microsoft cant allow the CRI to render any type of report item. They already render all the types and it does not make sense that they would limit developers to only imagetypes.
Note: With "a custom assembly in some container" i meant that currently you can write a custom asembly which you reference in a textbox to return a value. on the same logic one should have been able to reference a custom asssembly from a Rectangle and have the custom assembly return the reportitemscontained inside the rectangle. There are a few ways in which it can be implemented fairly easy.
Friday, February 24, 2012
Can an Optron X2 be used as a SQL server
A DBA friend of mine wants to know if he can use an Optron X2 based system
as a SQL server. He tried running:
Win2003 64bit Server
MS SQL 2000 w/SP4
2 Gig of RAM
1 TB HD array.
He wants to process a lot of financial data and use the MS SQL to do it.
When he ran the above setup everything seemed fine but 15 hours later all hi
s
data was corrupted. He said it was the Optron processor's fault as they are
not 100% compatable. He is an experienced DBA.
Questions:
1. Will the above configuration work?
2. My DBA friend said that SP4 only supported Intel chips and would not
work for AMD, is that true? I have looked through the SP4 page and found no
reference to Intel or AMD only updates.
3. Since Win2003 64-bit only runs SQL 2000 SP4 through a 32-bit emulator, is
there an advantage in going with Win2003-64 or would the 32-bit version be
fine?
4. What about the upcomming SQL 2005, will that have native support for
64-bit?
5. Will the Upcomming SQL 2005 on Win2003-64bit Server work with AMD Optron
X2 (Dual Core) Chips? Is there anything Intel Only about the design?Hello,
If no one can answer this questions directly, can you at least point me into
the right direction. As far as I can tell AMD is 100% compatable with
Win2003 64-bit and SQL 2000 SP4 should work fine, but I am not a DBA and my
friend will not just take my word for it.
Does anyone know how I can get MS to answer these questions?
"Roger Huston" wrote:
> Hello,
> A DBA friend of mine wants to know if he can use an Optron X2 based system
> as a SQL server. He tried running:
> Win2003 64bit Server
> MS SQL 2000 w/SP4
> 2 Gig of RAM
> 1 TB HD array.
> He wants to process a lot of financial data and use the MS SQL to do it.
> When he ran the above setup everything seemed fine but 15 hours later all
his
> data was corrupted. He said it was the Optron processor's fault as they a
re
> not 100% compatable. He is an experienced DBA.
> Questions:
> 1. Will the above configuration work?
> 2. My DBA friend said that SP4 only supported Intel chips and would not
> work for AMD, is that true? I have looked through the SP4 page and found
no
> reference to Intel or AMD only updates.
> 3. Since Win2003 64-bit only runs SQL 2000 SP4 through a 32-bit emulator,
is
> there an advantage in going with Win2003-64 or would the 32-bit version be
> fine?
> 4. What about the upcomming SQL 2005, will that have native support for
> 64-bit?
> 5. Will the Upcomming SQL 2005 on Win2003-64bit Server work with AMD Optro
n
> X2 (Dual Core) Chips? Is there anything Intel Only about the design?|||Changes to SQL Server 2000 Service Pack 4 operating system support
http://support.microsoft.com/defaul...kb;en-us;898042
Reading this article indicates that SQL 2000 SP4 is specifically compatible
with x64 operating systems running on Opteron processors. My suspicion
would be on the disk subsystem. SQL tends to push a disk system far harder
than any other application.
Here is a tool to stress your disk system and tell whether it can hold up to
SQL Server or not:
How to use the SQLIOStress utility to stress a disk subsystem such as SQL
Server
http://support.microsoft.com/defaul...kb;en-us;231619
SQL 2005 will run native on x64 architecture instead of in the 32-bit WOW
environment. Note that SQL 2005 has been in development as a native x64 app
for several years and Intel only recently released an x64 processor. That
should give a clue to what environment it must have been developed and
tested on. I would not worry about AMD compatibility going forward.
Geoff N. Hiten
Senior Database Administrator
Microsoft SQL Server MVP
"Roger Huston" <Roger Huston@.discussions.microsoft.com> wrote in message
news:25357B88-5460-4127-B97C-C020F57AD15A@.microsoft.com...
> Hello,
> A DBA friend of mine wants to know if he can use an Optron X2 based system
> as a SQL server. He tried running:
> Win2003 64bit Server
> MS SQL 2000 w/SP4
> 2 Gig of RAM
> 1 TB HD array.
> He wants to process a lot of financial data and use the MS SQL to do it.
> When he ran the above setup everything seemed fine but 15 hours later all
> his
> data was corrupted. He said it was the Optron processor's fault as they
> are
> not 100% compatable. He is an experienced DBA.
> Questions:
> 1. Will the above configuration work?
> 2. My DBA friend said that SP4 only supported Intel chips and would not
> work for AMD, is that true? I have looked through the SP4 page and found
> no
> reference to Intel or AMD only updates.
> 3. Since Win2003 64-bit only runs SQL 2000 SP4 through a 32-bit emulator,
> is
> there an advantage in going with Win2003-64 or would the 32-bit version be
> fine?
> 4. What about the upcomming SQL 2005, will that have native support for
> 64-bit?
> 5. Will the Upcomming SQL 2005 on Win2003-64bit Server work with AMD
> Optron
> X2 (Dual Core) Chips? Is there anything Intel Only about the design?|||Well, he has a SATA II array. Since this was not a multi-user system more
just plugging through large tables, he thought he could get by with this for
personal work, but I will use your tool just to be sure.
Thanks,
Roger
"Geoff N. Hiten" wrote:
> Changes to SQL Server 2000 Service Pack 4 operating system support
> http://support.microsoft.com/defaul...kb;en-us;898042
> Reading this article indicates that SQL 2000 SP4 is specifically compatibl
e
> with x64 operating systems running on Opteron processors. My suspicion
> would be on the disk subsystem. SQL tends to push a disk system far harde
r
> than any other application.
> Here is a tool to stress your disk system and tell whether it can hold up
to
> SQL Server or not:
> How to use the SQLIOStress utility to stress a disk subsystem such as SQL
> Server
> http://support.microsoft.com/defaul...kb;en-us;231619
> SQL 2005 will run native on x64 architecture instead of in the 32-bit WOW
> environment. Note that SQL 2005 has been in development as a native x64 a
pp
> for several years and Intel only recently released an x64 processor. That
> should give a clue to what environment it must have been developed and
> tested on. I would not worry about AMD compatibility going forward.
> Geoff N. Hiten
> Senior Database Administrator
> Microsoft SQL Server MVP
>
>
> "Roger Huston" <Roger Huston@.discussions.microsoft.com> wrote in message
> news:25357B88-5460-4127-B97C-C020F57AD15A@.microsoft.com...
>
>
Can an Optron X2 be used as a SQL server
A DBA friend of mine wants to know if he can use an Optron X2 based system
as a SQL server. He tried running:
Win2003 64bit Server
MS SQL 2000 w/SP4
2 Gig of RAM
1 TB HD array.
He wants to process a lot of financial data and use the MS SQL to do it.
When he ran the above setup everything seemed fine but 15 hours later all his
data was corrupted. He said it was the Optron processor's fault as they are
not 100% compatable. He is an experienced DBA.
Questions:
1. Will the above configuration work?
2. My DBA friend said that SP4 only supported Intel chips and would not
work for AMD, is that true? I have looked through the SP4 page and found no
reference to Intel or AMD only updates.
3. Since Win2003 64-bit only runs SQL 2000 SP4 through a 32-bit emulator, is
there an advantage in going with Win2003-64 or would the 32-bit version be
fine?
4. What about the upcomming SQL 2005, will that have native support for
64-bit?
5. Will the Upcomming SQL 2005 on Win2003-64bit Server work with AMD Optron
X2 (Dual Core) Chips? Is there anything Intel Only about the design?Hello,
If no one can answer this questions directly, can you at least point me into
the right direction. As far as I can tell AMD is 100% compatable with
Win2003 64-bit and SQL 2000 SP4 should work fine, but I am not a DBA and my
friend will not just take my word for it.
Does anyone know how I can get MS to answer these questions?
"Roger Huston" wrote:
> Hello,
> A DBA friend of mine wants to know if he can use an Optron X2 based system
> as a SQL server. He tried running:
> Win2003 64bit Server
> MS SQL 2000 w/SP4
> 2 Gig of RAM
> 1 TB HD array.
> He wants to process a lot of financial data and use the MS SQL to do it.
> When he ran the above setup everything seemed fine but 15 hours later all his
> data was corrupted. He said it was the Optron processor's fault as they are
> not 100% compatable. He is an experienced DBA.
> Questions:
> 1. Will the above configuration work?
> 2. My DBA friend said that SP4 only supported Intel chips and would not
> work for AMD, is that true? I have looked through the SP4 page and found no
> reference to Intel or AMD only updates.
> 3. Since Win2003 64-bit only runs SQL 2000 SP4 through a 32-bit emulator, is
> there an advantage in going with Win2003-64 or would the 32-bit version be
> fine?
> 4. What about the upcomming SQL 2005, will that have native support for
> 64-bit?
> 5. Will the Upcomming SQL 2005 on Win2003-64bit Server work with AMD Optron
> X2 (Dual Core) Chips? Is there anything Intel Only about the design?|||Changes to SQL Server 2000 Service Pack 4 operating system support
http://support.microsoft.com/default.aspx?scid=kb;en-us;898042
Reading this article indicates that SQL 2000 SP4 is specifically compatible
with x64 operating systems running on Opteron processors. My suspicion
would be on the disk subsystem. SQL tends to push a disk system far harder
than any other application.
Here is a tool to stress your disk system and tell whether it can hold up to
SQL Server or not:
How to use the SQLIOStress utility to stress a disk subsystem such as SQL
Server
http://support.microsoft.com/default.aspx?scid=kb;en-us;231619
SQL 2005 will run native on x64 architecture instead of in the 32-bit WOW
environment. Note that SQL 2005 has been in development as a native x64 app
for several years and Intel only recently released an x64 processor. That
should give a clue to what environment it must have been developed and
tested on. I would not worry about AMD compatibility going forward.
Geoff N. Hiten
Senior Database Administrator
Microsoft SQL Server MVP
"Roger Huston" <Roger Huston@.discussions.microsoft.com> wrote in message
news:25357B88-5460-4127-B97C-C020F57AD15A@.microsoft.com...
> Hello,
> A DBA friend of mine wants to know if he can use an Optron X2 based system
> as a SQL server. He tried running:
> Win2003 64bit Server
> MS SQL 2000 w/SP4
> 2 Gig of RAM
> 1 TB HD array.
> He wants to process a lot of financial data and use the MS SQL to do it.
> When he ran the above setup everything seemed fine but 15 hours later all
> his
> data was corrupted. He said it was the Optron processor's fault as they
> are
> not 100% compatable. He is an experienced DBA.
> Questions:
> 1. Will the above configuration work?
> 2. My DBA friend said that SP4 only supported Intel chips and would not
> work for AMD, is that true? I have looked through the SP4 page and found
> no
> reference to Intel or AMD only updates.
> 3. Since Win2003 64-bit only runs SQL 2000 SP4 through a 32-bit emulator,
> is
> there an advantage in going with Win2003-64 or would the 32-bit version be
> fine?
> 4. What about the upcomming SQL 2005, will that have native support for
> 64-bit?
> 5. Will the Upcomming SQL 2005 on Win2003-64bit Server work with AMD
> Optron
> X2 (Dual Core) Chips? Is there anything Intel Only about the design?|||Well, he has a SATA II array. Since this was not a multi-user system more
just plugging through large tables, he thought he could get by with this for
personal work, but I will use your tool just to be sure.
Thanks,
Roger
"Geoff N. Hiten" wrote:
> Changes to SQL Server 2000 Service Pack 4 operating system support
> http://support.microsoft.com/default.aspx?scid=kb;en-us;898042
> Reading this article indicates that SQL 2000 SP4 is specifically compatible
> with x64 operating systems running on Opteron processors. My suspicion
> would be on the disk subsystem. SQL tends to push a disk system far harder
> than any other application.
> Here is a tool to stress your disk system and tell whether it can hold up to
> SQL Server or not:
> How to use the SQLIOStress utility to stress a disk subsystem such as SQL
> Server
> http://support.microsoft.com/default.aspx?scid=kb;en-us;231619
> SQL 2005 will run native on x64 architecture instead of in the 32-bit WOW
> environment. Note that SQL 2005 has been in development as a native x64 app
> for several years and Intel only recently released an x64 processor. That
> should give a clue to what environment it must have been developed and
> tested on. I would not worry about AMD compatibility going forward.
> Geoff N. Hiten
> Senior Database Administrator
> Microsoft SQL Server MVP
>
>
> "Roger Huston" <Roger Huston@.discussions.microsoft.com> wrote in message
> news:25357B88-5460-4127-B97C-C020F57AD15A@.microsoft.com...
> > Hello,
> >
> > A DBA friend of mine wants to know if he can use an Optron X2 based system
> > as a SQL server. He tried running:
> >
> > Win2003 64bit Server
> > MS SQL 2000 w/SP4
> > 2 Gig of RAM
> > 1 TB HD array.
> >
> > He wants to process a lot of financial data and use the MS SQL to do it.
> > When he ran the above setup everything seemed fine but 15 hours later all
> > his
> > data was corrupted. He said it was the Optron processor's fault as they
> > are
> > not 100% compatable. He is an experienced DBA.
> >
> > Questions:
> > 1. Will the above configuration work?
> >
> > 2. My DBA friend said that SP4 only supported Intel chips and would not
> > work for AMD, is that true? I have looked through the SP4 page and found
> > no
> > reference to Intel or AMD only updates.
> >
> > 3. Since Win2003 64-bit only runs SQL 2000 SP4 through a 32-bit emulator,
> > is
> > there an advantage in going with Win2003-64 or would the 32-bit version be
> > fine?
> >
> > 4. What about the upcomming SQL 2005, will that have native support for
> > 64-bit?
> >
> > 5. Will the Upcomming SQL 2005 on Win2003-64bit Server work with AMD
> > Optron
> > X2 (Dual Core) Chips? Is there anything Intel Only about the design?
>
>
Can an Optron X2 be used as a SQL server
A DBA friend of mine wants to know if he can use an Optron X2 based system
as a SQL server. He tried running:
Win2003 64bit Server
MS SQL 2000 w/SP4
2 Gig of RAM
1 TB HD array.
He wants to process a lot of financial data and use the MS SQL to do it.
When he ran the above setup everything seemed fine but 15 hours later all his
data was corrupted. He said it was the Optron processor's fault as they are
not 100% compatable. He is an experienced DBA.
Questions:
1. Will the above configuration work?
2. My DBA friend said that SP4 only supported Intel chips and would not
work for AMD, is that true? I have looked through the SP4 page and found no
reference to Intel or AMD only updates.
3. Since Win2003 64-bit only runs SQL 2000 SP4 through a 32-bit emulator, is
there an advantage in going with Win2003-64 or would the 32-bit version be
fine?
4. What about the upcomming SQL 2005, will that have native support for
64-bit?
5. Will the Upcomming SQL 2005 on Win2003-64bit Server work with AMD Optron
X2 (Dual Core) Chips? Is there anything Intel Only about the design?
Hello,
If no one can answer this questions directly, can you at least point me into
the right direction. As far as I can tell AMD is 100% compatable with
Win2003 64-bit and SQL 2000 SP4 should work fine, but I am not a DBA and my
friend will not just take my word for it.
Does anyone know how I can get MS to answer these questions?
"Roger Huston" wrote:
> Hello,
> A DBA friend of mine wants to know if he can use an Optron X2 based system
> as a SQL server. He tried running:
> Win2003 64bit Server
> MS SQL 2000 w/SP4
> 2 Gig of RAM
> 1 TB HD array.
> He wants to process a lot of financial data and use the MS SQL to do it.
> When he ran the above setup everything seemed fine but 15 hours later all his
> data was corrupted. He said it was the Optron processor's fault as they are
> not 100% compatable. He is an experienced DBA.
> Questions:
> 1. Will the above configuration work?
> 2. My DBA friend said that SP4 only supported Intel chips and would not
> work for AMD, is that true? I have looked through the SP4 page and found no
> reference to Intel or AMD only updates.
> 3. Since Win2003 64-bit only runs SQL 2000 SP4 through a 32-bit emulator, is
> there an advantage in going with Win2003-64 or would the 32-bit version be
> fine?
> 4. What about the upcomming SQL 2005, will that have native support for
> 64-bit?
> 5. Will the Upcomming SQL 2005 on Win2003-64bit Server work with AMD Optron
> X2 (Dual Core) Chips? Is there anything Intel Only about the design?
|||Changes to SQL Server 2000 Service Pack 4 operating system support
http://support.microsoft.com/default...b;en-us;898042
Reading this article indicates that SQL 2000 SP4 is specifically compatible
with x64 operating systems running on Opteron processors. My suspicion
would be on the disk subsystem. SQL tends to push a disk system far harder
than any other application.
Here is a tool to stress your disk system and tell whether it can hold up to
SQL Server or not:
How to use the SQLIOStress utility to stress a disk subsystem such as SQL
Server
http://support.microsoft.com/default...b;en-us;231619
SQL 2005 will run native on x64 architecture instead of in the 32-bit WOW
environment. Note that SQL 2005 has been in development as a native x64 app
for several years and Intel only recently released an x64 processor. That
should give a clue to what environment it must have been developed and
tested on. I would not worry about AMD compatibility going forward.
Geoff N. Hiten
Senior Database Administrator
Microsoft SQL Server MVP
"Roger Huston" <Roger Huston@.discussions.microsoft.com> wrote in message
news:25357B88-5460-4127-B97C-C020F57AD15A@.microsoft.com...
> Hello,
> A DBA friend of mine wants to know if he can use an Optron X2 based system
> as a SQL server. He tried running:
> Win2003 64bit Server
> MS SQL 2000 w/SP4
> 2 Gig of RAM
> 1 TB HD array.
> He wants to process a lot of financial data and use the MS SQL to do it.
> When he ran the above setup everything seemed fine but 15 hours later all
> his
> data was corrupted. He said it was the Optron processor's fault as they
> are
> not 100% compatable. He is an experienced DBA.
> Questions:
> 1. Will the above configuration work?
> 2. My DBA friend said that SP4 only supported Intel chips and would not
> work for AMD, is that true? I have looked through the SP4 page and found
> no
> reference to Intel or AMD only updates.
> 3. Since Win2003 64-bit only runs SQL 2000 SP4 through a 32-bit emulator,
> is
> there an advantage in going with Win2003-64 or would the 32-bit version be
> fine?
> 4. What about the upcomming SQL 2005, will that have native support for
> 64-bit?
> 5. Will the Upcomming SQL 2005 on Win2003-64bit Server work with AMD
> Optron
> X2 (Dual Core) Chips? Is there anything Intel Only about the design?
|||Well, he has a SATA II array. Since this was not a multi-user system more
just plugging through large tables, he thought he could get by with this for
personal work, but I will use your tool just to be sure.
Thanks,
Roger
"Geoff N. Hiten" wrote:
> Changes to SQL Server 2000 Service Pack 4 operating system support
> http://support.microsoft.com/default...b;en-us;898042
> Reading this article indicates that SQL 2000 SP4 is specifically compatible
> with x64 operating systems running on Opteron processors. My suspicion
> would be on the disk subsystem. SQL tends to push a disk system far harder
> than any other application.
> Here is a tool to stress your disk system and tell whether it can hold up to
> SQL Server or not:
> How to use the SQLIOStress utility to stress a disk subsystem such as SQL
> Server
> http://support.microsoft.com/default...b;en-us;231619
> SQL 2005 will run native on x64 architecture instead of in the 32-bit WOW
> environment. Note that SQL 2005 has been in development as a native x64 app
> for several years and Intel only recently released an x64 processor. That
> should give a clue to what environment it must have been developed and
> tested on. I would not worry about AMD compatibility going forward.
> Geoff N. Hiten
> Senior Database Administrator
> Microsoft SQL Server MVP
>
>
> "Roger Huston" <Roger Huston@.discussions.microsoft.com> wrote in message
> news:25357B88-5460-4127-B97C-C020F57AD15A@.microsoft.com...
>
>
Can a WHERE clause refer to a column based on a subquery ?
(The real query contains lots more columns and the subquery is quite long)
SELECT table1.ColA, table1.ColB, (SELECT TOP 1 colX from table2 WHERE etc. ) FROM table1
Sometimes the sub-query returns nulls which is fine.
I now want to modify the stored procedure so that it will optionally only return the rows where the sub-query returns non-null values. I've added an int parameter @.filter to the procedure. If @.filter = 0 I will return all rows; if @.filter = 1 I will filter the results.
The query now looks like this:
SELECT table1.ColA, table1.ColB, subquery = (SELECT TOP 1 colX from table2 WHERE etc. ) FROM table1
WHERE (@.filter = 0 or not subquery is null).
However, I get an invalid column name 'subquery' error.
Have I simply got my syntax wrong or is it not possible to do this. I've played with a few variations such as '(SELECT ....) as subquery' but nothing seems to work.
I can imagine a solution where the sub-query is used to generate a table that table1 can be inner joined with, but the query is quite big (and has been tested) and I didn't want to start hacking it about if there was a trivial fix.
Any help appreciated.I have found the answer to my own question.
The SELECT parameters (including the sub-query) are not evaluated until after the WHERE so what I wanted to do is not possible.
I found the link below useful.
http://databases.aspfaq.com/database/how-do-i-use-a-select-list-alias-in-the-where-or-group-by-clause.html|||i din get ur exact requirement , but yes the syntax is not correct....
read a bit abt 'corelated subqueries' from books online..u'll hopefuly get a solution...
if u dont post back , i'll try to put some example...|||
The SELECT list expressions can be evaluated before the WHERE clause in SQL Server. But that has nothing to do with the problem though. Column aliases are only part of the result set metadata that the client uses. As such it can be used only in the ORDER BY clause (in ANSI SQL, the ORDER BY belongs on the client-side & hence it is allowed in ORDER BY). You can use derived table to simplify complex SELECT statements and avoid repeating expressions like:
SELECT ColA, ColB, ColN
FROM (
SELECT table1.ColA, table1.ColB
, (SELECT TOP 1 colX from table2 WHERE etc. ) as ColN
FROM table1
) as t
WHERE (@.filter = 0 or ColN is not null)
It works now.
Friday, February 10, 2012
Calling stored procs based on a code table
I need to run stored procs based on a list in a code table. In other words, it reads the name of a stored proc from a table and runs it and does this for all the rows in the table.I think the ForEach loop container will do what I need and there is an ADO enumerator option but the documentation does not tell you how to use this.From what I can tell, you need to get a dataset into an SSIS variable first and then you plug the variable name into the ForEach ADO enumerator.Is that correct? If so, can someone tell me how to get a dataset into a variable?
Thanks
Perhaps kirk's blog will help you:
http://sqljunkies.com/WebLog/knight_reign/archive/2005/03/25/9588.aspx