Friday, March 30, 2012
Is it possible to recover from failed sp4 installation?
I have a client who last night attempted to install sql 2000 Enterprise
Edition SP4. When running the first time through it got past the Password
Validation and moved to the Analysing and Preparing stage of the
installation. At this point it completely hung - after an hour there was
still no activity.
Now when attempting to re-install SP3a it states that a later version is
already installed and when attempting to reinstall SP4 it hangs on password
validation everytime.
This is a production server, does anyone know if it is possible to recover
from the above scenario?
Thanks
LarryJosh
I have been istalling SP4 mamy times and have never got the situation. Hmmm,
try tirn off (from the network) the server and re-install SP4
"Josh Lawrence" <someone@.microsoft.com> wrote in message
news:%23DgeHurtGHA.4544@.TK2MSFTNGP04.phx.gbl...
> Hi All,
> I have a client who last night attempted to install sql 2000 Enterprise
> Edition SP4. When running the first time through it got past the Password
> Validation and moved to the Analysing and Preparing stage of the
> installation. At this point it completely hung - after an hour there was
> still no activity.
> Now when attempting to re-install SP3a it states that a later version is
> already installed and when attempting to reinstall SP4 it hangs on
> password validation everytime.
> This is a production server, does anyone know if it is possible to recover
> from the above scenario?
> Thanks
> Larry
>|||I have experienced this issue previously but can't recall the solution. I
have the awful feeling it may require a complete reinstallation of SQL2000
from the ground up.
Thanks
Josh
"Uri Dimant" <urid@.iscar.co.il> wrote in message
news:OryZZ2rtGHA.4752@.TK2MSFTNGP02.phx.gbl...
> Josh
> I have been istalling SP4 mamy times and have never got the situation.
> Hmmm, try tirn off (from the network) the server and re-install SP4
>
>
> "Josh Lawrence" <someone@.microsoft.com> wrote in message
> news:%23DgeHurtGHA.4544@.TK2MSFTNGP04.phx.gbl...
>|||Hi --
I have run into the exact same issue, where SP4 installation hangs on
password validation. It worked for me on number of other servers but it
doesn't work on this server.
I have tried using Windows and SQL Server authentication, sa without
password but it didn't make any difference.
Did anyone find a solution?
The funny thing is that @.@.version shows SP4, however it is Not SP4.
Thanks
Gurpreet
"Josh Lawrence" wrote:
> I have experienced this issue previously but can't recall the solution. I
> have the awful feeling it may require a complete reinstallation of SQL2000
> from the ground up.
> Thanks
> Josh
>
> "Uri Dimant" <urid@.iscar.co.il> wrote in message
> news:OryZZ2rtGHA.4752@.TK2MSFTNGP02.phx.gbl...
>
>
Is it possible to recover from failed sp4 installation?
I have a client who last night attempted to install sql 2000 Enterprise
Edition SP4. When running the first time through it got past the Password
Validation and moved to the Analysing and Preparing stage of the
installation. At this point it completely hung - after an hour there was
still no activity.
Now when attempting to re-install SP3a it states that a later version is
already installed and when attempting to reinstall SP4 it hangs on password
validation everytime.
This is a production server, does anyone know if it is possible to recover
from the above scenario?
Thanks
LarryJosh
I have been istalling SP4 mamy times and have never got the situation. Hmmm,
try tirn off (from the network) the server and re-install SP4
"Josh Lawrence" <someone@.microsoft.com> wrote in message
news:%23DgeHurtGHA.4544@.TK2MSFTNGP04.phx.gbl...
> Hi All,
> I have a client who last night attempted to install sql 2000 Enterprise
> Edition SP4. When running the first time through it got past the Password
> Validation and moved to the Analysing and Preparing stage of the
> installation. At this point it completely hung - after an hour there was
> still no activity.
> Now when attempting to re-install SP3a it states that a later version is
> already installed and when attempting to reinstall SP4 it hangs on
> password validation everytime.
> This is a production server, does anyone know if it is possible to recover
> from the above scenario?
> Thanks
> Larry
>|||I have experienced this issue previously but can't recall the solution. I
have the awful feeling it may require a complete reinstallation of SQL2000
from the ground up.
Thanks
Josh
"Uri Dimant" <urid@.iscar.co.il> wrote in message
news:OryZZ2rtGHA.4752@.TK2MSFTNGP02.phx.gbl...
> Josh
> I have been istalling SP4 mamy times and have never got the situation.
> Hmmm, try tirn off (from the network) the server and re-install SP4
>
>
> "Josh Lawrence" <someone@.microsoft.com> wrote in message
> news:%23DgeHurtGHA.4544@.TK2MSFTNGP04.phx.gbl...
>> Hi All,
>> I have a client who last night attempted to install sql 2000 Enterprise
>> Edition SP4. When running the first time through it got past the
>> Password Validation and moved to the Analysing and Preparing stage of the
>> installation. At this point it completely hung - after an hour there was
>> still no activity.
>> Now when attempting to re-install SP3a it states that a later version is
>> already installed and when attempting to reinstall SP4 it hangs on
>> password validation everytime.
>> This is a production server, does anyone know if it is possible to
>> recover from the above scenario?
>> Thanks
>> Larry
>|||Hi --
I have run into the exact same issue, where SP4 installation hangs on
password validation. It worked for me on number of other servers but it
doesn't work on this server.
I have tried using Windows and SQL Server authentication, sa without
password but it didn't make any difference.
Did anyone find a solution?
The funny thing is that @.@.version shows SP4, however it is Not SP4.
Thanks
Gurpreet
"Josh Lawrence" wrote:
> I have experienced this issue previously but can't recall the solution. I
> have the awful feeling it may require a complete reinstallation of SQL2000
> from the ground up.
> Thanks
> Josh
>
> "Uri Dimant" <urid@.iscar.co.il> wrote in message
> news:OryZZ2rtGHA.4752@.TK2MSFTNGP02.phx.gbl...
> > Josh
> > I have been istalling SP4 mamy times and have never got the situation.
> > Hmmm, try tirn off (from the network) the server and re-install SP4
> >
> >
> >
> >
> >
> > "Josh Lawrence" <someone@.microsoft.com> wrote in message
> > news:%23DgeHurtGHA.4544@.TK2MSFTNGP04.phx.gbl...
> >> Hi All,
> >> I have a client who last night attempted to install sql 2000 Enterprise
> >> Edition SP4. When running the first time through it got past the
> >> Password Validation and moved to the Analysing and Preparing stage of the
> >> installation. At this point it completely hung - after an hour there was
> >> still no activity.
> >>
> >> Now when attempting to re-install SP3a it states that a later version is
> >> already installed and when attempting to reinstall SP4 it hangs on
> >> password validation everytime.
> >>
> >> This is a production server, does anyone know if it is possible to
> >> recover from the above scenario?
> >>
> >> Thanks
> >> Larry
> >>
> >
> >
>
>sql
Is it possible to recover a dropped table?
Accidentally I have dropped a table and that is the main table for my application.
I dont have a backup of it. Is there any way to recover it.Please help me guys.
Thanks,
Kumar.With no backups you have to hope the data is recoverable from the transaction logs with a tool likewww.lumigent.com offers, but even this does not offer 100% certainty of recovering the table.
is it possible to recieve result of SQL stored procedure to web page?
for (int i=0; i<dataset.Tables.Count; i++) {
Response.Write(dataset.Tables[i].TableName);
Response.Write("\n");
// loop rows
for (int j=0; j<dataset.Tables[i].Rows.Count; j++) {
// loop columns
for (int k=0; k<dataset.Tables[i].Columns.Count; k++) {
Response.Write(dataset.Tables[i].Rows[j][k].ToString());
if (k < dataset.Tables[i].Columns.Count - 1) {
Response.Write(", ");
}
}
Response.Write("\n");
}
Response.Write("\n");
}
this isn't exactly what you want, but idea.|||If the procedure returns a fixed number of result sets, you can return the results a datareader and then bind each result set to something like a datagrid or a repeater using .nextresult between bindings. A datareader can hold more than one result set. It can be pretty handy.
Is it possible to recieve a notification when a subscription fails?
Status of this memo
This document is an Internet-Draft. Internet-Drafts are working documents of the Internet Engineering Task Force (IETF), its areas, and its working groups. Note that other groups may also distribute working documents as Internet-Drafts.
Internet-Drafts are draft documents valid for a maximum of six months and may be updated, replaced, or made obsolete by other documents at any time.It is inappropriate to use Internet-Drafts as reference material or to cite them other than as "work in progress".
To learn the current status of any Internet-Draft, please check the "1id-abstracts.txt" listing contained in the Internet-Drafts Shadow Directories on ftp.is.co.za (Africa), nic.nordu.net (Europe), munnari.oz.au (Pacific Rim), ftp.ietf.org (US East Coast), or ftp.isi.edu (US West Coast).
Distribution of this document is unlimited. Please send comments to theHTTP working group at
Abstract
This specification defines an HTTP notification architecture that transmits notifications between HTTP resources. An HTTP resource could be any object which might need to send or receive a notification, for example a distribution list, buddy list, print job, etc.
is it possible to re-build index without logging?
i have a vendor application on one of my sql servers.
this application has many tables, and each tables have many indexes. it's
very write intensive (because when a record is inserted, it's insereted to
many many other tables, and that behavior can't be changed). the problem is
page split happened often, but when i tried to reindex tables once a week,
the log file run out of space.
can anyone offers some good solutions to my problem?
thank you!!
Steve
You can try changing the recovery mode to Bulk Logged or Simple and see if
that helps. Do only a few tables at a time and backup the log in between.
Andrew J. Kelly SQL MVP
"Steve Lin" <lins@.nospam.portptld.com> wrote in message
news:#otAPXEGEHA.3288@.TK2MSFTNGP12.phx.gbl...
> nt5, sql2k
>
> i have a vendor application on one of my sql servers.
> this application has many tables, and each tables have many indexes. it's
> very write intensive (because when a record is inserted, it's insereted to
> many many other tables, and that behavior can't be changed). the problem
is
> page split happened often, but when i tried to reindex tables once a week,
> the log file run out of space.
>
> can anyone offers some good solutions to my problem?
> thank you!!
>
> Steve
>
|||as i said, the database is write intensive. so simple recovery mode might be
too risky. is there a way to run a scheduled re-index job as a non-logged
operation?
thank you so much for the help.
steve
"Andrew J. Kelly" <sqlmvpnoooospam@.shadhawk.com> wrote in message
news:ujUS9aFGEHA.2876@.TK2MSFTNGP09.phx.gbl...
> You can try changing the recovery mode to Bulk Logged or Simple and see if
> that helps. Do only a few tables at a time and backup the log in between.
>
> --
> Andrew J. Kelly SQL MVP
>
> "Steve Lin" <lins@.nospam.portptld.com> wrote in message
> news:#otAPXEGEHA.3288@.TK2MSFTNGP12.phx.gbl...
it's
to
> is
week,
>
|||Checkout DBCC INDEXDEFRAG, which does online defragmentation. You can look
in BOL for details. There's also an excellent whitepaper at
http://www.microsoft.com/technet/pro.../ss2kidbp.mspx
which will give you a bunch of details, hints, and explanations - including
working out whether you even need to bother getting rid of fragmentation,
based on your workload.
Regards.
Paul Randal
Dev Lead, Microsoft SQL Server Storage Engine
This posting is provided "AS IS" with no warranties, and confers no rights.
"Steve Lin" <lins@.nospam.portptld.com> wrote in message
news:eDkxfqPGEHA.3324@.TK2MSFTNGP09.phx.gbl...
> as i said, the database is write intensive. so simple recovery mode might
be
> too risky. is there a way to run a scheduled re-index job as a non-logged
> operation?
> thank you so much for the help.
> steve
> "Andrew J. Kelly" <sqlmvpnoooospam@.shadhawk.com> wrote in message
> news:ujUS9aFGEHA.2876@.TK2MSFTNGP09.phx.gbl...
if
between.
> it's
insereted
> to
problem
> week,
>
is it possible to re-build index without logging?
i have a vendor application on one of my sql servers.
this application has many tables, and each tables have many indexes. it's
very write intensive (because when a record is inserted, it's insereted to
many many other tables, and that behavior can't be changed). the problem is
page split happened often, but when i tried to reindex tables once a week,
the log file run out of space.
can anyone offers some good solutions to my problem?
thank you!!
SteveYou can try changing the recovery mode to Bulk Logged or Simple and see if
that helps. Do only a few tables at a time and backup the log in between.
Andrew J. Kelly SQL MVP
"Steve Lin" <lins@.nospam.portptld.com> wrote in message
news:#otAPXEGEHA.3288@.TK2MSFTNGP12.phx.gbl...
> nt5, sql2k
>
> i have a vendor application on one of my sql servers.
> this application has many tables, and each tables have many indexes. it's
> very write intensive (because when a record is inserted, it's insereted to
> many many other tables, and that behavior can't be changed). the problem
is
> page split happened often, but when i tried to reindex tables once a week,
> the log file run out of space.
>
> can anyone offers some good solutions to my problem?
> thank you!!
>
> Steve
>|||as i said, the database is write intensive. so simple recovery mode might be
too risky. is there a way to run a scheduled re-index job as a non-logged
operation?
thank you so much for the help.
steve
"Andrew J. Kelly" <sqlmvpnoooospam@.shadhawk.com> wrote in message
news:ujUS9aFGEHA.2876@.TK2MSFTNGP09.phx.gbl...
> You can try changing the recovery mode to Bulk Logged or Simple and see if
> that helps. Do only a few tables at a time and backup the log in between.
>
> --
> Andrew J. Kelly SQL MVP
>
> "Steve Lin" <lins@.nospam.portptld.com> wrote in message
> news:#otAPXEGEHA.3288@.TK2MSFTNGP12.phx.gbl...
it's
to
> is
week,
>|||Checkout DBCC INDEXDEFRAG, which does online defragmentation. You can look
in BOL for details. There's also an excellent whitepaper at
http://www.microsoft.com/technet/pr...n/ss2kidbp.mspx
which will give you a bunch of details, hints, and explanations - including
working out whether you even need to bother getting rid of fragmentation,
based on your workload.
Regards.
Paul Randal
Dev Lead, Microsoft SQL Server Storage Engine
This posting is provided "AS IS" with no warranties, and confers no rights.
"Steve Lin" <lins@.nospam.portptld.com> wrote in message
news:eDkxfqPGEHA.3324@.TK2MSFTNGP09.phx.gbl...
> as i said, the database is write intensive. so simple recovery mode might
be
> too risky. is there a way to run a scheduled re-index job as a non-logged
> operation?
> thank you so much for the help.
> steve
> "Andrew J. Kelly" <sqlmvpnoooospam@.shadhawk.com> wrote in message
> news:ujUS9aFGEHA.2876@.TK2MSFTNGP09.phx.gbl...
if
between.
> it's
insereted
> to
problem
> week,
>sql
Is it possible to read/write a file at privilege?
I saw some systems which were hacked by sql injection tool
And some files of the systems were changed. I guess the tool tried to
read/write files.
howerver, the user privilege is not 'sa'. Is it possible for user who
is not 'sa' to read/write files?
If it is possible, how can I prevent the tools from reading/writing
files even if my web page is injectable?dodol (Dolka1@.gmail.com) writes:
> I saw some systems which were hacked by sql injection tool
> And some files of the systems were changed. I guess the tool tried to
> read/write files.
> howerver, the user privilege is not 'sa'. Is it possible for user who
> is not 'sa' to read/write files?
It could be another user with sysadmin rights. Or execution rights might
have been granted on xp_cmdshell or sp_OAxxx.
> If it is possible, how can I prevent the tools from reading/writing
> files even if my web page is injectable?
Make sure that xp_cmdshell and the sp_OAxxx procedures are disabled.
Make sure that SQL Server runs on a domain account that has no extra
privileges. The less welcome it is in the rest of the network the better.
But the main line of defence is of course to use stored procedure or
parameterised statements and never interpolate incoming stuff into
query strings.
Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se
Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/pr...oads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodin...ions/books.mspx
Is it possible to read Flat File data from a Variable?
Hi,
I'm relatively new to SSIS and I've been tinkering with the XML and Flat File sources.
I noticed that in the XML source it is possible to tell SSIS to read the XML data from a variable. I didn't see a similar option for the Flat File source.
Does anyone know if it is possible to read flat file data from a variable when using the Flat File source?
Thanks,
-dhideal
Simple answer is no. I'd question why you want to do this though as any volume of data in a variable will not perform well.
A Script component could act as a source though and output rows and columns. A Script Task could also be used to write the variable data to a file, and then just use the normal source.
|||Darren,
Thanks for the quick response.
I realize that performance wont be the best but I was wondering more from the point of view of taking XML data that has been transformed using XSL and feeding that straight into a table.
I realize that I was going down the wrong path as I should not have the XSL convert to a flat file format but keep the data in XML format and then use the XML Source's read from variable capability.
Keeping the data in a variable is going to eat lots of RAM but hopefully avoiding the write/read to disk will give a significant enough performance gain to justify it.
Thanks,
-dhideal
|||The disk cost may be less than the cost or marshalling data in memory.
I have seen similar situations where it has been cheaper to stage data through files, because that way you can use the pipeline which ideally only works on a buffer full of data at one time (not quite true, but the point is there). Therefore you don't have the pain or finding a lot of memory, you just work in piecmeal sections.
In summary the cost of writing and reading to and from a file can be far outweighed by the overhead of finding a lot of memory in one go. This does of course depend on hardware and data volumes, but you may want to try both methods.
|||Its also worth saying that raw files can be screamingly fast. I've just constructed a quick and dirty demo where a raw file containing 10000000 records of width 270 bytes (nearly 3GB of data) was read from disk and pushed into a rowcount component in 68seconds. That's fast. When I pushed the same data into another raw file (i.e. writing to disk) it took 175seconds. Again very impressive, all the more so considering the files were on the same physical disk.
Definately worth a look.
-Jamie
|||
Jamie/Darren,
Thanks for the advice. I will definitely try out both options but I believe staying in memory might be better for me because the XML files I'm working with aren't huge but there are just a lot of them.
-dhideal
Is it possible to read Flat File data from a Variable?
Hi,
I'm relatively new to SSIS and I've been tinkering with the XML and Flat File sources.
I noticed that in the XML source it is possible to tell SSIS to read the XML data from a variable. I didn't see a similar option for the Flat File source.
Does anyone know if it is possible to read flat file data from a variable when using the Flat File source?
Thanks,
-dhideal
Simple answer is no. I'd question why you want to do this though as any volume of data in a variable will not perform well.
A Script component could act as a source though and output rows and columns. A Script Task could also be used to write the variable data to a file, and then just use the normal source.
|||Darren,
Thanks for the quick response.
I realize that performance wont be the best but I was wondering more from the point of view of taking XML data that has been transformed using XSL and feeding that straight into a table.
I realize that I was going down the wrong path as I should not have the XSL convert to a flat file format but keep the data in XML format and then use the XML Source's read from variable capability.
Keeping the data in a variable is going to eat lots of RAM but hopefully avoiding the write/read to disk will give a significant enough performance gain to justify it.
Thanks,
-dhideal
|||The disk cost may be less than the cost or marshalling data in memory.
I have seen similar situations where it has been cheaper to stage data through files, because that way you can use the pipeline which ideally only works on a buffer full of data at one time (not quite true, but the point is there). Therefore you don't have the pain or finding a lot of memory, you just work in piecmeal sections.
In summary the cost of writing and reading to and from a file can be far outweighed by the overhead of finding a lot of memory in one go. This does of course depend on hardware and data volumes, but you may want to try both methods.
|||Its also worth saying that raw files can be screamingly fast. I've just constructed a quick and dirty demo where a raw file containing 10000000 records of width 270 bytes (nearly 3GB of data) was read from disk and pushed into a rowcount component in 68seconds. That's fast. When I pushed the same data into another raw file (i.e. writing to disk) it took 175seconds. Again very impressive, all the more so considering the files were on the same physical disk.
Definately worth a look.
-Jamie
|||
Jamie/Darren,
Thanks for the advice. I will definitely try out both options but I believe staying in memory might be better for me because the XML files I'm working with aren't huge but there are just a lot of them.
-dhideal
Is it possible to read data from a table with exclusive lock ?
Hello,
We currently use SQL Serv 2000 with an ERP application and VB applications.
Both system work with the same database & tables but the ERP application seems to put exclusive lock on all tables it needs during processes. So our VB applications are not able to read these data and we receive TIMEOUT error.
What can I do ?
thank you
Nico
Is the ERP a third party app? If so, since it is the one doing the locking, you will need to talk to that vendor and see if they can/will do a more permissive lock.
Since that is 'unlikely to happen' (vendors are funny that way) You might increase the timeout on your connection object to see if waiting a few more seconds will allow the lock to clear.
Your next option is to add a transaction to the process and set the isolation level of the transaction to "readuncommited". This will allow you to 'by pass' the exclusive lock, but the RISK is that you may get obsolete (incorrect) data.
|||Hello,
Just to confirm you it's seems to work and this a great new for our users :)
Thank you very much for you help
regards
Nico
|||hmmm.. "Nico" & "Polleveys".. sounds like I should open up answers for ouzo .
Seriously, glad to help, would you please remember to mark a question as "answered" once you are satisfied. It will help others find answers, and allow answerers to move on to other unanswered questions.
Is it possible to read data from a table with exclusive lock ?
Hello,
We currently use SQL Serv 2000 with an ERP application and VB applications.
Both system work with the same database & tables but the ERP application seems to put exclusive lock on all tables it needs during processes. So our VB applications are not able to read these data and we receive TIMEOUT error.
What can I do ?
thank you
Nico
Is the ERP a third party app? If so, since it is the one doing the locking, you will need to talk to that vendor and see if they can/will do a more permissive lock.
Since that is 'unlikely to happen' (vendors are funny that way) You might increase the timeout on your connection object to see if waiting a few more seconds will allow the lock to clear.
Your next option is to add a transaction to the process and set the isolation level of the transaction to "readuncommited". This will allow you to 'by pass' the exclusive lock, but the RISK is that you may get obsolete (incorrect) data.
|||Hello,
Just to confirm you it's seems to work and this a great new for our users :)
Thank you very much for you help
regards
Nico
|||hmmm.. "Nico" & "Polleveys".. sounds like I should open up answers for ouzo .
Seriously, glad to help, would you please remember to mark a question as "answered" once you are satisfied. It will help others find answers, and allow answerers to move on to other unanswered questions.
sqlIs it possible to read a transation log?
restoration purposes?
thanks in advance
Russ White
rwhite@.cascodev.com
Yes. There is a third-party product from Lumigent called Log Explorer that
is very good for reading transaction logs. It has a lot of features for
finding transactions and undoing or redoing them.
www.lumigent.com
Geoff N. Hiten
Microsoft SQL Server MVP
Senior Database Administrator
Careerbuilder.com
I support the Professional Association for SQL Server
www.sqlpass.org
"Russell White" <rwhite04@.maine.rr.com> wrote in message
news:OdHbKLUgEHA.3676@.TK2MSFTNGP12.phx.gbl...
> Is it possible to read a transaction log or can they only be used for
> restoration purposes?
> thanks in advance
> Russ White
> rwhite@.cascodev.com
>
>
Is it possible to read a transation log?
restoration purposes?
thanks in advance
Russ White
rwhite@.cascodev.comYes. There is a third-party product from Lumigent called Log Explorer that
is very good for reading transaction logs. It has a lot of features for
finding transactions and undoing or redoing them.
www.lumigent.com
Geoff N. Hiten
Microsoft SQL Server MVP
Senior Database Administrator
Careerbuilder.com
I support the Professional Association for SQL Server
www.sqlpass.org
"Russell White" <rwhite04@.maine.rr.com> wrote in message
news:OdHbKLUgEHA.3676@.TK2MSFTNGP12.phx.gbl...
> Is it possible to read a transaction log or can they only be used for
> restoration purposes?
> thanks in advance
> Russ White
> rwhite@.cascodev.com
>
>
Is it possible to read a transation log?
restoration purposes?
thanks in advance
Russ White
rwhite@.cascodev.comYes. There is a third-party product from Lumigent called Log Explorer that
is very good for reading transaction logs. It has a lot of features for
finding transactions and undoing or redoing them.
www.lumigent.com
Geoff N. Hiten
Microsoft SQL Server MVP
Senior Database Administrator
Careerbuilder.com
I support the Professional Association for SQL Server
www.sqlpass.org
"Russell White" <rwhite04@.maine.rr.com> wrote in message
news:OdHbKLUgEHA.3676@.TK2MSFTNGP12.phx.gbl...
> Is it possible to read a transaction log or can they only be used for
> restoration purposes?
> thanks in advance
> Russ White
> rwhite@.cascodev.com
>
>
Is it possible to query a server's DBCC SHOWFILESTATS from one server to another?
DBCC SHOWFILESTATS. The trick is that the query has to attach to the
remote server, then run the DBCC SHOWFILESTATS, and pull that
information back.
e.g. use servername2.master DBCC SHOWFILESTATS
This obviouly does not work even with the linked server option. Is
there another way to do this? I know you can use a select statement and
a linked server connection to query remote databases.you could create a procedure like this then call the proc on the server
create proc prShowFileStats
as
set nocount on
create table #SHOWFILESTATS (FileID int,
FileGroup int,
TotalExtents int,
UsedExtents int,
Name varchar(100),
FileName varchar(100))
insert into #SHOWFILESTATS
exec ('DBCC SHOWFILESTATS')
select * from #SHOWFILESTATS
set nocount off
http://sqlservercode.blogspot.com/
Is it possible to query a prior query?
so that another SQL query can further refine the
prior query?Peter Olcott (olcott@.worldnet.att.net) writes:
> Is there some way to save a selection set in SQL
> so that another SQL query can further refine the
> prior query?
http://www.algonet.se/~sommar/share_data.html may give you some
suggestions.
--
Erland Sommarskog, SQL Server MVP, sommar@.algonet.se
Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techin.../2000/books.asp|||My suggestion is to dynamicly build view.You can query view as any other
table.You can also dynamicly build SQL SELECT statement and add conditions
in WHERE clause and execute it.sql
Is it Possible to query a Cube with Query Analyzer?
This is an example in a previous discussion here. I have not tried this example myself.
http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=658049&SiteID=1
HTH
Thomas Ivarsson
is it possible to put the raiseerror in a text file or show it to the user after its been
I am in process of building a website where the user can upload files and then those files are loaded in to a sql server database. I am using some sprocs to scrub the data and then insert them into the production database.. And in my sprpc before and after updating or inserting a record or scrubing... i am returning the count by raising an error. or returning the rownumber where the error occured.. is there any way i can get the raise error part or whatever error i get while scrubing the data and relay it back to the user in a user freindly way or in a text file... or the best thing is can i open smalll window where i can show them what processing is goin on and alert them if there are any errors...
Any help will be appreciated.
Regards
Karen
Take a look forSqlException.Errors. Any SqlError object has the number of error and another informations.
PS.: To another databases, take a look forOleDbException.Errors.
|||Hi Karenros,
Based on my understanding, you want to use Raiserror to generate an error message and pass it to the client user. Client user may get an alerting message or write it to a text file when getting the error message. If I've misunderstood you ,please feel free to tell me, thanks.
You can put your sqlcommand in a try block and in your catch block, write sqlconnection.errors.message to a text file. Please remember do not assign the severity value of your error message more than 19, or else it maybe cause terminate your connection. Sample code is like the following:
try { con.Open(); cmd.ExecuteNonQuery(); }catch (SqlException ex) {using(StreamWriter sw=new StreamWriter("your text log file path here")) {foreach (SqlError errin ex.Errors) sw.WriteLine(err.Message+"\n"); } }Hope my suggestion helps|||
Chen,
Thanks for your answer. yeah and thats exactly that i wanted to do... so that user would know if the import process was successful or not...
I have tried using sqlexception before with no luck.. may be i didnt import the right header files in order for that work and i have also seen on msdn that we need a sqlinfomessage class or something like to do it.. Pls correct me if i am wrong...
anyways i am gonna give it a try and will let you know...
Regards
Karen
|||Below is an example of how you can use the InfoMessage event handler:
First you'll have to create an event handler for this event like below:
con.Open();
con.InfoMessage +=new SqlInfoMessageEventHandler(con_InfoMessage);// here i've registered for the event
... set up the command object
cmd.NotificationAutoEnlist =true;
cmd.ExecuteNonQuery();
Then you can go on and write any code you want in that event handler method.
private void con_InfoMessage(object sender, SqlInfoMessageEventArgs e)
{
// your file writing code goes here. The eventArgs e holds errors, messages, source etc.
// you can just use e.ToString() and everything is there for you.
}
Hope this will help.
|||Hi Karenros,
I've tested the sqlexception code on my local machine and it does work fine. So, maybe you have made some mistakes somewhere else.
However, I think you can also trydhimant 's solution. That's really a good method to solve your problem. thanks
Is it possible to put several queries into one sp
I have an update query which either inserts a row or increases quantity, depending if row exists or not. It works, better than my explanation probably.
After that query could be a good time to count total of all calculated sub sums.
Something like this.
previous query
END
go
SELECT SUM(SubTotal)
FROM dbo.t_Shoppings
I have tried this on the tool which has a long name, but I think my way didn't work. (Microsoft sql server management studio express)
Is this possible or do I have make and call another stored procedure.
I can send my sp if someone wants.
No, this is for sure possible. Try taking the "END" between your first and second query and put it after your second query. Let me know what errors you are getting when you try to execute it if that doesn't work
you can just put queries on eby one withiout any separator , just start every select statement in new line. Do not use GO it unless you run your query in Management studio environment (Go is not SQL comamnd)
||| Thank you both for your advises. I'll test the sp later today. And I have to check how to return parameters and so on first.
I'll mark your answers as answers then too.
Regards
Leif
|||Hi
I tried today my sp and got it working. Server management studio didn't show output parameter right but the query itself seems to work. I'll test it with code later.
Thanks for help.
Here is my stored procedure now. I didn't translate it, so variables may look strange. Kokonaissumma means total value btw.
create PROCEDURE [dbo].[kori2]
(
@.Tuotekoodi varchar(20),
@.kokonaissumma money output
)
AS
BEGIN
SET NOCOUNT ON;
IF NOT EXISTS(SELECT * FROM dbo.t_osto WHERE Tuotekoodi=@.Tuotekoodi)
BEGIN
INSERT dbo.t_osto (Tuotekoodi, Nimi,Malli,Toimittajanimi,Ryhma,Myyntihinta,Alv)
SELECT Tuotekoodi, Nimi,Malli,Toimittajanimi,Ryhma,Myyntihinta,Alv
FROM dbo.t_Tuote
WHERE Tuotekoodi= @.Tuotekoodi
END
ELSE
BEGIN
UPDATE dbo.t_osto
SET Maara=Maara+1
WHERE Tuotekoodi=@.Tuotekoodi
END
END
return (SELECT count(*) FROM dbo.t_osto)
(select @.kokonaissumma=sum(Yhteensa)FROM dbo.t_osto)