Showing posts with label queries. Show all posts
Showing posts with label queries. Show all posts

Monday, March 19, 2012

CASE alias in WHERE

Hello,

I found members of this group very helpful for my last queries.
Have one problem with CASE. I can use the column name alias in Order By Clause
but unable to use it in WHERE CLAUSE.
PLS TELL ME IF IT IS POSSIBLE TO USE IT IN WHERE CLAUSE AND SOME ALTERNATIVE.

QUERY:

SELECT
M.SECS =
CASE
WHEN NO_OF_SEC IS NULL THEN -1
WHEN NO_OF_SEC =0 THEN 1
ELSE NO_OF_SEC
END
FROM DOWNLOAD_MASTER M
WHERE M.SECS < 100
ORDER BY M.SECS

Hoping for a immediate reply.
thanks in advanceReferences to column aliases are only valid in the ORDER BY clause. You can
work around this by putting the expression into a derived table:

SELECT secs
FROM
(SELECT secs =
CASE
WHEN no_of_sec IS NULL THEN -1
WHEN no_of_sec = 0 THEN 1
ELSE no_of_sec
END
FROM DOWNLOAD_MASTER) AS M
WHERE secs < 100
ORDER BY secs

--
David Portas
SQL Server MVP
--|||On 5 Jul 2004 04:02:38 -0700, A.V.C. wrote:

>Hello,
>I found members of this group very helpful for my last queries.
>Have one problem with CASE. I can use the column name alias in Order By Clause
>but unable to use it in WHERE CLAUSE.
>PLS TELL ME IF IT IS POSSIBLE TO USE IT IN WHERE CLAUSE AND SOME ALTERNATIVE.
>QUERY:
>SELECT
>M.SECS =
>CASE
>WHEN NO_OF_SEC IS NULL THEN -1
>WHEN NO_OF_SEC =0 THEN 1
>ELSE NO_OF_SEC
>END
>FROM DOWNLOAD_MASTER M
>WHERE M.SECS < 100
>ORDER BY M.SECS
>
>Hoping for a immediate reply.
>thanks in advance

Hi A.V.C.,

Before answering your question, one remark about your query. I advise you
to remove "M." before "SECS". You are using an alias; not a column name.
The name "M.SECS" looks as if you're referring to a column named SECS in
the table named (or aliased) M. I expect the above query to throw an error
because column SECS can't be found in the table DOWNLOAD_MASTER. The order
by clause will probably not throw an error, but that is only because table
names (or aliases) are largely mostly disregarded by SQL Server when
evaluating an roder by clause.

To answer your question: no, this is not possible. To understand why, it
helps to know how an SQL query gets evaluated. Note that this is a
conceptual description; a good RDBMS will change the order of operation to
optimize; as long as the results remain the same that is not a problem.

Step 1: Evaluate FROM clause, build intermediate table from all rows in
the tables used, joined together on the conditions given. If old style
join syntax is used (with the ON conditions in the WHERE clause), this
step will yield the full carthesian product of all tables used.

Step 2: Evaluate WHERE clause, remove rows that don't match the criteria
from intermediate table.

Step 3: Evaluate GROUP BY clause, group rows together according to the
specified arguments.

Step 4: Evaluate HAVING clause, remove groups that don't match the
criteria from intermediate table.

Step 5: Evaluate SELECT clause, build result set to be returned from the
data in the intermediate table.

Step 6: Evaluate ORDER BY, perform sorting.

Officially, columns that are not included in the SELECT clause are not
available for sorting. Many products (like SQL Server) do allow this, but
it is a non-standard extension of the ISO/ANSI SQL-92 specification (and I
don't think that later SQL specifications included this).

Since the alias of a columns or expression is only effective from step 5
but the WHERE clause is evaluated as step 2, it is clear that an alias
can't be used in the WHERE clause.

You also ask for alternatives. In your case, you could try either "WHERE
COALESCE(NO_OF_SEC, -1) < 100" or "WHERE NO_OF_SEC < 100 OR NO_OF_SEC IS
NULL". In more complex cases, you might have to repeat the CASE expression
in the WHERE clause. If you dislike that redundancy, you can always use
the derived table approach. For your query, the equivalent with a derived
table would look like this:

SELECT SECS
FROM (SELECT SECS = CASE
WHEN NO_OF_SEC IS NULL THEN -1
WHEN NO_OF_SEC = 0 THEN 1
ELSE NO_OF_SEC
END
FROM DOWNLOAD_MASTER) AS D
WHERE SECS < 100
ORDER BY SECS
(untested)

Best, Hugo
--

(Remove _NO_ and _SPAM_ to get my e-mail address)|||Thank you David Portas and Hugo Kornelis

I agree with the point(M.) mentioned by Hugo Kornelis.
I appreciate your way of writing descriptive answers.

Thanks once again.

Case

Being new to SQL Server and comming from an Oracle environment...
When I write queries for Oracle, I have to ensure that my queries are
written to be case sensitive. Now when I write those same queries in SQL
(using .Net) it does not appear to be case sensitive. Is this a database
setting or some setting in .Net which is causing case to be ignored?Hi,
You SQL Server collation must be set as CASE INSENSITIVE.. In this case
there is not difference betweeen Upper and
Lower case characters. If your collation is set to Case Sensitive then you
will have the difference between Upper and Lower case.
See the collation of the server using below command:-
select SERVERPROPERTY ( 'collation' )
Thanks
Hari
SQL Server MVP
"Jim Heavey" <JimHeavey@.discussions.microsoft.com> wrote in message
news:D18CBCF9-EA51-4F72-A70D-61C86378C036@.microsoft.com...
> Being new to SQL Server and comming from an Oracle environment...
> When I write queries for Oracle, I have to ensure that my queries are
> written to be case sensitive. Now when I write those same queries in SQL
> (using .Net) it does not appear to be case sensitive. Is this a database
> setting or some setting in .Net which is causing case to be ignored?
>|||Hari Prasad wrote:
[vbcol=seagreen]
> Hi,
> You SQL Server collation must be set as CASE INSENSITIVE.. In this case
> there is not difference betweeen Upper and
> Lower case characters. If your collation is set to Case Sensitive then you
> will have the difference between Upper and Lower case.
> See the collation of the server using below command:-
> select SERVERPROPERTY ( 'collation' )
> Thanks
> Hari
> SQL Server MVP
>
> "Jim Heavey" <JimHeavey@.discussions.microsoft.com> wrote in message
> news:D18CBCF9-EA51-4F72-A70D-61C86378C036@.microsoft.com...
It depends on collation of your SQL Server.
In your collation if you found CI then that collation is
case-insensitive and if it is CS then it is case-sensitive.
Try this
select * from ::fn_helpcollations()
where name = serverproperty('collation')
Regards
Amish Shah

Case

Being new to SQL Server and comming from an Oracle environment...
When I write queries for Oracle, I have to ensure that my queries are
written to be case sensitive. Now when I write those same queries in SQL
(using .Net) it does not appear to be case sensitive. Is this a database
setting or some setting in .Net which is causing case to be ignored?Hi,
You SQL Server collation must be set as CASE INSENSITIVE.. In this case
there is not difference betweeen Upper and
Lower case characters. If your collation is set to Case Sensitive then you
will have the difference between Upper and Lower case.
See the collation of the server using below command:-
select SERVERPROPERTY ( 'collation' )
Thanks
Hari
SQL Server MVP
"Jim Heavey" <JimHeavey@.discussions.microsoft.com> wrote in message
news:D18CBCF9-EA51-4F72-A70D-61C86378C036@.microsoft.com...
> Being new to SQL Server and comming from an Oracle environment...
> When I write queries for Oracle, I have to ensure that my queries are
> written to be case sensitive. Now when I write those same queries in SQL
> (using .Net) it does not appear to be case sensitive. Is this a database
> setting or some setting in .Net which is causing case to be ignored?
>|||Hari Prasad wrote:
> Hi,
> You SQL Server collation must be set as CASE INSENSITIVE.. In this case
> there is not difference betweeen Upper and
> Lower case characters. If your collation is set to Case Sensitive then you
> will have the difference between Upper and Lower case.
> See the collation of the server using below command:-
> select SERVERPROPERTY ( 'collation' )
> Thanks
> Hari
> SQL Server MVP
>
> "Jim Heavey" <JimHeavey@.discussions.microsoft.com> wrote in message
> news:D18CBCF9-EA51-4F72-A70D-61C86378C036@.microsoft.com...
> > Being new to SQL Server and comming from an Oracle environment...
> > When I write queries for Oracle, I have to ensure that my queries are
> > written to be case sensitive. Now when I write those same queries in SQL
> > (using .Net) it does not appear to be case sensitive. Is this a database
> > setting or some setting in .Net which is causing case to be ignored?
> >
It depends on collation of your SQL Server.
In your collation if you found CI then that collation is
case-insensitive and if it is CS then it is case-sensitive.
Try this
select * from ::fn_helpcollations()
where name = serverproperty('collation')
Regards
Amish Shah

Cascading query with parameters

I need to get at some information and this is the only way I know how to do it but I need to run these queries in order and using the previous query output. I don't know how to set up the output parameters so they can be used in the second query and the second query results to be used in the third query.

In a nutshell: The first query gets a number from a user as a parameter and pulls one record containing multiple fields. Some of those fields will be needed as parameters in the second query to pull mutltiple records. I need to put some where statements in to narrow down the result set. Then this part I haven't figured out either, but then the third query takes one record from the second result set and pulls mutliple records to put in a report.

I hope at least a good part of this makes sense. Please HELP ME!

ALTER PROCEDURE sp_getOfficerList

@.compositeNumber int

as

SELECT tblCampus.fldCampusCode, tblGroup.fldGroupCode, tblContract.fldGraduationMonthCode, tblComposite.fldCompositeNumber,

tblContract.fldContractCode, tblGroup.fldGroupName, tblCampus.fldCampusName

FROM tblComposite INNER JOIN

tblContract ON tblComposite.fldContractID = tblContract.fldContractID INNER JOIN

tblOrganization ON tblContract.fldOrganizationID = tblOrganization.fldOrganizationID INNER JOIN

tblGroup ON tblOrganization.fldGroupID = tblGroup.fldGroupID INNER JOIN

tblCampus ON tblOrganization.fldCampusID =tblCampus.fldCampusID

WHERE (tblComposite.fldCompositeNumber = @.compositeNumber)

declare

@.campusCode varchar(10),

@.groupCode varchar(5),

@.graduationMonthCode varchar(2)

SELECT tblComposite.fldCompositeNumber

FROM tblContract INNER JOIN

tblComposite ON tblContract.fldContractID = tblComposite.fldContractID INNER JOIN

tblOrganization ON tblContract.fldOrganizationID = tblOrganization.fldOrganizationID INNER JOIN

tblCampus ON tblOrganization.fldCampusID = tblCampus.fldCampusID INNER JOIN

tblGroup ON tblOrganization.fldGroupID = tblGroup.fldGroupID

WHERE (tblCampus.fldCampusCode = @.campusCode) AND (tblGroup.fldGroupCode = @.groupCode) AND

(tblContract.fldGraduationMonthCode = @.graduationMonthCode)

declare

@.lastCompositeNumber int

SELECT DISTINCT tblCameraCard.fldTitle

FROM tblCameraCard INNER JOIN

tblComposite_CameraCard_Link ON tblCameraCard.fldCameraCardID = tblComposite_CameraCard_Link.fldCameraCardID INNER JOIN

tblComposite ON tblComposite_CameraCard_Link.fldCompositeID = tblComposite.fldCompositeID

WHERE (tblComposite.fldCompositeNumber = @.lastCompositeNumber) AND (NOT (tblCameraCard.fldTitle IS NULL)) OR

(tblCameraCard.fldTitle = '')

Ok, let me rephrase my question. I want to take the result from query A and make it be the parameter for query B and take the result from query B and make that the parameter for query C. The results from query C is what I want to put in my report.

I did some research and found I could set a query equal to something. So I did that but how do I get that returned value to the next query?

Sunday, March 11, 2012

cascading parameters

Hello,
I have a total of 5 parameters in my report. Year, season, list type,
startdate, enddate.
Year and season are simple queries.
List type depends on year and season
Startdate depends on year,season and list type. it has a default value
(dataset) to pull the min(date) given the year, season and list type
Enddate depends on year,season and list type. it has a default value
(dataset) to pull the max(date) given the year, season and list type
The report parameters are ok when the user selects the values for the
first time. but then when they try to change just the season parameter,
the startdate and enddate do not default to the correct values. Is
there a way I can force the startdate and enddate parameters to
re-query or re populate?
thanks in advanceActually the refresh depends on the first parameter, when it is changed then
it refreshes all since it is cascading. before changing 2nd param you need to
refresh and do the changes, because since season is dependent on year so if
you change the year then season will get changed.
Amarnath
"clemlau@.yahoo.com" wrote:
> Hello,
> I have a total of 5 parameters in my report. Year, season, list type,
> startdate, enddate.
> Year and season are simple queries.
> List type depends on year and season
> Startdate depends on year,season and list type. it has a default value
> (dataset) to pull the min(date) given the year, season and list type
> Enddate depends on year,season and list type. it has a default value
> (dataset) to pull the max(date) given the year, season and list type
> The report parameters are ok when the user selects the values for the
> first time. but then when they try to change just the season parameter,
> the startdate and enddate do not default to the correct values. Is
> there a way I can force the startdate and enddate parameters to
> re-query or re populate?
> thanks in advance
>

Saturday, February 25, 2012

Capturing rows inserted from bulk insert

Is there any way to capture the count of rows processed by a bulk insert task?
A property perhaps?
I can run queries post import but would prefer it if there was a way to capture that number directly. It was something we had in the old DTS as the package ran. Anything we can do to discover it in SSIS?

Paul PisarekOne option is to enable the out-of-box logging to sysdtslog90 table - the components displays number of rows processed. It's in the 'message' text colum though, so you need to add a little bit of parsing to get your specific data.
KDog|||That's right. We're working on a sample that parses the string and creates a report from it, hopefully should be available to you soon. But, yes, parsing the log is the right approach.

Capturing queries sent to SQL Server

I use a software package that queries a Microsoft SQL Server 2000 database
from a client side Windows application. The client application has a built
in report generator that allows users to easily produce complex reports.
The client application was written in Delphi, and uses Borland's BDE to
connect to the SQL Server.
I would like to trap the SQL code that is being produced and sent to the
SQL Server from the report generator (so that I can get a get a better
understanding of how to directly query the database outside of the report
generator).
Any suggestions on how to do this? Are there any third party products that
can provide me with this capability?
Thanks,
DeanOne of my favourite tools will do this "Profiler". It is in your SQL Server
program group.
--
Allan Mitchell (Microsoft SQL Server MVP)
MCSE,MCDBA
www.SQLDTS.com
I support PASS - the definitive, global community
for SQL Server professionals - http://www.sqlpass.org
"dean" <deanbillings@.yahoo.com> wrote in message
news:Xns93B61780A829Bdean918yahoocom@.24.168.128.78...
> I use a software package that queries a Microsoft SQL Server 2000 database
> from a client side Windows application. The client application has a
built
> in report generator that allows users to easily produce complex reports.
> The client application was written in Delphi, and uses Borland's BDE to
> connect to the SQL Server.
> I would like to trap the SQL code that is being produced and sent to the
> SQL Server from the report generator (so that I can get a get a better
> understanding of how to directly query the database outside of the report
> generator).
> Any suggestions on how to do this? Are there any third party products
that
> can provide me with this capability?
> Thanks,
> Dean|||Dean,
You don't need a third party product. Take a look a SQL Profiler that comes
with SQL Server. The following article will help you get the most out of
Profiler http://www.sql-server-performance.com/sql_server_profiler_tips.asp.
J.R.
Largo SQL Tools
The Finest Collection of SQL Tools Available
http://www.largosqltools.com
"dean" <deanbillings@.yahoo.com> wrote in message
news:Xns93B61780A829Bdean918yahoocom@.24.168.128.78...
> I use a software package that queries a Microsoft SQL Server 2000 database
> from a client side Windows application. The client application has a
built
> in report generator that allows users to easily produce complex reports.
> The client application was written in Delphi, and uses Borland's BDE to
> connect to the SQL Server.
> I would like to trap the SQL code that is being produced and sent to the
> SQL Server from the report generator (so that I can get a get a better
> understanding of how to directly query the database outside of the report
> generator).
> Any suggestions on how to do this? Are there any third party products
that
> can provide me with this capability?
> Thanks,
> Dean|||And if you have already looked there and could not find anything but
parameter passing. Get the SPID and find the first calls that define the
procedure.
If it is totally obscure, Net Monitor will show you the text in
any packet sent to your machine.
I think that you should use SQL Profiler so that you have this skill
in your tool bag anyway.
"Largo SQL Tools" <nospam@.yahoo.com> wrote in message
news:unNOnjGSDHA.2676@.TK2MSFTNGP10.phx.gbl...
> Dean,
> You don't need a third party product. Take a look a SQL Profiler that
comes
> with SQL Server. The following article will help you get the most out of
> Profiler
http://www.sql-server-performance.com/sql_server_profiler_tips.asp.
> J.R.
> Largo SQL Tools
> The Finest Collection of SQL Tools Available
> http://www.largosqltools.com
>
> "dean" <deanbillings@.yahoo.com> wrote in message
> news:Xns93B61780A829Bdean918yahoocom@.24.168.128.78...
> > I use a software package that queries a Microsoft SQL Server 2000
database
> > from a client side Windows application. The client application has a
> built
> > in report generator that allows users to easily produce complex reports.
> > The client application was written in Delphi, and uses Borland's BDE to
> > connect to the SQL Server.
> >
> > I would like to trap the SQL code that is being produced and sent to the
> > SQL Server from the report generator (so that I can get a get a better
> > understanding of how to directly query the database outside of the
report
> > generator).
> >
> > Any suggestions on how to do this? Are there any third party products
> that
> > can provide me with this capability?
> >
> > Thanks,
> > Dean
>|||Profiler is definitely your best option. One of the best tools available
and well worth the perceived 'non productive' time spent using/learning it.
"dean" <deanbillings@.yahoo.com> wrote in message
news:Xns93B61780A829Bdean918yahoocom@.24.168.128.78...
> I use a software package that queries a Microsoft SQL Server 2000 database
> from a client side Windows application. The client application has a
built
> in report generator that allows users to easily produce complex reports.
> The client application was written in Delphi, and uses Borland's BDE to
> connect to the SQL Server.
> I would like to trap the SQL code that is being produced and sent to the
> SQL Server from the report generator (so that I can get a get a better
> understanding of how to directly query the database outside of the report
> generator).
> Any suggestions on how to do this? Are there any third party products
that
> can provide me with this capability?
> Thanks,
> Dean

Friday, February 24, 2012

capture showplan in profiler

I want to capture showplan for all the queries running on the server at a
given time. I wanted to know if i run profiler and say give me all those
queries that run for say greater than 5 secs and include the showplan
events, will it give me showplans for all queries or just for those queries
that ran greater than 5 secs which is what I want.
Afraid to turn it on as I know SQL 2000 was not smart enough and just
started spilling all query plans even with the filter.
Also what sql can i run that probably uses DMV to give me all the query
plans for whats currently running on the server i.e. queries that are
currently executing.. which means that every time i run, the results of the
output would be different depending on the query thats active and running at
the time.
ThanksHassan
Somethimg like that
elect
p.*,
q.*,
cp.plan_handle
from
sys.dm_exec_cached_plans cp
cross apply sys.dm_exec_query_plan(cp.plan_handle) p
cross apply sys.dm_exec_sql_text(cp.plan_handle) as q
where
cp.cacheobjtype = 'Compiled Plan'
"Hassan" <hassan@.test.com> wrote in message
news:OAXYOwIJIHA.5684@.TK2MSFTNGP06.phx.gbl...
>I want to capture showplan for all the queries running on the server at a
>given time. I wanted to know if i run profiler and say give me all those
>queries that run for say greater than 5 secs and include the showplan
>events, will it give me showplans for all queries or just for those queries
>that ran greater than 5 secs which is what I want.
> Afraid to turn it on as I know SQL 2000 was not smart enough and just
> started spilling all query plans even with the filter.
> Also what sql can i run that probably uses DMV to give me all the query
> plans for whats currently running on the server i.e. queries that are
> currently executing.. which means that every time i run, the results of
> the output would be different depending on the query thats active and
> running at the time.
> Thanks
>

capture showplan in profiler

I want to capture showplan for all the queries running on the server at a
given time. I wanted to know if i run profiler and say give me all those
queries that run for say greater than 5 secs and include the showplan
events, will it give me showplans for all queries or just for those queries
that ran greater than 5 secs which is what I want.
Afraid to turn it on as I know SQL 2000 was not smart enough and just
started spilling all query plans even with the filter.
Also what sql can i run that probably uses DMV to give me all the query
plans for whats currently running on the server i.e. queries that are
currently executing.. which means that every time i run, the results of the
output would be different depending on the query thats active and running at
the time.
ThanksHassan
Somethimg like that
elect
p.*,
q.*,
cp.plan_handle
from
sys.dm_exec_cached_plans cp
cross apply sys.dm_exec_query_plan(cp.plan_handle) p
cross apply sys.dm_exec_sql_text(cp.plan_handle) as q
where
cp.cacheobjtype = 'Compiled Plan'
"Hassan" <hassan@.test.com> wrote in message
news:OAXYOwIJIHA.5684@.TK2MSFTNGP06.phx.gbl...
>I want to capture showplan for all the queries running on the server at a
>given time. I wanted to know if i run profiler and say give me all those
>queries that run for say greater than 5 secs and include the showplan
>events, will it give me showplans for all queries or just for those queries
>that ran greater than 5 secs which is what I want.
> Afraid to turn it on as I know SQL 2000 was not smart enough and just
> started spilling all query plans even with the filter.
> Also what sql can i run that probably uses DMV to give me all the query
> plans for whats currently running on the server i.e. queries that are
> currently executing.. which means that every time i run, the results of
> the output would be different depending on the query thats active and
> running at the time.
> Thanks
>

capture showplan in profiler

I want to capture showplan for all the queries running on the server at a
given time. I wanted to know if i run profiler and say give me all those
queries that run for say greater than 5 secs and include the showplan
events, will it give me showplans for all queries or just for those queries
that ran greater than 5 secs which is what I want.
Afraid to turn it on as I know SQL 2000 was not smart enough and just
started spilling all query plans even with the filter.
Also what sql can i run that probably uses DMV to give me all the query
plans for whats currently running on the server i.e. queries that are
currently executing.. which means that every time i run, the results of the
output would be different depending on the query thats active and running at
the time.
Thanks
Hassan
Somethimg like that
elect
p.*,
q.*,
cp.plan_handle
from
sys.dm_exec_cached_plans cp
cross apply sys.dm_exec_query_plan(cp.plan_handle) p
cross apply sys.dm_exec_sql_text(cp.plan_handle) as q
where
cp.cacheobjtype = 'Compiled Plan'
"Hassan" <hassan@.test.com> wrote in message
news:OAXYOwIJIHA.5684@.TK2MSFTNGP06.phx.gbl...
>I want to capture showplan for all the queries running on the server at a
>given time. I wanted to know if i run profiler and say give me all those
>queries that run for say greater than 5 secs and include the showplan
>events, will it give me showplans for all queries or just for those queries
>that ran greater than 5 secs which is what I want.
> Afraid to turn it on as I know SQL 2000 was not smart enough and just
> started spilling all query plans even with the filter.
> Also what sql can i run that probably uses DMV to give me all the query
> plans for whats currently running on the server i.e. queries that are
> currently executing.. which means that every time i run, the results of
> the output would be different depending on the query thats active and
> running at the time.
> Thanks
>

Thursday, February 16, 2012

capitalized queries shower?

Hi all,
One of my co-workers claims that a capitalized query like "SELECT foo FROM
bar" would run slower than "select foo from bar." This sounds absurd to me,
and since I can't find any reference that claims his statement is true, I've
decided to ask the community.
Your help is appreciated.
-Oleg.Can you give me the name of that co-worker? I have a bridge to sell ;-)
--
Jacco Schalkwijk
SQL Server MVP
"Oleg Ogurok" <oleg@.ogurok.com.ihatespammers.ireallydo.co> wrote in message
news:10eauif311sp32f@.corp.supernews.com...
> Hi all,
> One of my co-workers claims that a capitalized query like "SELECT foo FROM
> bar" would run slower than "select foo from bar." This sounds absurd to
me,
> and since I can't find any reference that claims his statement is true,
I've
> decided to ask the community.
>
> Your help is appreciated.
> -Oleg.
>|||> One of my co-workers claims that a capitalized query like "SELECT foo FROM
> bar" would run slower than "select foo from bar." This sounds absurd to
me,
I agree 100%. I prefer queries where the keywords are capitalized; much
easier to parse and dissect visually.
--
http://www.aspfaq.com/
(Reverse address to reply.)|||No, that's totally untrue.
But I highly recommend that you take advantage of the situation by making a
very large bet with your co-worker and force this person to prove it
unequivocally in order to win the bet.
"Oleg Ogurok" <oleg@.ogurok.com.ihatespammers.ireallydo.co> wrote in message
news:10eauif311sp32f@.corp.supernews.com...
> Hi all,
> One of my co-workers claims that a capitalized query like "SELECT foo FROM
> bar" would run slower than "select foo from bar." This sounds absurd to
me,
> and since I can't find any reference that claims his statement is true,
I've
> decided to ask the community.
>
> Your help is appreciated.
> -Oleg.
>|||> But I highly recommend that you take advantage of the situation by making
a
> very large bet with your co-worker and force this person to prove it
> unequivocally in order to win the bet.
And hopefully, you've already shut off his NNTP access so he doesn't stumble
upon the common sense brought up here. ;-)|||"Aaron [SQL Server MVP]" <ten.xoc@.dnartreb.noraa> wrote in message
news:e3bbHeEYEHA.2816@.TK2MSFTNGP11.phx.gbl...
> I agree 100%. I prefer queries where the keywords are capitalized; much
> easier to parse and dissect visually.
I will concur on that one... All caps is easier for ME to read, but
certainly not a computer :)|||If you open SQL Profiler, from the tools in enterprise manager, do the 2
types of select in query analyzer, you will see that the duration for the
lowercase select will be lower than the uppercase select.
I would assume that the compiler has to convert the uppercase to lowercase
to compile the code first.
It is only a minimal speed difference, but there is a difference.
Jay Freeman
"Oleg Ogurok" <oleg@.ogurok.com.ihatespammers.ireallydo.co> wrote in message
news:10eauif311sp32f@.corp.supernews.com...
> Hi all,
> One of my co-workers claims that a capitalized query like "SELECT foo FROM
> bar" would run slower than "select foo from bar." This sounds absurd to
me,
> and since I can't find any reference that claims his statement is true,
I've
> decided to ask the community.
>
> Your help is appreciated.
> -Oleg.
>|||"Jay Freeman" <j.freeman@.halcyonsoftware.com> wrote in message
news:%23jEpJvEYEHA.1264@.TK2MSFTNGP11.phx.gbl...
> If you open SQL Profiler, from the tools in enterprise manager, do the 2
> types of select in query analyzer, you will see that the duration for the
> lowercase select will be lower than the uppercase select.
Looks the same to me, using this:
set statistics time off
dbcc dropcleanbuffers
dbcc freeproccache
go
set statistics time on
SELECT * FROM PUBS..AUTHORS
go
set statistics time off
dbcc dropcleanbuffers
dbcc freeproccache
go
set statistics time on
select * from pubs..authors
go
Parse and compile time was 0ms both times.

capitalized queries shower?

Hi all,
One of my co-workers claims that a capitalized query like "SELECT foo FROM
bar" would run slower than "select foo from bar." This sounds absurd to me,
and since I can't find any reference that claims his statement is true, I've
decided to ask the community.
Your help is appreciated.
-Oleg.
Can you give me the name of that co-worker? I have a bridge to sell ;-)
Jacco Schalkwijk
SQL Server MVP
"Oleg Ogurok" <oleg@.ogurok.com.ihatespammers.ireallydo.co> wrote in message
news:10eauif311sp32f@.corp.supernews.com...
> Hi all,
> One of my co-workers claims that a capitalized query like "SELECT foo FROM
> bar" would run slower than "select foo from bar." This sounds absurd to
me,
> and since I can't find any reference that claims his statement is true,
I've
> decided to ask the community.
>
> Your help is appreciated.
> -Oleg.
>
|||> One of my co-workers claims that a capitalized query like "SELECT foo FROM
> bar" would run slower than "select foo from bar." This sounds absurd to
me,
I agree 100%. I prefer queries where the keywords are capitalized; much
easier to parse and dissect visually.
http://www.aspfaq.com/
(Reverse address to reply.)
|||No, that's totally untrue.
But I highly recommend that you take advantage of the situation by making a
very large bet with your co-worker and force this person to prove it
unequivocally in order to win the bet.
"Oleg Ogurok" <oleg@.ogurok.com.ihatespammers.ireallydo.co> wrote in message
news:10eauif311sp32f@.corp.supernews.com...
> Hi all,
> One of my co-workers claims that a capitalized query like "SELECT foo FROM
> bar" would run slower than "select foo from bar." This sounds absurd to
me,
> and since I can't find any reference that claims his statement is true,
I've
> decided to ask the community.
>
> Your help is appreciated.
> -Oleg.
>
|||> But I highly recommend that you take advantage of the situation by making
a
> very large bet with your co-worker and force this person to prove it
> unequivocally in order to win the bet.
And hopefully, you've already shut off his NNTP access so he doesn't stumble
upon the common sense brought up here. ;-)
|||"Aaron [SQL Server MVP]" <ten.xoc@.dnartreb.noraa> wrote in message
news:e3bbHeEYEHA.2816@.TK2MSFTNGP11.phx.gbl...
> I agree 100%. I prefer queries where the keywords are capitalized; much
> easier to parse and dissect visually.
I will concur on that one... All caps is easier for ME to read, but
certainly not a computer
|||If you open SQL Profiler, from the tools in enterprise manager, do the 2
types of select in query analyzer, you will see that the duration for the
lowercase select will be lower than the uppercase select.
I would assume that the compiler has to convert the uppercase to lowercase
to compile the code first.
It is only a minimal speed difference, but there is a difference.
Jay Freeman
"Oleg Ogurok" <oleg@.ogurok.com.ihatespammers.ireallydo.co> wrote in message
news:10eauif311sp32f@.corp.supernews.com...
> Hi all,
> One of my co-workers claims that a capitalized query like "SELECT foo FROM
> bar" would run slower than "select foo from bar." This sounds absurd to
me,
> and since I can't find any reference that claims his statement is true,
I've
> decided to ask the community.
>
> Your help is appreciated.
> -Oleg.
>
|||"Jay Freeman" <j.freeman@.halcyonsoftware.com> wrote in message
news:%23jEpJvEYEHA.1264@.TK2MSFTNGP11.phx.gbl...
> If you open SQL Profiler, from the tools in enterprise manager, do the 2
> types of select in query analyzer, you will see that the duration for the
> lowercase select will be lower than the uppercase select.
Looks the same to me, using this:
set statistics time off
dbcc dropcleanbuffers
dbcc freeproccache
go
set statistics time on
SELECT * FROM PUBS..AUTHORS
go
set statistics time off
dbcc dropcleanbuffers
dbcc freeproccache
go
set statistics time on
select * from pubs..authors
go
Parse and compile time was 0ms both times.

Sunday, February 12, 2012

cant use functions on linked servers??

Hello

I'm having some problems with a couple of linked SQL servers. Basically I can get queries and SPs to work just fine, aklthough there is a little overhead. But I can't get functions to work! Can it really be that linked servers don't support functions? And if so, just out of curiosity, why on earth is it so? Linked servers only handle result sets, not scalar values?

I hope somebody can help me with this
MNJCan you explain "can't get functions to work" in more detail? I've never had it fail, so I'm probably missing something really basic here.

-PatP|||I thought you could never access the SPs and UDFs through a linked server. If you could, I would be interested to know how. Is this syntax valid. Can I execute this from Server 2
linkedserver1.database1.owner1.SP1|||EXECUTE linkedserver.master.dbo.sp_who

Works just fine for me. Does anyone else have trouble with it?

-PatP|||This is working for me:

select * from OPENQUERY ( linkedserver , 'select * from testDB2.dbo.testfunction()' )

but not working:

select * from linkedserver.testDB2.dbo.testfunction()|||Pat,

I get

Server: Msg 7411, Level 16, State 1, Line 1
Server 'QA' is not configured for RPC.|||Well that was easy..

Just go to properties in EM and select that you want to do RPC's

Why would that even be an option...

Wonder what the code is to enable it...|||Originally posted by snail
This is working for me:

select * from OPENQUERY ( linkedserver , 'select * from testDB2.dbo.testfunction()' )

but not working:

select * from linkedserver.testDB2.dbo.testfunction() Can you elaborate just a bit on what constitutes "not working" ?

-PatP|||I think you can't use the next for a function

select * from any_function(params)

Shouldn't this be:

select any_function(params)

Maybe this will solve the problem?|||Welcome Johan!

It depends. If they are using a table valued function, the original syntax would be fine as long as it had at least a two-part name.

-PatP|||Just one question from me ...

though from your post it seems the linked server is to a SQL server ...

is it really to a SQL server or some other db.|||Originally posted by Pat Phelan
Can you elaborate just a bit on what constitutes "not working" ?

-PatP
I got:

Server: Msg 170, Level 15, State 31, Line 1
Line 2: Incorrect syntax near '('.|||Pat: an off-topic question: what's a table valued function?|||Originally posted by jora
Pat: an off-topic question: what's a table valued function? You can think of a table valued function as a view that takes parameters. You can read about them in the CREATE FUNCTION (http://msdn.microsoft.com/library/default.asp?url=/library/en-us/tsqlref/ts_create_7r1l.asp) documentation, or an article at SQL Team (http://www.sqlteam.com/item.asp?ItemID=1955).

-PatP|||Thanks for the input everybody, and sorry I didn't respond until now. I've been looking further into the thing, and has come to the conclusion that my problem is really about linked servers and INSERTS.

I've started a new thread here:
http://www.dbforums.com/showthread.php?p=3673457#post3673457

Thanks
MNJ

Friday, February 10, 2012

Can't uninstall or reinstall nonfunctioning sql server

In previous post in the Getting Started section, I discussed problems trying to run queries on multiple databases:

http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=299240#299240&SiteID=1

Nobody could help with the problem. I eventually got a query to run after several attempts at deleting and recreating databases. Then, I was hit with the following error message:

Class does not support aggregation (or class object is remote) (Exception from HRESULT: 0x80040110 (CLASS_E_NOGGREGATION)) (Microsoft.SqlServer.SqlTools.VSIntegration)

Nobody could help with that either but based on posts with the same message, I tried uninstalling sql server. It wouldn't uninstall nor can I repair or reinstall. Uninstalling thru Add or Remove Programs only resulted in the program listing being removed from Add or Remove Programs. Most of the sql server programs are still installed. They can be run but continue to malfunction. When I try a new installation, I get a message that the programs are already installed.

Is a complete reinstall of windows xp, programs and data the only solution? I hate to believe it; but, at this point, I see no other choice.

If your machine is of x86, please email me so I can forward a script to you to clean those unwanted SQL Server 2005 Components. What you can do is as follows.

1. In Add/Remove Program, remove all visible SQL Server 2005 components.

2. Run command sc, kill all unwanted SQL Server services such as SQL, OLAP, RS, Agent, ...

3. Run command regedit, remove all of those registry keys related to those unwanted SQL Server 2005 components. Of course, this operation is time-consuming and error-prone. That is why the script is created.

4. Reboot your machine and rerun SQL Server 2005 setup.

|||Thanks for the info! I sure it will come in handy in the future. Unfortunately, I've already done a complete reinstall of winxp and sql server. Hopefully, it will run better this time.|||I also had same problem , Could you give me the SQL 2005 uninstall script ? My server is x86, Please sent to jeffery_jean@.msn.com
|||

I'm having a similar problem and would like to get the script please.

-morten

|||I'm trying to cleanly uninstall SQL Server 2003 (I think) and .NET 1.1. Is there a script for this or uninstall series of steps that need be taken? Please advise.|||I also have problem with removing SQL Server2005. Using Add/Remove Programs does not remove all files.Now I have problem with reinstalling SQL - <Workstation components, Books on line and Development Tools> stage fails with the message: 'There is a problem with Windows Installer package . A program run as part of the setup did not finish as expected.'
Can you forward me the script to completely remove all SQL Server files and registry references? There is not also a way to uninstall SQL Express.
My email: jurekba@.optusnet.com.au
It's a pity that Microsoft again did not do its job to deliver working uninstall software for SQL Server 2005.

|||

this is a problem related to the Windows installer MSI database. It believes that the install is part-finished and gets itself a little screwed up. I'd recommend downloading the Windows Installer CleanUp Utility from here http://support.microsoft.com/default.aspx?scid=kb;en-us;290301 and removing the relevant SQL Server database entries.

Following this retry the install, it should go through fine.

|||I also had same problem after using Remote Desktop to install/Uniinstall SQL 2005 , Could you give me the SQL 2005 uninstall script ? My server is x86, Please sent to andy.seymour@.bigroup.co.uk asap please. regards Andy.|||I'm another one that needs the script. I tried using the MS Uninstall cleanup utility but it still didn't work. The SQLServer 2005 install thinks I have several components installed -- most notably the database itself -- and fails when it can't start the database engine. I don wonder why MS couldn't have accounted for this in the original install program. Oh well.
Thanks
rchrismon@.patmedia.net
|||I am running an x86 install that I need to remove can you send me the script to vaparicio@.cpisolutions.com
thx.
|||I also am having the same problem. Please email the script to James@.azmiller.com|||

Hi,

Can you please send me that cleaning script, I'm having the same problem.

thanks

Bob

|||I have same problem at hand, Could you kindly give me the SQL 2005 uninstall script ? My server is x86, Win XP SP2 Please send to tmp74in at yahoo.com
|||I think microsoft should supply this, since so many people need it! Could you send it to me too? I've tried all of the above and it still won't install.

Can't uninstall or reinstall nonfunctioning sql server

In previous post in the Getting Started section, I discussed problems trying to run queries on multiple databases:

http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=299240#299240&SiteID=1

Nobody could help with the problem. I eventually got a query to run after several attempts at deleting and recreating databases. Then, I was hit with the following error message:

Class does not support aggregation (or class object is remote) (Exception from HRESULT: 0x80040110 (CLASS_E_NOGGREGATION)) (Microsoft.SqlServer.SqlTools.VSIntegration)

Nobody could help with that either but based on posts with the same message, I tried uninstalling sql server. It wouldn't uninstall nor can I repair or reinstall. Uninstalling thru Add or Remove Programs only resulted in the program listing being removed from Add or Remove Programs. Most of the sql server programs are still installed. They can be run but continue to malfunction. When I try a new installation, I get a message that the programs are already installed.

Is a complete reinstall of windows xp, programs and data the only solution? I hate to believe it; but, at this point, I see no other choice.

If your machine is of x86, please email me so I can forward a script to you to clean those unwanted SQL Server 2005 Components. What you can do is as follows.

1. In Add/Remove Program, remove all visible SQL Server 2005 components.

2. Run command sc, kill all unwanted SQL Server services such as SQL, OLAP, RS, Agent, ...

3. Run command regedit, remove all of those registry keys related to those unwanted SQL Server 2005 components. Of course, this operation is time-consuming and error-prone. That is why the script is created.

4. Reboot your machine and rerun SQL Server 2005 setup.

|||Thanks for the info! I sure it will come in handy in the future. Unfortunately, I've already done a complete reinstall of winxp and sql server. Hopefully, it will run better this time.|||I also had same problem , Could you give me the SQL 2005 uninstall script ? My server is x86, Please sent to jeffery_jean@.msn.com
|||

I'm having a similar problem and would like to get the script please.

-morten

|||I'm trying to cleanly uninstall SQL Server 2003 (I think) and .NET 1.1. Is there a script for this or uninstall series of steps that need be taken? Please advise.|||I also have problem with removing SQL Server2005. Using Add/Remove Programs does not remove all files.Now I have problem with reinstalling SQL - <Workstation components, Books on line and Development Tools> stage fails with the message: 'There is a problem with Windows Installer package . A program run as part of the setup did not finish as expected.'
Can you forward me the script to completely remove all SQL Server files and registry references? There is not also a way to uninstall SQL Express.
My email: jurekba@.optusnet.com.au
It's a pity that Microsoft again did not do its job to deliver working uninstall software for SQL Server 2005.

|||

this is a problem related to the Windows installer MSI database. It believes that the install is part-finished and gets itself a little screwed up. I'd recommend downloading the Windows Installer CleanUp Utility from here http://support.microsoft.com/default.aspx?scid=kb;en-us;290301 and removing the relevant SQL Server database entries.

Following this retry the install, it should go through fine.

|||I also had same problem after using Remote Desktop to install/Uniinstall SQL 2005 , Could you give me the SQL 2005 uninstall script ? My server is x86, Please sent to andy.seymour@.bigroup.co.uk asap please. regards Andy.|||I'm another one that needs the script. I tried using the MS Uninstall cleanup utility but it still didn't work. The SQLServer 2005 install thinks I have several components installed -- most notably the database itself -- and fails when it can't start the database engine. I don wonder why MS couldn't have accounted for this in the original install program. Oh well.
Thanks
rchrismon@.patmedia.net
|||I am running an x86 install that I need to remove can you send me the script to vaparicio@.cpisolutions.com
thx.
|||I also am having the same problem. Please email the script to James@.azmiller.com|||

Hi,

Can you please send me that cleaning script, I'm having the same problem.

thanks

Bob

|||I have same problem at hand, Could you kindly give me the SQL 2005 uninstall script ? My server is x86, Win XP SP2 Please send to tmp74in at yahoo.com
|||I think microsoft should supply this, since so many people need it! Could you send it to me too? I've tried all of the above and it still won't install.

Can't uninstall or reinstall nonfunctioning sql server

In previous post in the Getting Started section, I discussed problems trying to run queries on multiple databases:

http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=299240#299240&SiteID=1

Nobody could help with the problem. I eventually got a query to run after several attempts at deleting and recreating databases. Then, I was hit with the following error message:

Class does not support aggregation (or class object is remote) (Exception from HRESULT: 0x80040110 (CLASS_E_NOGGREGATION)) (Microsoft.SqlServer.SqlTools.VSIntegration)

Nobody could help with that either but based on posts with the same message, I tried uninstalling sql server. It wouldn't uninstall nor can I repair or reinstall. Uninstalling thru Add or Remove Programs only resulted in the program listing being removed from Add or Remove Programs. Most of the sql server programs are still installed. They can be run but continue to malfunction. When I try a new installation, I get a message that the programs are already installed.

Is a complete reinstall of windows xp, programs and data the only solution? I hate to believe it; but, at this point, I see no other choice.

If your machine is of x86, please email me so I can forward a script to you to clean those unwanted SQL Server 2005 Components. What you can do is as follows.

1. In Add/Remove Program, remove all visible SQL Server 2005 components.

2. Run command sc, kill all unwanted SQL Server services such as SQL, OLAP, RS, Agent, ...

3. Run command regedit, remove all of those registry keys related to those unwanted SQL Server 2005 components. Of course, this operation is time-consuming and error-prone. That is why the script is created.

4. Reboot your machine and rerun SQL Server 2005 setup.

|||Thanks for the info! I sure it will come in handy in the future. Unfortunately, I've already done a complete reinstall of winxp and sql server. Hopefully, it will run better this time.|||I also had same problem , Could you give me the SQL 2005 uninstall script ? My server is x86, Please sent to jeffery_jean@.msn.com|||

I'm having a similar problem and would like to get the script please.

-morten

|||I'm trying to cleanly uninstall SQL Server 2003 (I think) and .NET 1.1. Is there a script for this or uninstall series of steps that need be taken? Please advise.|||I also have problem with removing SQL Server2005. Using Add/Remove Programs does not remove all files.Now I have problem with reinstalling SQL - <Workstation components, Books on line and Development Tools> stage fails with the message: 'There is a problem with Windows Installer package . A program run as part of the setup did not finish as expected.'
Can you forward me the script to completely remove all SQL Server files and registry references? There is not also a way to uninstall SQL Express.
My email: jurekba@.optusnet.com.au
It's a pity that Microsoft again did not do its job to deliver working uninstall software for SQL Server 2005.|||

this is a problem related to the Windows installer MSI database. It believes that the install is part-finished and gets itself a little screwed up. I'd recommend downloading the Windows Installer CleanUp Utility from here http://support.microsoft.com/default.aspx?scid=kb;en-us;290301 and removing the relevant SQL Server database entries.

Following this retry the install, it should go through fine.

|||I also had same problem after using Remote Desktop to install/Uniinstall SQL 2005 , Could you give me the SQL 2005 uninstall script ? My server is x86, Please sent to andy.seymour@.bigroup.co.uk asap please. regards Andy.|||I'm another one that needs the script. I tried using the MS Uninstall cleanup utility but it still didn't work. The SQLServer 2005 install thinks I have several components installed -- most notably the database itself -- and fails when it can't start the database engine. I don wonder why MS couldn't have accounted for this in the original install program. Oh well.
Thanks
rchrismon@.patmedia.net|||I am running an x86 install that I need to remove can you send me the script to vaparicio@.cpisolutions.com
thx.|||I also am having the same problem. Please email the script to James@.azmiller.com|||

Hi,

Can you please send me that cleaning script, I'm having the same problem.

thanks

Bob

|||I have same problem at hand, Could you kindly give me the SQL 2005 uninstall script ? My server is x86, Win XP SP2 Please send to tmp74in at yahoo.com
|||I think microsoft should supply this, since so many people need it! Could you send it to me too? I've tried all of the above and it still won't install.

Can't uninstall or reinstall nonfunctioning sql server

In previous post in the Getting Started section, I discussed problems trying to run queries on multiple databases:

http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=299240#299240&SiteID=1

Nobody could help with the problem. I eventually got a query to run after several attempts at deleting and recreating databases. Then, I was hit with the following error message:

Class does not support aggregation (or class object is remote) (Exception from HRESULT: 0x80040110 (CLASS_E_NOGGREGATION)) (Microsoft.SqlServer.SqlTools.VSIntegration)

Nobody could help with that either but based on posts with the same message, I tried uninstalling sql server. It wouldn't uninstall nor can I repair or reinstall. Uninstalling thru Add or Remove Programs only resulted in the program listing being removed from Add or Remove Programs. Most of the sql server programs are still installed. They can be run but continue to malfunction. When I try a new installation, I get a message that the programs are already installed.

Is a complete reinstall of windows xp, programs and data the only solution? I hate to believe it; but, at this point, I see no other choice.

If your machine is of x86, please email me so I can forward a script to you to clean those unwanted SQL Server 2005 Components. What you can do is as follows.

1. In Add/Remove Program, remove all visible SQL Server 2005 components.

2. Run command sc, kill all unwanted SQL Server services such as SQL, OLAP, RS, Agent, ...

3. Run command regedit, remove all of those registry keys related to those unwanted SQL Server 2005 components. Of course, this operation is time-consuming and error-prone. That is why the script is created.

4. Reboot your machine and rerun SQL Server 2005 setup.

|||Thanks for the info! I sure it will come in handy in the future. Unfortunately, I've already done a complete reinstall of winxp and sql server. Hopefully, it will run better this time.|||I also had same problem , Could you give me the SQL 2005 uninstall script ? My server is x86, Please sent to jeffery_jean@.msn.com|||

I'm having a similar problem and would like to get the script please.

-morten

|||I'm trying to cleanly uninstall SQL Server 2003 (I think) and .NET 1.1. Is there a script for this or uninstall series of steps that need be taken? Please advise.|||I also have problem with removing SQL Server2005. Using Add/Remove Programs does not remove all files.Now I have problem with reinstalling SQL - <Workstation components, Books on line and Development Tools> stage fails with the message: 'There is a problem with Windows Installer package . A program run as part of the setup did not finish as expected.'
Can you forward me the script to completely remove all SQL Server files and registry references? There is not also a way to uninstall SQL Express.
My email: jurekba@.optusnet.com.au
It's a pity that Microsoft again did not do its job to deliver working uninstall software for SQL Server 2005.|||

this is a problem related to the Windows installer MSI database. It believes that the install is part-finished and gets itself a little screwed up. I'd recommend downloading the Windows Installer CleanUp Utility from here http://support.microsoft.com/default.aspx?scid=kb;en-us;290301 and removing the relevant SQL Server database entries.

Following this retry the install, it should go through fine.

|||I also had same problem after using Remote Desktop to install/Uniinstall SQL 2005 , Could you give me the SQL 2005 uninstall script ? My server is x86, Please sent to andy.seymour@.bigroup.co.uk asap please. regards Andy.|||I'm another one that needs the script. I tried using the MS Uninstall cleanup utility but it still didn't work. The SQLServer 2005 install thinks I have several components installed -- most notably the database itself -- and fails when it can't start the database engine. I don wonder why MS couldn't have accounted for this in the original install program. Oh well.
Thanks
rchrismon@.patmedia.net|||I am running an x86 install that I need to remove can you send me the script to vaparicio@.cpisolutions.com
thx.|||I also am having the same problem. Please email the script to James@.azmiller.com|||

Hi,

Can you please send me that cleaning script, I'm having the same problem.

thanks

Bob

|||I have same problem at hand, Could you kindly give me the SQL 2005 uninstall script ? My server is x86, Win XP SP2 Please send to tmp74in at yahoo.com
|||I think microsoft should supply this, since so many people need it! Could you send it to me too? I've tried all of the above and it still won't install.

Can't uninstall or reinstall nonfunctioning sql server

In previous post in the Getting Started section, I discussed problems trying to run queries on multiple databases:

http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=299240#299240&SiteID=1

Nobody could help with the problem. I eventually got a query to run after several attempts at deleting and recreating databases. Then, I was hit with the following error message:

Class does not support aggregation (or class object is remote) (Exception from HRESULT: 0x80040110 (CLASS_E_NOGGREGATION)) (Microsoft.SqlServer.SqlTools.VSIntegration)

Nobody could help with that either but based on posts with the same message, I tried uninstalling sql server. It wouldn't uninstall nor can I repair or reinstall. Uninstalling thru Add or Remove Programs only resulted in the program listing being removed from Add or Remove Programs. Most of the sql server programs are still installed. They can be run but continue to malfunction. When I try a new installation, I get a message that the programs are already installed.

Is a complete reinstall of windows xp, programs and data the only solution? I hate to believe it; but, at this point, I see no other choice.

If your machine is of x86, please email me so I can forward a script to you to clean those unwanted SQL Server 2005 Components. What you can do is as follows.

1. In Add/Remove Program, remove all visible SQL Server 2005 components.

2. Run command sc, kill all unwanted SQL Server services such as SQL, OLAP, RS, Agent, ...

3. Run command regedit, remove all of those registry keys related to those unwanted SQL Server 2005 components. Of course, this operation is time-consuming and error-prone. That is why the script is created.

4. Reboot your machine and rerun SQL Server 2005 setup.

|||Thanks for the info! I sure it will come in handy in the future. Unfortunately, I've already done a complete reinstall of winxp and sql server. Hopefully, it will run better this time.|||I also had same problem , Could you give me the SQL 2005 uninstall script ? My server is x86, Please sent to jeffery_jean@.msn.com|||

I'm having a similar problem and would like to get the script please.

-morten

|||I'm trying to cleanly uninstall SQL Server 2003 (I think) and .NET 1.1. Is there a script for this or uninstall series of steps that need be taken? Please advise.|||I also have problem with removing SQL Server2005. Using Add/Remove Programs does not remove all files.Now I have problem with reinstalling SQL - <Workstation components, Books on line and Development Tools> stage fails with the message: 'There is a problem with Windows Installer package . A program run as part of the setup did not finish as expected.'
Can you forward me the script to completely remove all SQL Server files and registry references? There is not also a way to uninstall SQL Express.
My email: jurekba@.optusnet.com.au
It's a pity that Microsoft again did not do its job to deliver working uninstall software for SQL Server 2005.|||

this is a problem related to the Windows installer MSI database. It believes that the install is part-finished and gets itself a little screwed up. I'd recommend downloading the Windows Installer CleanUp Utility from here http://support.microsoft.com/default.aspx?scid=kb;en-us;290301 and removing the relevant SQL Server database entries.

Following this retry the install, it should go through fine.

|||I also had same problem after using Remote Desktop to install/Uniinstall SQL 2005 , Could you give me the SQL 2005 uninstall script ? My server is x86, Please sent to andy.seymour@.bigroup.co.uk asap please. regards Andy.|||I'm another one that needs the script. I tried using the MS Uninstall cleanup utility but it still didn't work. The SQLServer 2005 install thinks I have several components installed -- most notably the database itself -- and fails when it can't start the database engine. I don wonder why MS couldn't have accounted for this in the original install program. Oh well.
Thanks
rchrismon@.patmedia.net|||I am running an x86 install that I need to remove can you send me the script to vaparicio@.cpisolutions.com
thx.|||I also am having the same problem. Please email the script to James@.azmiller.com|||

Hi,

Can you please send me that cleaning script, I'm having the same problem.

thanks

Bob

|||I have same problem at hand, Could you kindly give me the SQL 2005 uninstall script ? My server is x86, Win XP SP2 Please send to tmp74in at yahoo.com
|||I think microsoft should supply this, since so many people need it! Could you send it to me too? I've tried all of the above and it still won't install.