显示标签为“time”的博文。显示所有博文
显示标签为“time”的博文。显示所有博文

2012年3月27日星期二

Anyone lend a hand in .NET?

This is just one of many SQL based questions that go unanswered in the .NET forum. If anyone has some spare time, it would be great if you could take a look at the post mentioned above and also see if there are any other database questions that would benefit from your expertise!!

Thanks!It doesn't look like I can click on "This".
I check SQL questions sometimes on VB forum but don't have time for more... :(

I am working full time and try to manage some questions whenever I can...
I don't see anyone to answer questions on this forum but me for a while.

You can move some questions to SQL forum I guess.
I have some knowledge of .Net

Irina.|||http://www.msdner.com/forum/thread633912.html is what "This" is.|||I responded to the best of my abilities.

You can refer people to this article:
http://www.csharp-station.com/Tutorials/AdoDotNet/Lesson05.aspx

Thank you.
Good Luck.|||

Quote:

Originally Posted by iburyak

I responded to the best of my abilities.

You can refer people to this article:
http://www.csharp-station.com/Tutorials/AdoDotNet/Lesson05.aspx

Thank you.
Good Luck.


Good, hopefully this will put them in the right direction!

Thanks!sql

2012年3月22日星期四

Anyone Else Having Old Versions of Stuff Mysteriously Come Back to Haunt Them?

OK, so it's Halloween time and everything, but give me a
break! Here at my organization we've been having this
happen on occasion for a quite a while (maybe for the
last year or so) - old versions of things such as DTS
packages and stored procedures come back and become the
current version of that particular object. Now, we store
our DTS packages here in the msdb database, and we
haven't always deleted old versions of those, so maybe
somehow they are floating back to the top of the version
list somehow. But stored procedures? Just today I went to
check out a stored procedure I had written a while back
so that I could show one of my co-workers the code within
it, and saw that it had mysteriously reverted back to the
way it was before I changed it months ago to add the
aforementioned code. We managed to find the correct
version of the procedure, luckily, in a backup of the
database we had lying around, or I would have had to re-
write it all over again. What is particularly disturbing
about this incident is that the former version of the
stored procedure will execute successfully and return
results that appear correct on the surface. Those results
are only slightly flawed and the damage won't come to
light until much later. Not good!
We have not done any restores that would have turned back
the database to the point before the procedure or package
change; it's just that this reverting action will occur
on its own periodically with no warning.
Has anyone else experienced this? Does anyone know why
it's happening and what can be done about it?
We're running SQL Server 2000 on Windows 2000 Advanced
Server, and the current service pack (SP3a) is applied.
Thank you,
Mark Schmidt
Database Administrator
Pennsylvania House of RepresentativesMark,
Do you at all rename stored procedures? Sp_rename does not change the proc name in create proc in
syscomments and this might be a reason...
--
Tibor Karaszi, SQL Server MVP
Archive at: http://groups.google.com/groups?oi=djq&as_ugroup=microsoft.public.sqlserver
"Mark Schmidt" <MSchmidt@.pa_housewithouttheunderscore.net> wrote in message
news:00c201c39cbb$bd022e40$a501280a@.phx.gbl...
> OK, so it's Halloween time and everything, but give me a
> break! Here at my organization we've been having this
> happen on occasion for a quite a while (maybe for the
> last year or so) - old versions of things such as DTS
> packages and stored procedures come back and become the
> current version of that particular object. Now, we store
> our DTS packages here in the msdb database, and we
> haven't always deleted old versions of those, so maybe
> somehow they are floating back to the top of the version
> list somehow. But stored procedures? Just today I went to
> check out a stored procedure I had written a while back
> so that I could show one of my co-workers the code within
> it, and saw that it had mysteriously reverted back to the
> way it was before I changed it months ago to add the
> aforementioned code. We managed to find the correct
> version of the procedure, luckily, in a backup of the
> database we had lying around, or I would have had to re-
> write it all over again. What is particularly disturbing
> about this incident is that the former version of the
> stored procedure will execute successfully and return
> results that appear correct on the surface. Those results
> are only slightly flawed and the damage won't come to
> light until much later. Not good!
> We have not done any restores that would have turned back
> the database to the point before the procedure or package
> change; it's just that this reverting action will occur
> on its own periodically with no warning.
> Has anyone else experienced this? Does anyone know why
> it's happening and what can be done about it?
> We're running SQL Server 2000 on Windows 2000 Advanced
> Server, and the current service pack (SP3a) is applied.
> Thank you,
> Mark Schmidt
> Database Administrator
> Pennsylvania House of Representatives|||Thank you for your response, Tibor.
No, we haven't renamed any procs to cause this. Actually,
it came to my attention after I posted my question that
the problem with the stored procedure that I mentioned
may very well have been somebody re-creating the
procedure with old code and not realizing it until later.
But, when it comes to DTS packages, we definitely have
had this phenomenon occur several times with no apparent
intervention on anyone's part.
Mark
>--Original Message--
>Mark,
>Do you at all rename stored procedures? Sp_rename does
not change the proc name in create proc in
>syscomments and this might be a reason...
>--
>Tibor Karaszi, SQL Server MVP
>Archive at: http://groups.google.com/groups?
oi=djq&as_ugroup=microsoft.public.sqlserver
>
>"Mark Schmidt"
<MSchmidt@.pa_housewithouttheunderscore.net> wrote in
message
>news:00c201c39cbb$bd022e40$a501280a@.phx.gbl...
>> OK, so it's Halloween time and everything, but give me
a
>> break! Here at my organization we've been having this
>> happen on occasion for a quite a while (maybe for the
>> last year or so) - old versions of things such as DTS
>> packages and stored procedures come back and become the
>> current version of that particular object. Now, we
store
>> our DTS packages here in the msdb database, and we
>> haven't always deleted old versions of those, so maybe
>> somehow they are floating back to the top of the
version
>> list somehow. But stored procedures? Just today I went
to
>> check out a stored procedure I had written a while back
>> so that I could show one of my co-workers the code
within
>> it, and saw that it had mysteriously reverted back to
the
>> way it was before I changed it months ago to add the
>> aforementioned code. We managed to find the correct
>> version of the procedure, luckily, in a backup of the
>> database we had lying around, or I would have had to
re-
>> write it all over again. What is particularly
disturbing
>> about this incident is that the former version of the
>> stored procedure will execute successfully and return
>> results that appear correct on the surface. Those
results
>> are only slightly flawed and the damage won't come to
>> light until much later. Not good!
>> We have not done any restores that would have turned
back
>> the database to the point before the procedure or
package
>> change; it's just that this reverting action will occur
>> on its own periodically with no warning.
>> Has anyone else experienced this? Does anyone know why
>> it's happening and what can be done about it?
>> We're running SQL Server 2000 on Windows 2000 Advanced
>> Server, and the current service pack (SP3a) is applied.
>> Thank you,
>> Mark Schmidt
>> Database Administrator
>> Pennsylvania House of Representatives
>
>.
>|||> But, when it comes to DTS packages, we definitely have
> had this phenomenon occur several times with no apparent
> intervention on anyone's part.
I still suspect sp_rename... ;-)
But without a repro, it if of course impossible to say.
--
Tibor Karaszi, SQL Server MVP
Archive at: http://groups.google.com/groups?oi=djq&as_ugroup=microsoft.public.sqlserver
"Mark Schmidt" <anonymous@.discussions.microsoft.com> wrote in message
news:0a0f01c39e52$ab954820$a001280a@.phx.gbl...
> Thank you for your response, Tibor.
> No, we haven't renamed any procs to cause this. Actually,
> it came to my attention after I posted my question that
> the problem with the stored procedure that I mentioned
> may very well have been somebody re-creating the
> procedure with old code and not realizing it until later.
> But, when it comes to DTS packages, we definitely have
> had this phenomenon occur several times with no apparent
> intervention on anyone's part.
> Mark
> >--Original Message--
> >Mark,
> >
> >Do you at all rename stored procedures? Sp_rename does
> not change the proc name in create proc in
> >syscomments and this might be a reason...
> >
> >--
> >Tibor Karaszi, SQL Server MVP
> >Archive at: http://groups.google.com/groups?
> oi=djq&as_ugroup=microsoft.public.sqlserver
> >
> >
> >"Mark Schmidt"
> <MSchmidt@.pa_housewithouttheunderscore.net> wrote in
> message
> >news:00c201c39cbb$bd022e40$a501280a@.phx.gbl...
> >> OK, so it's Halloween time and everything, but give me
> a
> >> break! Here at my organization we've been having this
> >> happen on occasion for a quite a while (maybe for the
> >> last year or so) - old versions of things such as DTS
> >> packages and stored procedures come back and become the
> >> current version of that particular object. Now, we
> store
> >> our DTS packages here in the msdb database, and we
> >> haven't always deleted old versions of those, so maybe
> >> somehow they are floating back to the top of the
> version
> >> list somehow. But stored procedures? Just today I went
> to
> >> check out a stored procedure I had written a while back
> >> so that I could show one of my co-workers the code
> within
> >> it, and saw that it had mysteriously reverted back to
> the
> >> way it was before I changed it months ago to add the
> >> aforementioned code. We managed to find the correct
> >> version of the procedure, luckily, in a backup of the
> >> database we had lying around, or I would have had to
> re-
> >> write it all over again. What is particularly
> disturbing
> >> about this incident is that the former version of the
> >> stored procedure will execute successfully and return
> >> results that appear correct on the surface. Those
> results
> >> are only slightly flawed and the damage won't come to
> >> light until much later. Not good!
> >>
> >> We have not done any restores that would have turned
> back
> >> the database to the point before the procedure or
> package
> >> change; it's just that this reverting action will occur
> >> on its own periodically with no warning.
> >>
> >> Has anyone else experienced this? Does anyone know why
> >> it's happening and what can be done about it?
> >>
> >> We're running SQL Server 2000 on Windows 2000 Advanced
> >> Server, and the current service pack (SP3a) is applied.
> >>
> >> Thank you,
> >>
> >> Mark Schmidt
> >> Database Administrator
> >> Pennsylvania House of Representatives
> >
> >
> >.
> >|||Well, my developers are not telling me that they're doing
renames, and I have to go with that for now.
Thank you very much for the help and for something to
look for, Tibor.
Mark
>--Original Message--
>> But, when it comes to DTS packages, we definitely have
>> had this phenomenon occur several times with no
apparent
>> intervention on anyone's part.
>I still suspect sp_rename... ;-)
>But without a repro, it if of course impossible to say.
>--
>Tibor Karaszi, SQL Server MVP
>Archive at: http://groups.google.com/groups?
oi=djq&as_ugroup=microsoft.public.sqlserver
>
>"Mark Schmidt" <anonymous@.discussions.microsoft.com>
wrote in message
>news:0a0f01c39e52$ab954820$a001280a@.phx.gbl...
>> Thank you for your response, Tibor.
>> No, we haven't renamed any procs to cause this.
Actually,
>> it came to my attention after I posted my question that
>> the problem with the stored procedure that I mentioned
>> may very well have been somebody re-creating the
>> procedure with old code and not realizing it until
later.
>> But, when it comes to DTS packages, we definitely have
>> had this phenomenon occur several times with no
apparent
>> intervention on anyone's part.
>> Mark
>> >--Original Message--
>> >Mark,
>> >
>> >Do you at all rename stored procedures? Sp_rename does
>> not change the proc name in create proc in
>> >syscomments and this might be a reason...
>> >
>> >--
>> >Tibor Karaszi, SQL Server MVP
>> >Archive at: http://groups.google.com/groups?
>> oi=djq&as_ugroup=microsoft.public.sqlserver
>> >
>> >
>> >"Mark Schmidt"
>> <MSchmidt@.pa_housewithouttheunderscore.net> wrote in
>> message
>> >news:00c201c39cbb$bd022e40$a501280a@.phx.gbl...
>> >> OK, so it's Halloween time and everything, but give
me
>> a
>> >> break! Here at my organization we've been having
this
>> >> happen on occasion for a quite a while (maybe for
the
>> >> last year or so) - old versions of things such as
DTS
>> >> packages and stored procedures come back and become
the
>> >> current version of that particular object. Now, we
>> store
>> >> our DTS packages here in the msdb database, and we
>> >> haven't always deleted old versions of those, so
maybe
>> >> somehow they are floating back to the top of the
>> version
>> >> list somehow. But stored procedures? Just today I
went
>> to
>> >> check out a stored procedure I had written a while
back
>> >> so that I could show one of my co-workers the code
>> within
>> >> it, and saw that it had mysteriously reverted back
to
>> the
>> >> way it was before I changed it months ago to add the
>> >> aforementioned code. We managed to find the correct
>> >> version of the procedure, luckily, in a backup of
the
>> >> database we had lying around, or I would have had to
>> re-
>> >> write it all over again. What is particularly
>> disturbing
>> >> about this incident is that the former version of
the
>> >> stored procedure will execute successfully and
return
>> >> results that appear correct on the surface. Those
>> results
>> >> are only slightly flawed and the damage won't come
to
>> >> light until much later. Not good!
>> >>
>> >> We have not done any restores that would have turned
>> back
>> >> the database to the point before the procedure or
>> package
>> >> change; it's just that this reverting action will
occur
>> >> on its own periodically with no warning.
>> >>
>> >> Has anyone else experienced this? Does anyone know
why
>> >> it's happening and what can be done about it?
>> >>
>> >> We're running SQL Server 2000 on Windows 2000
Advanced
>> >> Server, and the current service pack (SP3a) is
applied.
>> >>
>> >> Thank you,
>> >>
>> >> Mark Schmidt
>> >> Database Administrator
>> >> Pennsylvania House of Representatives
>> >
>> >
>> >.
>> >
>
>.
>sql

2012年3月20日星期二

Any way to suppress ADO error from stored proc?

Hi,
I have a stored procedure that can insert multiple rows but it does them in
a loop so the inserts happen one at a time. There is a unique constraint on
the table and sometimes the insert violates this and the constraint
violation gets returned as an error. What I want to do is to trap the error
report it in another table and continue processing all of the inserts and
not have the unique constraint error returned to the calling application.
The procedure was changed to check @.@.ERROR and use a CONTINUE to keep the
procedure processing all the inserts and then I just do a RETURN(0) at the
end. Unfortunately this still returns the unique constraint violation even
though I am doing the RETURN(0). There doesn't seem to be any way to keep
the unique constraint from going through to ADO and reporting back an error.
The procedure has now been changed to check for the unique problem before
performing the insert but that seems ineffecient so I would rather just
suppress the error if possible. Thanks in advance for any ideas.
Wayne AntinoreHi Wayne.
Unfortunately, T-SQL offers no way to either suppress errors or provide
run-time inspection of full error messages.
You will have to implement exception management in the client to ignore
error message passed back up to ADO if you really want to take the approach
you've described.
Many people take the approach you've described & perform the distinct query
before performing the insert, but even this is not fool-proof in a high
concurrency environment.
fwiw - this has been bitched about for years & we've got some better error
handling tools coming in the next version of SQL Server. For now though,
you're stuck with this problem as you've described.
Regards,
Greg Linwood
SQL Server MVP
"Wayne Antinore" <wantinore@.veramark.com> wrote in message
news:eIp7jDNuDHA.2360@.TK2MSFTNGP10.phx.gbl...
> Hi,
> I have a stored procedure that can insert multiple rows but it does them
in
> a loop so the inserts happen one at a time. There is a unique constraint
on
> the table and sometimes the insert violates this and the constraint
> violation gets returned as an error. What I want to do is to trap the
error
> report it in another table and continue processing all of the inserts and
> not have the unique constraint error returned to the calling application.
> The procedure was changed to check @.@.ERROR and use a CONTINUE to keep the
> procedure processing all the inserts and then I just do a RETURN(0) at the
> end. Unfortunately this still returns the unique constraint violation
even
> though I am doing the RETURN(0). There doesn't seem to be any way to keep
> the unique constraint from going through to ADO and reporting back an
error.
> The procedure has now been changed to check for the unique problem before
> performing the insert but that seems ineffecient so I would rather just
> suppress the error if possible. Thanks in advance for any ideas.
> Wayne Antinore
>|||Wayne
Look at SET XACT_ABORT on BOL
"Wayne Antinore" <wantinore@.veramark.com> wrote in message
news:eIp7jDNuDHA.2360@.TK2MSFTNGP10.phx.gbl...
> Hi,
> I have a stored procedure that can insert multiple rows but it does them
in
> a loop so the inserts happen one at a time. There is a unique constraint
on
> the table and sometimes the insert violates this and the constraint
> violation gets returned as an error. What I want to do is to trap the
error
> report it in another table and continue processing all of the inserts and
> not have the unique constraint error returned to the calling application.
> The procedure was changed to check @.@.ERROR and use a CONTINUE to keep the
> procedure processing all the inserts and then I just do a RETURN(0) at the
> end. Unfortunately this still returns the unique constraint violation
even
> though I am doing the RETURN(0). There doesn't seem to be any way to keep
> the unique constraint from going through to ADO and reporting back an
error.
> The procedure has now been changed to check for the unique problem before
> performing the insert but that seems ineffecient so I would rather just
> suppress the error if possible. Thanks in advance for any ideas.
> Wayne Antinore
>|||Hi Uri.
I think this won't help Wayne.
SET XACT_ABORT ON will attempt to rollback an entire transaction on any
error. The way I read Wayne's post, he wants his transaction to continue
processing other rows, even after a constraint violation, so it would have
the opposite effect from what he's after.
Regards,
Greg Linwood
SQL Server MVP
"Uri Dimant" <urid@.iscar.co.il> wrote in message
news:u8IqSJNuDHA.2304@.tk2msftngp13.phx.gbl...
> Wayne
> Look at SET XACT_ABORT on BOL
> "Wayne Antinore" <wantinore@.veramark.com> wrote in message
> news:eIp7jDNuDHA.2360@.TK2MSFTNGP10.phx.gbl...
> > Hi,
> > I have a stored procedure that can insert multiple rows but it does them
> in
> > a loop so the inserts happen one at a time. There is a unique
constraint
> on
> > the table and sometimes the insert violates this and the constraint
> > violation gets returned as an error. What I want to do is to trap the
> error
> > report it in another table and continue processing all of the inserts
and
> > not have the unique constraint error returned to the calling
application.
> > The procedure was changed to check @.@.ERROR and use a CONTINUE to keep
the
> > procedure processing all the inserts and then I just do a RETURN(0) at
the
> > end. Unfortunately this still returns the unique constraint violation
> even
> > though I am doing the RETURN(0). There doesn't seem to be any way to
keep
> > the unique constraint from going through to ADO and reporting back an
> error.
> > The procedure has now been changed to check for the unique problem
before
> > performing the insert but that seems ineffecient so I would rather just
> > suppress the error if possible. Thanks in advance for any ideas.
> >
> > Wayne Antinore
> >
> >
>|||Hi,Greg
>The way I read Wayne's post, he wants his transaction to continue
>processing other rows, even after a constraint violation, so it would have
>the opposite effect from what he's after.
So ,he can use
This is an example from BOL
CREATE TABLE t1 (a int PRIMARY KEY)
CREATE TABLE t2 (a int REFERENCES t1(a))
GO
INSERT INTO t1 VALUES (1)
INSERT INTO t1 VALUES (3)
INSERT INTO t1 VALUES (4)
INSERT INTO t1 VALUES (6)
GO
SET XACT_ABORT OFF
GO
BEGIN TRAN
INSERT INTO t2 VALUES (1)
INSERT INTO t2 VALUES (2) /* Foreign key error */
INSERT INTO t2 VALUES (3)
COMMIT TRAN
GO
/* Select shows only keys 1 and 3 added.
Key 2 insert failed and was rolled back, but
XACT_ABORT was OFF and rest of transaction
succeeded.
*/
"Greg Linwood" <g_linwoodremovethisbeforeemailingme@.hotmail.com> wrote in
message news:OdtgRONuDHA.3744@.TK2MSFTNGP11.phx.gbl...
> Hi Uri.
> I think this won't help Wayne.
> SET XACT_ABORT ON will attempt to rollback an entire transaction on any
> error. The way I read Wayne's post, he wants his transaction to continue
> processing other rows, even after a constraint violation, so it would have
> the opposite effect from what he's after.
> Regards,
> Greg Linwood
> SQL Server MVP
> "Uri Dimant" <urid@.iscar.co.il> wrote in message
> news:u8IqSJNuDHA.2304@.tk2msftngp13.phx.gbl...
> > Wayne
> > Look at SET XACT_ABORT on BOL
> >
> > "Wayne Antinore" <wantinore@.veramark.com> wrote in message
> > news:eIp7jDNuDHA.2360@.TK2MSFTNGP10.phx.gbl...
> > > Hi,
> > > I have a stored procedure that can insert multiple rows but it does
them
> > in
> > > a loop so the inserts happen one at a time. There is a unique
> constraint
> > on
> > > the table and sometimes the insert violates this and the constraint
> > > violation gets returned as an error. What I want to do is to trap the
> > error
> > > report it in another table and continue processing all of the inserts
> and
> > > not have the unique constraint error returned to the calling
> application.
> > > The procedure was changed to check @.@.ERROR and use a CONTINUE to keep
> the
> > > procedure processing all the inserts and then I just do a RETURN(0) at
> the
> > > end. Unfortunately this still returns the unique constraint violation
> > even
> > > though I am doing the RETURN(0). There doesn't seem to be any way to
> keep
> > > the unique constraint from going through to ADO and reporting back an
> > error.
> > > The procedure has now been changed to check for the unique problem
> before
> > > performing the insert but that seems ineffecient so I would rather
just
> > > suppress the error if possible. Thanks in advance for any ideas.
> > >
> > > Wayne Antinore
> > >
> > >
> >
> >
>|||Hi Uri.
I now see you intended to set it OFF rather than ON.
However - Wayne's problem still remains that errors will be thrown through
ADO to his client, regardless of how XACT_ABORT is set.
Whether you set XACT_ABORT either ON / OFF won't solve his problem..
Regards,
Greg Linwood
SQL Server MVP
"Uri Dimant" <urid@.iscar.co.il> wrote in message
news:OtZIISNuDHA.3744@.TK2MSFTNGP11.phx.gbl...
> Hi,Greg
> >The way I read Wayne's post, he wants his transaction to continue
> >processing other rows, even after a constraint violation, so it would
have
> >the opposite effect from what he's after.
>
> So ,he can use
> This is an example from BOL
> CREATE TABLE t1 (a int PRIMARY KEY)
> CREATE TABLE t2 (a int REFERENCES t1(a))
> GO
> INSERT INTO t1 VALUES (1)
> INSERT INTO t1 VALUES (3)
> INSERT INTO t1 VALUES (4)
> INSERT INTO t1 VALUES (6)
> GO
> SET XACT_ABORT OFF
> GO
> BEGIN TRAN
> INSERT INTO t2 VALUES (1)
> INSERT INTO t2 VALUES (2) /* Foreign key error */
> INSERT INTO t2 VALUES (3)
> COMMIT TRAN
> GO
> /* Select shows only keys 1 and 3 added.
> Key 2 insert failed and was rolled back, but
> XACT_ABORT was OFF and rest of transaction
> succeeded.
> */
> "Greg Linwood" <g_linwoodremovethisbeforeemailingme@.hotmail.com> wrote in
> message news:OdtgRONuDHA.3744@.TK2MSFTNGP11.phx.gbl...
> > Hi Uri.
> >
> > I think this won't help Wayne.
> >
> > SET XACT_ABORT ON will attempt to rollback an entire transaction on any
> > error. The way I read Wayne's post, he wants his transaction to continue
> > processing other rows, even after a constraint violation, so it would
have
> > the opposite effect from what he's after.
> >
> > Regards,
> > Greg Linwood
> > SQL Server MVP
> >
> > "Uri Dimant" <urid@.iscar.co.il> wrote in message
> > news:u8IqSJNuDHA.2304@.tk2msftngp13.phx.gbl...
> > > Wayne
> > > Look at SET XACT_ABORT on BOL
> > >
> > > "Wayne Antinore" <wantinore@.veramark.com> wrote in message
> > > news:eIp7jDNuDHA.2360@.TK2MSFTNGP10.phx.gbl...
> > > > Hi,
> > > > I have a stored procedure that can insert multiple rows but it does
> them
> > > in
> > > > a loop so the inserts happen one at a time. There is a unique
> > constraint
> > > on
> > > > the table and sometimes the insert violates this and the constraint
> > > > violation gets returned as an error. What I want to do is to trap
the
> > > error
> > > > report it in another table and continue processing all of the
inserts
> > and
> > > > not have the unique constraint error returned to the calling
> > application.
> > > > The procedure was changed to check @.@.ERROR and use a CONTINUE to
keep
> > the
> > > > procedure processing all the inserts and then I just do a RETURN(0)
at
> > the
> > > > end. Unfortunately this still returns the unique constraint
violation
> > > even
> > > > though I am doing the RETURN(0). There doesn't seem to be any way
to
> > keep
> > > > the unique constraint from going through to ADO and reporting back
an
> > > error.
> > > > The procedure has now been changed to check for the unique problem
> > before
> > > > performing the insert but that seems ineffecient so I would rather
> just
> > > > suppress the error if possible. Thanks in advance for any ideas.
> > > >
> > > > Wayne Antinore
> > > >
> > > >
> > >
> > >
> >
> >
>|||THere is no way to suppress the Constraint violation error from the stored
procedure ( on the back end.).
"Wayne Antinore" <wantinore@.veramark.com> wrote in message
news:eIp7jDNuDHA.2360@.TK2MSFTNGP10.phx.gbl...
> Hi,
> I have a stored procedure that can insert multiple rows but it does them
in
> a loop so the inserts happen one at a time. There is a unique constraint
on
> the table and sometimes the insert violates this and the constraint
> violation gets returned as an error. What I want to do is to trap the
error
> report it in another table and continue processing all of the inserts and
> not have the unique constraint error returned to the calling application.
> The procedure was changed to check @.@.ERROR and use a CONTINUE to keep the
> procedure processing all the inserts and then I just do a RETURN(0) at the
> end. Unfortunately this still returns the unique constraint violation
even
> though I am doing the RETURN(0). There doesn't seem to be any way to keep
> the unique constraint from going through to ADO and reporting back an
error.
> The procedure has now been changed to check for the unique problem before
> performing the insert but that seems ineffecient so I would rather just
> suppress the error if possible. Thanks in advance for any ideas.
> Wayne Antinore
>|||Greg
I hope it will be possible with "Yukon" to use begin try catch ( I don't
remember exactly what is a syntax)
"Greg Linwood" <g_linwoodremovethisbeforeemailingme@.hotmail.com> wrote in
message news:#2qpMoNuDHA.2508@.TK2MSFTNGP12.phx.gbl...
> Hi Uri.
> I now see you intended to set it OFF rather than ON.
> However - Wayne's problem still remains that errors will be thrown through
> ADO to his client, regardless of how XACT_ABORT is set.
> Whether you set XACT_ABORT either ON / OFF won't solve his problem..
> Regards,
> Greg Linwood
> SQL Server MVP
> "Uri Dimant" <urid@.iscar.co.il> wrote in message
> news:OtZIISNuDHA.3744@.TK2MSFTNGP11.phx.gbl...
> > Hi,Greg
> > >The way I read Wayne's post, he wants his transaction to continue
> > >processing other rows, even after a constraint violation, so it would
> have
> > >the opposite effect from what he's after.
> >
> >
> > So ,he can use
> > This is an example from BOL
> >
> > CREATE TABLE t1 (a int PRIMARY KEY)
> > CREATE TABLE t2 (a int REFERENCES t1(a))
> > GO
> > INSERT INTO t1 VALUES (1)
> > INSERT INTO t1 VALUES (3)
> > INSERT INTO t1 VALUES (4)
> > INSERT INTO t1 VALUES (6)
> > GO
> > SET XACT_ABORT OFF
> > GO
> > BEGIN TRAN
> > INSERT INTO t2 VALUES (1)
> > INSERT INTO t2 VALUES (2) /* Foreign key error */
> > INSERT INTO t2 VALUES (3)
> > COMMIT TRAN
> > GO
> >
> > /* Select shows only keys 1 and 3 added.
> > Key 2 insert failed and was rolled back, but
> > XACT_ABORT was OFF and rest of transaction
> > succeeded.
> > */
> >
> > "Greg Linwood" <g_linwoodremovethisbeforeemailingme@.hotmail.com> wrote
in
> > message news:OdtgRONuDHA.3744@.TK2MSFTNGP11.phx.gbl...
> > > Hi Uri.
> > >
> > > I think this won't help Wayne.
> > >
> > > SET XACT_ABORT ON will attempt to rollback an entire transaction on
any
> > > error. The way I read Wayne's post, he wants his transaction to
continue
> > > processing other rows, even after a constraint violation, so it would
> have
> > > the opposite effect from what he's after.
> > >
> > > Regards,
> > > Greg Linwood
> > > SQL Server MVP
> > >
> > > "Uri Dimant" <urid@.iscar.co.il> wrote in message
> > > news:u8IqSJNuDHA.2304@.tk2msftngp13.phx.gbl...
> > > > Wayne
> > > > Look at SET XACT_ABORT on BOL
> > > >
> > > > "Wayne Antinore" <wantinore@.veramark.com> wrote in message
> > > > news:eIp7jDNuDHA.2360@.TK2MSFTNGP10.phx.gbl...
> > > > > Hi,
> > > > > I have a stored procedure that can insert multiple rows but it
does
> > them
> > > > in
> > > > > a loop so the inserts happen one at a time. There is a unique
> > > constraint
> > > > on
> > > > > the table and sometimes the insert violates this and the
constraint
> > > > > violation gets returned as an error. What I want to do is to trap
> the
> > > > error
> > > > > report it in another table and continue processing all of the
> inserts
> > > and
> > > > > not have the unique constraint error returned to the calling
> > > application.
> > > > > The procedure was changed to check @.@.ERROR and use a CONTINUE to
> keep
> > > the
> > > > > procedure processing all the inserts and then I just do a
RETURN(0)
> at
> > > the
> > > > > end. Unfortunately this still returns the unique constraint
> violation
> > > > even
> > > > > though I am doing the RETURN(0). There doesn't seem to be any way
> to
> > > keep
> > > > > the unique constraint from going through to ADO and reporting back
> an
> > > > error.
> > > > > The procedure has now been changed to check for the unique problem
> > > before
> > > > > performing the insert but that seems ineffecient so I would rather
> > just
> > > > > suppress the error if possible. Thanks in advance for any ideas.
> > > > >
> > > > > Wayne Antinore
> > > > >
> > > > >
> > > >
> > > >
> > >
> > >
> >
> >
>|||Yep - Try / Catch will be good in Yukon.
I'm not sure if it allows error suppression, but I sure hope so!
Regards,
Greg Linwood
SQL Server MVP
"Uri Dimant" <urid@.iscar.co.il> wrote in message
news:#yR3yTOuDHA.1596@.TK2MSFTNGP10.phx.gbl...
> Greg
> I hope it will be possible with "Yukon" to use begin try catch ( I don't
> remember exactly what is a syntax)
>
>
> "Greg Linwood" <g_linwoodremovethisbeforeemailingme@.hotmail.com> wrote in
> message news:#2qpMoNuDHA.2508@.TK2MSFTNGP12.phx.gbl...
> > Hi Uri.
> >
> > I now see you intended to set it OFF rather than ON.
> >
> > However - Wayne's problem still remains that errors will be thrown
through
> > ADO to his client, regardless of how XACT_ABORT is set.
> >
> > Whether you set XACT_ABORT either ON / OFF won't solve his problem..
> >
> > Regards,
> > Greg Linwood
> > SQL Server MVP
> >
> > "Uri Dimant" <urid@.iscar.co.il> wrote in message
> > news:OtZIISNuDHA.3744@.TK2MSFTNGP11.phx.gbl...
> > > Hi,Greg
> > > >The way I read Wayne's post, he wants his transaction to continue
> > > >processing other rows, even after a constraint violation, so it would
> > have
> > > >the opposite effect from what he's after.
> > >
> > >
> > > So ,he can use
> > > This is an example from BOL
> > >
> > > CREATE TABLE t1 (a int PRIMARY KEY)
> > > CREATE TABLE t2 (a int REFERENCES t1(a))
> > > GO
> > > INSERT INTO t1 VALUES (1)
> > > INSERT INTO t1 VALUES (3)
> > > INSERT INTO t1 VALUES (4)
> > > INSERT INTO t1 VALUES (6)
> > > GO
> > > SET XACT_ABORT OFF
> > > GO
> > > BEGIN TRAN
> > > INSERT INTO t2 VALUES (1)
> > > INSERT INTO t2 VALUES (2) /* Foreign key error */
> > > INSERT INTO t2 VALUES (3)
> > > COMMIT TRAN
> > > GO
> > >
> > > /* Select shows only keys 1 and 3 added.
> > > Key 2 insert failed and was rolled back, but
> > > XACT_ABORT was OFF and rest of transaction
> > > succeeded.
> > > */
> > >
> > > "Greg Linwood" <g_linwoodremovethisbeforeemailingme@.hotmail.com> wrote
> in
> > > message news:OdtgRONuDHA.3744@.TK2MSFTNGP11.phx.gbl...
> > > > Hi Uri.
> > > >
> > > > I think this won't help Wayne.
> > > >
> > > > SET XACT_ABORT ON will attempt to rollback an entire transaction on
> any
> > > > error. The way I read Wayne's post, he wants his transaction to
> continue
> > > > processing other rows, even after a constraint violation, so it
would
> > have
> > > > the opposite effect from what he's after.
> > > >
> > > > Regards,
> > > > Greg Linwood
> > > > SQL Server MVP
> > > >
> > > > "Uri Dimant" <urid@.iscar.co.il> wrote in message
> > > > news:u8IqSJNuDHA.2304@.tk2msftngp13.phx.gbl...
> > > > > Wayne
> > > > > Look at SET XACT_ABORT on BOL
> > > > >
> > > > > "Wayne Antinore" <wantinore@.veramark.com> wrote in message
> > > > > news:eIp7jDNuDHA.2360@.TK2MSFTNGP10.phx.gbl...
> > > > > > Hi,
> > > > > > I have a stored procedure that can insert multiple rows but it
> does
> > > them
> > > > > in
> > > > > > a loop so the inserts happen one at a time. There is a unique
> > > > constraint
> > > > > on
> > > > > > the table and sometimes the insert violates this and the
> constraint
> > > > > > violation gets returned as an error. What I want to do is to
trap
> > the
> > > > > error
> > > > > > report it in another table and continue processing all of the
> > inserts
> > > > and
> > > > > > not have the unique constraint error returned to the calling
> > > > application.
> > > > > > The procedure was changed to check @.@.ERROR and use a CONTINUE to
> > keep
> > > > the
> > > > > > procedure processing all the inserts and then I just do a
> RETURN(0)
> > at
> > > > the
> > > > > > end. Unfortunately this still returns the unique constraint
> > violation
> > > > > even
> > > > > > though I am doing the RETURN(0). There doesn't seem to be any
way
> > to
> > > > keep
> > > > > > the unique constraint from going through to ADO and reporting
back
> > an
> > > > > error.
> > > > > > The procedure has now been changed to check for the unique
problem
> > > > before
> > > > > > performing the insert but that seems ineffecient so I would
rather
> > > just
> > > > > > suppress the error if possible. Thanks in advance for any
ideas.
> > > > > >
> > > > > > Wayne Antinore
> > > > > >
> > > > > >
> > > > >
> > > > >
> > > >
> > > >
> > >
> > >
> >
> >
>|||Thanks Uri, Greg, and Wayne for your replies. I didn't think there was any
way to do this currently but I'm glad you confirmed it for me. This will be
a very useful feature in Yukon
Thanks again,
Wayne
"Wayne Antinore" <wantinore@.veramark.com> wrote in message
news:eIp7jDNuDHA.2360@.TK2MSFTNGP10.phx.gbl...
> Hi,
> I have a stored procedure that can insert multiple rows but it does them
in
> a loop so the inserts happen one at a time. There is a unique constraint
on
> the table and sometimes the insert violates this and the constraint
> violation gets returned as an error. What I want to do is to trap the
error
> report it in another table and continue processing all of the inserts and
> not have the unique constraint error returned to the calling application.
> The procedure was changed to check @.@.ERROR and use a CONTINUE to keep the
> procedure processing all the inserts and then I just do a RETURN(0) at the
> end. Unfortunately this still returns the unique constraint violation
even
> though I am doing the RETURN(0). There doesn't seem to be any way to keep
> the unique constraint from going through to ADO and reporting back an
error.
> The procedure has now been changed to check for the unique problem before
> performing the insert but that seems ineffecient so I would rather just
> suppress the error if possible. Thanks in advance for any ideas.
> Wayne Antinore
>

any way to rollback dbase

Hi just wondering if there is anyway to roll back a database? For example
the last time the database was backed up say 3 months ago and a restore was
done yesterday. Just wondering if there is anyway to undo the restore?
Thanks.
Paul G
Software engineer.
No, a database restore can't be undone because all data in the target are
replaced during the restore.
Hope this helps.
Dan Guzman
SQL Server MVP
"Paul" <Paul@.discussions.microsoft.com> wrote in message
news:9A8E7FFE-2DFA-4FAC-AE0F-2BB8BF026E1C@.microsoft.com...
> Hi just wondering if there is anyway to roll back a database? For example
> the last time the database was backed up say 3 months ago and a restore
> was
> done yesterday. Just wondering if there is anyway to undo the restore?
> Thanks.
> --
> Paul G
> Software engineer.
|||"Paul" <Paul@.discussions.microsoft.com> wrote in message
news:9A8E7FFE-2DFA-4FAC-AE0F-2BB8BF026E1C@.microsoft.com...
> Hi just wondering if there is anyway to roll back a database? For example
> the last time the database was backed up say 3 months ago and a restore
> was
> done yesterday. Just wondering if there is anyway to undo the restore?
> Thanks.
> --
> Paul G
> Software engineer.
Sure -- this can be easily done.
Assuming you have a backup you took immediately
prior to the restore.
What's that? You don't have one? Well, why not?
Chalk this one up as a lesson learned.
Really, there's no way without another backup
that was taken just prior to the restore.
|||Hi,
No you cant do a recovery back if you restore a full database backup.
Here after please do a backup and keep yourself safe before restoring.
Thanks
Hari
SQL Server MVP
"Paul" <Paul@.discussions.microsoft.com> wrote in message
news:9A8E7FFE-2DFA-4FAC-AE0F-2BB8BF026E1C@.microsoft.com...
> Hi just wondering if there is anyway to roll back a database? For example
> the last time the database was backed up say 3 months ago and a restore
> was
> done yesterday. Just wondering if there is anyway to undo the restore?
> Thanks.
> --
> Paul G
> Software engineer.
sql

any way to rollback dbase

Hi just wondering if there is anyway to roll back a database? For example
the last time the database was backed up say 3 months ago and a restore was
done yesterday. Just wondering if there is anyway to undo the restore?
Thanks.
--
Paul G
Software engineer.No, a database restore can't be undone because all data in the target are
replaced during the restore.
Hope this helps.
Dan Guzman
SQL Server MVP
"Paul" <Paul@.discussions.microsoft.com> wrote in message
news:9A8E7FFE-2DFA-4FAC-AE0F-2BB8BF026E1C@.microsoft.com...
> Hi just wondering if there is anyway to roll back a database? For example
> the last time the database was backed up say 3 months ago and a restore
> was
> done yesterday. Just wondering if there is anyway to undo the restore?
> Thanks.
> --
> Paul G
> Software engineer.|||"Paul" <Paul@.discussions.microsoft.com> wrote in message
news:9A8E7FFE-2DFA-4FAC-AE0F-2BB8BF026E1C@.microsoft.com...
> Hi just wondering if there is anyway to roll back a database? For example
> the last time the database was backed up say 3 months ago and a restore
> was
> done yesterday. Just wondering if there is anyway to undo the restore?
> Thanks.
> --
> Paul G
> Software engineer.
Sure -- this can be easily done.
Assuming you have a backup you took immediately
prior to the restore.
What's that? You don't have one? Well, why not?
Chalk this one up as a lesson learned.
Really, there's no way without another backup
that was taken just prior to the restore.|||Hi,
No you cant do a recovery back if you restore a full database backup.
Here after please do a backup and keep yourself safe before restoring.
Thanks
Hari
SQL Server MVP
"Paul" <Paul@.discussions.microsoft.com> wrote in message
news:9A8E7FFE-2DFA-4FAC-AE0F-2BB8BF026E1C@.microsoft.com...
> Hi just wondering if there is anyway to roll back a database? For example
> the last time the database was backed up say 3 months ago and a restore
> was
> done yesterday. Just wondering if there is anyway to undo the restore?
> Thanks.
> --
> Paul G
> Software engineer.

any way to rollback dbase

Hi just wondering if there is anyway to roll back a database? For example
the last time the database was backed up say 3 months ago and a restore was
done yesterday. Just wondering if there is anyway to undo the restore?
Thanks.
--
Paul G
Software engineer.No, a database restore can't be undone because all data in the target are
replaced during the restore.
--
Hope this helps.
Dan Guzman
SQL Server MVP
"Paul" <Paul@.discussions.microsoft.com> wrote in message
news:9A8E7FFE-2DFA-4FAC-AE0F-2BB8BF026E1C@.microsoft.com...
> Hi just wondering if there is anyway to roll back a database? For example
> the last time the database was backed up say 3 months ago and a restore
> was
> done yesterday. Just wondering if there is anyway to undo the restore?
> Thanks.
> --
> Paul G
> Software engineer.|||"Paul" <Paul@.discussions.microsoft.com> wrote in message
news:9A8E7FFE-2DFA-4FAC-AE0F-2BB8BF026E1C@.microsoft.com...
> Hi just wondering if there is anyway to roll back a database? For example
> the last time the database was backed up say 3 months ago and a restore
> was
> done yesterday. Just wondering if there is anyway to undo the restore?
> Thanks.
> --
> Paul G
> Software engineer.
Sure -- this can be easily done.
Assuming you have a backup you took immediately
prior to the restore.
What's that? You don't have one? Well, why not?
Chalk this one up as a lesson learned.
Really, there's no way without another backup
that was taken just prior to the restore.|||Hi,
No you cant do a recovery back if you restore a full database backup.
Here after please do a backup and keep yourself safe before restoring.
Thanks
Hari
SQL Server MVP
"Paul" <Paul@.discussions.microsoft.com> wrote in message
news:9A8E7FFE-2DFA-4FAC-AE0F-2BB8BF026E1C@.microsoft.com...
> Hi just wondering if there is anyway to roll back a database? For example
> the last time the database was backed up say 3 months ago and a restore
> was
> done yesterday. Just wondering if there is anyway to undo the restore?
> Thanks.
> --
> Paul G
> Software engineer.

2012年3月19日星期一

Any way to create one subscription which delivers server email and file share at the same time?

Hi,

I need to know if it's possible to send out a notification email and deliver the report by file share with one subscription or at least send out a notification email depending on the event of a subscription which delivers the report file share.

My goal is not to have 2 separate subscriptions.

Thanks

You will need to have your own delivery extension created for this,as there is no composing of different delivery methods. But as the classes already exists for those two method you can just call that within your own extension.

HTH, jens Suessmeyer.

http://www.sqlserver2005.de|||

Hi Jens,

thanks for you reply.

If you don't mind, could you please explain your reply in details....I'm not sure about the delivery extension you mentioned.

I'm not an expert as you.

thanks again

Bo

|||

Good question...

So, how to create delivery extension ? Do anybody know place where it's possible to read something about how create it?

Thanks,

2012年3月11日星期日

Any unique datetime's in SQL2005?

Once upon a time, some version of SQLServer was supposed to do
timestamps as datetimes, so you could have a guaranteed unique token
that decoded to a real date/time. I believe this was supposed to be
the ANSI standard for SQL as well.
Has this yet been delivered in SQL2005?
(I think not, but am not certain, and would like to have it for
something I'm doing right now! I should have SQL2005 loaded here in a
few days, but thanks in advance for any answer to this. btw, I don't
see the SQL2005 documentation yet online at MSDN.microsoft.com)
J.No.
Adam Machanic
Pro SQL Server 2005, available now
http://www.apress.com/book/bookDisplay.html?bID=457
--
"jxstern" <jxstern@.nowhere.xyz> wrote in message
news:quqpo15ejq4biu6cgsg2nkiedr92dinok1@.
4ax.com...
> Once upon a time, some version of SQLServer was supposed to do
> timestamps as datetimes, so you could have a guaranteed unique token
> that decoded to a real date/time. I believe this was supposed to be
> the ANSI standard for SQL as well.
> Has this yet been delivered in SQL2005?
> (I think not, but am not certain, and would like to have it for
> something I'm doing right now! I should have SQL2005 loaded here in a
> few days, but thanks in advance for any answer to this. btw, I don't
> see the SQL2005 documentation yet online at MSDN.microsoft.com)
> J.
>

Any unique datetime's in SQL2005?

Once upon a time, some version of SQLServer was supposed to do
timestamps as datetimes, so you could have a guaranteed unique token
that decoded to a real date/time. I believe this was supposed to be
the ANSI standard for SQL as well.
Has this yet been delivered in SQL2005?
(I think not, but am not certain, and would like to have it for
something I'm doing right now! I should have SQL2005 loaded here in a
few days, but thanks in advance for any answer to this. btw, I don't
see the SQL2005 documentation yet online at MSDN.microsoft.com)
J.No. :(
Adam Machanic
Pro SQL Server 2005, available now
http://www.apress.com/book/bookDisplay.html?bID=457
--
"jxstern" <jxstern@.nowhere.xyz> wrote in message
news:quqpo15ejq4biu6cgsg2nkiedr92dinok1@.4ax.com...
> Once upon a time, some version of SQLServer was supposed to do
> timestamps as datetimes, so you could have a guaranteed unique token
> that decoded to a real date/time. I believe this was supposed to be
> the ANSI standard for SQL as well.
> Has this yet been delivered in SQL2005?
> (I think not, but am not certain, and would like to have it for
> something I'm doing right now! I should have SQL2005 loaded here in a
> few days, but thanks in advance for any answer to this. btw, I don't
> see the SQL2005 documentation yet online at MSDN.microsoft.com)
> J.
>

Any unique datetime's in SQL2005?

Once upon a time, some version of SQLServer was supposed to do
timestamps as datetimes, so you could have a guaranteed unique token
that decoded to a real date/time. I believe this was supposed to be
the ANSI standard for SQL as well.
Has this yet been delivered in SQL2005?
(I think not, but am not certain, and would like to have it for
something I'm doing right now! I should have SQL2005 loaded here in a
few days, but thanks in advance for any answer to this. btw, I don't
see the SQL2005 documentation yet online at MSDN.microsoft.com)
J.
No.
Adam Machanic
Pro SQL Server 2005, available now
http://www.apress.com/book/bookDisplay.html?bID=457
"jxstern" <jxstern@.nowhere.xyz> wrote in message
news:quqpo15ejq4biu6cgsg2nkiedr92dinok1@.4ax.com...
> Once upon a time, some version of SQLServer was supposed to do
> timestamps as datetimes, so you could have a guaranteed unique token
> that decoded to a real date/time. I believe this was supposed to be
> the ANSI standard for SQL as well.
> Has this yet been delivered in SQL2005?
> (I think not, but am not certain, and would like to have it for
> something I'm doing right now! I should have SQL2005 loaded here in a
> few days, but thanks in advance for any answer to this. btw, I don't
> see the SQL2005 documentation yet online at MSDN.microsoft.com)
> J.
>

Any Timeout setting in ConnectionString of web.config

Hi:

I have some query that takes quite a long time to process in the sql server and every time the page seems to time out.

I wondor is there any Timeout setting that I can defined in the database ConnectionString in web.config file so that I can extend the "wait" time?

Many thanks!

I believe there is:

"integrated security=SSPI;SERVER=YOUR_SERVER;DATABASE=YOUR_DB_NAME;Connect Timeout=45;";

|||

Jason,

I recently had a time out issue with an app after some servers where moved to a centralized location. In my case, the use of the sql server name caused my app to time out as apparently the newly located web server wasn't able to resolve the sql server name in the web.config file fast enough against the WINS server. The solution was to use our sql server's IP address in web.congif file instead of it's name. Then the app ran just fine.

Time outs can definitely be network related. Need to look at that as well as any app configuring.

|||

Unfortunately not Jason. The timeout in the connection string only controls the timeout of the connection (How long the connection will wait before giving up), normally it's irrelevant as you'll get a (fairly) quick negative response.

That said, in your pages where the default 30 second command timeout is too short, in your SqlDataSource_Selecting/Inserting events, the e parameter will have a reference to the actualy SqlCommand object that is about to be used. Set it's timeout. Off the top of my head, I believe it is like:

e.SelectCommand.Timeout=90

That is assuming that you are having the issue with a SqlDataSource. SqlCommand objects have their own timeout parameter that you can set if that is what you are using and having an issue with.

|||

Actually, e.Command.CommandTimeout=90

2012年3月8日星期四

any simple tool to monitor the execution time of running sql at the database?

as subject
Use Profiler. See SQL Server Books Online for more information.
Also see:
How to identify SQL Server performance issues, by analyzing Profiler output?
http://vyaskn.tripod.com/analyzing_profiler_output.htm
Automating Server Side Tracing in SQL Server
http://vyaskn.tripod.com/server_side...sql_server.htm
HTH,
Vyas, MVP (SQL Server)
http://vyaskn.tripod.com/
"Mullin Yu" <mullin_yu@.ctil.com> wrote in message
news:ePPmY8wlEHA.536@.TK2MSFTNGP11.phx.gbl...
as subject
|||Profiler?
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"Mullin Yu" <mullin_yu@.ctil.com> wrote in message news:ePPmY8wlEHA.536@.TK2MSFTNGP11.phx.gbl...
> as subject
>

any simple tool to monitor the execution time of running sql at the database?

as subjectUse Profiler. See SQL Server Books Online for more information.
Also see:
How to identify SQL Server performance issues, by analyzing Profiler output?
http://vyaskn.tripod.com/analyzing_profiler_output.htm
Automating Server Side Tracing in SQL Server
http://vyaskn.tripod.com/server_side_tracing_in_sql_server.htm
--
HTH,
Vyas, MVP (SQL Server)
http://vyaskn.tripod.com/
"Mullin Yu" <mullin_yu@.ctil.com> wrote in message
news:ePPmY8wlEHA.536@.TK2MSFTNGP11.phx.gbl...
as subject|||Profiler?
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"Mullin Yu" <mullin_yu@.ctil.com> wrote in message news:ePPmY8wlEHA.536@.TK2MSFTNGP11.phx.gbl...
> as subject
>

Any side effects from backing up DB and log at the same time?

Hi,
Do you know of any other possible dangers, apart from transaction log backup
not being made and waiting for the full DB backup to complete, when letting
the transaction log backup run during the full DB backup?
What else besides the failing transaction log backup can happen when making
the backup during the time the database is in simple recovery mode?
-- Many, thanks. Oskar.
in simple rm t-log backup useless
"Oskar" <Oskar@.discussions.microsoft.com> wrote in message
news:4B5DCB3A-80B3-4E06-9633-9E6886BD9273@.microsoft.com...
> Hi,
> Do you know of any other possible dangers, apart from transaction log
> backup
> not being made and waiting for the full DB backup to complete, when
> letting
> the transaction log backup run during the full DB backup?
> What else besides the failing transaction log backup can happen when
> making
> the backup during the time the database is in simple recovery mode?
> -- Many, thanks. Oskar.

Any side effects from backing up DB and log at the same time?

Hi,
Do you know of any other possible dangers, apart from transaction log backup
not being made and waiting for the full DB backup to complete, when letting
the transaction log backup run during the full DB backup?
What else besides the failing transaction log backup can happen when making
the backup during the time the database is in simple recovery mode?
-- Many, thanks. Oskar.in simple rm t-log backup useless
"Oskar" <Oskar@.discussions.microsoft.com> wrote in message
news:4B5DCB3A-80B3-4E06-9633-9E6886BD9273@.microsoft.com...
> Hi,
> Do you know of any other possible dangers, apart from transaction log
> backup
> not being made and waiting for the full DB backup to complete, when
> letting
> the transaction log backup run during the full DB backup?
> What else besides the failing transaction log backup can happen when
> making
> the backup during the time the database is in simple recovery mode?
> -- Many, thanks. Oskar.

Any side effects from backing up DB and log at the same time?

Hi,
Do you know of any other possible dangers, apart from transaction log backup
not being made and waiting for the full DB backup to complete, when letting
the transaction log backup run during the full DB backup?
What else besides the failing transaction log backup can happen when making
the backup during the time the database is in simple recovery mode?
-- Many, thanks. Oskar.in simple rm t-log backup useless
"Oskar" <Oskar@.discussions.microsoft.com> wrote in message
news:4B5DCB3A-80B3-4E06-9633-9E6886BD9273@.microsoft.com...
> Hi,
> Do you know of any other possible dangers, apart from transaction log
> backup
> not being made and waiting for the full DB backup to complete, when
> letting
> the transaction log backup run during the full DB backup?
> What else besides the failing transaction log backup can happen when
> making
> the backup during the time the database is in simple recovery mode?
> -- Many, thanks. Oskar.

Any recommendation for a good DBA tool.

Hi All
I looking for a good DBA tool to view the REAL TIME performance of my
databases especially the stored procedures. Anyone with recommendations
please help? Thank you in advance.Hi, Maybe Spotlight from Quest Software
"MittyKom" wrote:

> Hi All
> I looking for a good DBA tool to view the REAL TIME performance of my
> databases especially the stored procedures. Anyone with recommendations
> please help? Thank you in advance.
>|||I'm currently evaluating Quest Spotlight for SQL Server. I've evaluated a
few different offerings and I like this one the best. Additional
performance tools can be purchased as a suite (Quest Central) or as
indiviual components.
HTH
Jerry
"MittyKom" <MittyKom@.discussions.microsoft.com> wrote in message
news:302F5C4A-ED69-4175-A26C-C4E84BDF64A4@.microsoft.com...
> Hi All
> I looking for a good DBA tool to view the REAL TIME performance of my
> databases especially the stored procedures. Anyone with recommendations
> please help? Thank you in advance.
>|||What you want to get from the performance. I use Profiler to mornitor any
SP or ad hoc query that run more than 1 minues. If I found one, then I will
try to optimize the SQL statement. Why am I doing this? because I am a new
DBA, and most of our database design were done by a consultant firm. And I
found that a lot of SP were done terriblely.
Perayu
"MittyKom" <MittyKom@.discussions.microsoft.com> wrote in message
news:302F5C4A-ED69-4175-A26C-C4E84BDF64A4@.microsoft.com...
> Hi All
> I looking for a good DBA tool to view the REAL TIME performance of my
> databases especially the stored procedures. Anyone with recommendations
> please help? Thank you in advance.
>

Any recommendation for a good DBA tool.

Hi All
I looking for a good DBA tool to view the REAL TIME performance of my
databases especially the stored procedures. Anyone with recommendations
please help? Thank you in advance.
Hi, Maybe Spotlight from Quest Software
"MittyKom" wrote:

> Hi All
> I looking for a good DBA tool to view the REAL TIME performance of my
> databases especially the stored procedures. Anyone with recommendations
> please help? Thank you in advance.
>
|||I'm currently evaluating Quest Spotlight for SQL Server. I've evaluated a
few different offerings and I like this one the best. Additional
performance tools can be purchased as a suite (Quest Central) or as
indiviual components.
HTH
Jerry
"MittyKom" <MittyKom@.discussions.microsoft.com> wrote in message
news:302F5C4A-ED69-4175-A26C-C4E84BDF64A4@.microsoft.com...
> Hi All
> I looking for a good DBA tool to view the REAL TIME performance of my
> databases especially the stored procedures. Anyone with recommendations
> please help? Thank you in advance.
>
|||What you want to get from the performance. I use Profiler to mornitor any
SP or ad hoc query that run more than 1 minues. If I found one, then I will
try to optimize the SQL statement. Why am I doing this? because I am a new
DBA, and most of our database design were done by a consultant firm. And I
found that a lot of SP were done terriblely.
Perayu
"MittyKom" <MittyKom@.discussions.microsoft.com> wrote in message
news:302F5C4A-ED69-4175-A26C-C4E84BDF64A4@.microsoft.com...
> Hi All
> I looking for a good DBA tool to view the REAL TIME performance of my
> databases especially the stored procedures. Anyone with recommendations
> please help? Thank you in advance.
>

Any recommendation for a good DBA tool.

Hi All
I looking for a good DBA tool to view the REAL TIME performance of my
databases especially the stored procedures. Anyone with recommendations
please help? Thank you in advance.Hi, Maybe Spotlight from Quest Software
"MittyKom" wrote:
> Hi All
> I looking for a good DBA tool to view the REAL TIME performance of my
> databases especially the stored procedures. Anyone with recommendations
> please help? Thank you in advance.
>|||I'm currently evaluating Quest Spotlight for SQL Server. I've evaluated a
few different offerings and I like this one the best. Additional
performance tools can be purchased as a suite (Quest Central) or as
indiviual components.
HTH
Jerry
"MittyKom" <MittyKom@.discussions.microsoft.com> wrote in message
news:302F5C4A-ED69-4175-A26C-C4E84BDF64A4@.microsoft.com...
> Hi All
> I looking for a good DBA tool to view the REAL TIME performance of my
> databases especially the stored procedures. Anyone with recommendations
> please help? Thank you in advance.
>|||What you want to get from the performance. I use Profiler to mornitor any
SP or ad hoc query that run more than 1 minues. If I found one, then I will
try to optimize the SQL statement. Why am I doing this? because I am a new
DBA, and most of our database design were done by a consultant firm. And I
found that a lot of SP were done terriblely.
Perayu
"MittyKom" <MittyKom@.discussions.microsoft.com> wrote in message
news:302F5C4A-ED69-4175-A26C-C4E84BDF64A4@.microsoft.com...
> Hi All
> I looking for a good DBA tool to view the REAL TIME performance of my
> databases especially the stored procedures. Anyone with recommendations
> please help? Thank you in advance.
>

2012年3月6日星期二

Any query to return the execution time for another query?

Hi,
I prefer a query. Otherwise, a stored procedure will do.
Thank you in advance for enlightening me.
PradeepTry:
declare @.start datetime
set @.start = getdate()
-- do your query here
print datediff (ms, @.star, getdate())
Tom
----
Thomas A. Moreau, BSc, PhD, MCSE, MCDBA
SQL Server MVP
Columnist, SQL Server Professional
Toronto, ON Canada
www.pinpub.com
.
"Pradeep" <pradeep@.tapadiya.net> wrote in message
news:1142815296.712493.28970@.i39g2000cwa.googlegroups.com...
Hi,
I prefer a query. Otherwise, a stored procedure will do.
Thank you in advance for enlightening me.
Pradeep|||Pradeep (pradeep@.tapadiya.net) writes:
> I prefer a query. Otherwise, a stored procedure will do.
> Thank you in advance for enlightening me.
In additions to Tom's suggestion, you can also use SET STATISTICS TIME ON.
However, I prefer using getdate() as Tom's example. After all, what
matters at the end of they day, is the wallclock time for a query.
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