Showing posts with label procedures. Show all posts
Showing posts with label procedures. Show all posts

Wednesday, March 28, 2012

How to get the results when executing extended stored procedures.

Hi. Does anyone know how to display the results if i execute "xp_fixeddrives, xp_availablemedia and xp_subdirs" commands with VC++ 6.0? I can't obtained the results using Recordset class. Can someone help me? Thank you.

|_N_T_|

See if the following works for you:

create table #FreeSpace(

Drive char(1),

MB_Free int)

insert into #FreeSpace exec xp_fixeddrives

select * from #freespace

|||

For some reason, that didn't work for me but this did:

Declare @.FreeSpace TABLE (

Drive char(1),

MB_Free int)

insert into @.FreeSpace exec xp_fixeddrives

select * from @.freespace

Go figure...

How to get the results when executing extended stored procedures.

Hi. Does anyone know how to display the results if i execute "xp_fixeddrives, xp_availablemedia and xp_subdirs" commands with VC++ 6.0? I can't obtained the results using Recordset class. Can someone help me? Thank you.

|_N_T_|

See if the following works for you:

create table #FreeSpace(

Drive char(1),

MB_Free int)

insert into #FreeSpace exec xp_fixeddrives

select * from #freespace

|||

For some reason, that didn't work for me but this did:

Declare @.FreeSpace TABLE (

Drive char(1),

MB_Free int)

insert into @.FreeSpace exec xp_fixeddrives

select * from @.freespace

Go figure...

Monday, March 12, 2012

How to get running stored procs

Is there a script I can run that identifies the stored procedures that
are running NOW?
Regards
On Jun 7, 4:24 am, Frank Rizzo <n...@.none.com> wrote:
> Is there a script I can run that identifies the stored procedures that
> are running NOW?
> Regards
sql profiler show you the current proceses.
|||Hello Frank,
You may need to use the SQL Profiler to track the running stored procedure.
Sincerely,
Wei Lu
Microsoft Online Community Support
==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
|||On Jun 7, 3:24 am, Frank Rizzo <n...@.none.com> wrote:
> Is there a script I can run that identifies the stored procedures that
> are running NOW?
> Regards
Check Erland's website
http://www.sommarskog.se/sqlutil/aba_lockinfo.html
you can use this
|||Execute the profiler and in event selection select "Stored procedures and
select the check box "RPC Completed". After specific time save the contents
into a table and filter it out.
Thanks
Hari
"Frank Rizzo" <none@.none.com> wrote in message
news:OpVP9lIqHHA.3888@.TK2MSFTNGP05.phx.gbl...
> Is there a script I can run that identifies the stored procedures that are
> running NOW?
> Regards
|||Hi ,
How is everything going? Please feel free to let me know if you need any
assistance.
Sincerely,
Wei Lu
Microsoft Online Community Support
==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.

How to get running stored procs

Is there a script I can run that identifies the stored procedures that
are running NOW?
RegardsOn Jun 7, 4:24 am, Frank Rizzo <n...@.none.com> wrote:
> Is there a script I can run that identifies the stored procedures that
> are running NOW?
> Regards
sql profiler show you the current proceses.|||Hello Frank,
You may need to use the SQL Profiler to track the running stored procedure.
Sincerely,
Wei Lu
Microsoft Online Community Support
==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================This posting is provided "AS IS" with no warranties, and confers no rights.|||On Jun 7, 3:24 am, Frank Rizzo <n...@.none.com> wrote:
> Is there a script I can run that identifies the stored procedures that
> are running NOW?
> Regards
Check Erland's website
http://www.sommarskog.se/sqlutil/aba_lockinfo.html
you can use this|||Execute the profiler and in event selection select "Stored procedures and
select the check box "RPC Completed". After specific time save the contents
into a table and filter it out.
Thanks
Hari
"Frank Rizzo" <none@.none.com> wrote in message
news:OpVP9lIqHHA.3888@.TK2MSFTNGP05.phx.gbl...
> Is there a script I can run that identifies the stored procedures that are
> running NOW?
> Regards|||Hi ,
How is everything going? Please feel free to let me know if you need any
assistance.
Sincerely,
Wei Lu
Microsoft Online Community Support
==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================This posting is provided "AS IS" with no warranties, and confers no rights.

How to get running stored procs

Is there a script I can run that identifies the stored procedures that
are running NOW?
RegardsOn Jun 7, 4:24 am, Frank Rizzo <n...@.none.com> wrote:
> Is there a script I can run that identifies the stored procedures that
> are running NOW?
> Regards
sql profiler show you the current proceses.|||Hello Frank,
You may need to use the SQL Profiler to track the running stored procedure.
Sincerely,
Wei Lu
Microsoft Online Community Support
========================================
==========
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
========================================
==========
This posting is provided "AS IS" with no warranties, and confers no rights.|||On Jun 7, 3:24 am, Frank Rizzo <n...@.none.com> wrote:
> Is there a script I can run that identifies the stored procedures that
> are running NOW?
> Regards
Check Erland's website
http://www.sommarskog.se/sqlutil/aba_lockinfo.html
you can use this|||Execute the profiler and in event selection select "Stored procedures and
select the check box "RPC Completed". After specific time save the contents
into a table and filter it out.
Thanks
Hari
"Frank Rizzo" <none@.none.com> wrote in message
news:OpVP9lIqHHA.3888@.TK2MSFTNGP05.phx.gbl...
> Is there a script I can run that identifies the stored procedures that are
> running NOW?
> Regards|||Hi ,
How is everything going? Please feel free to let me know if you need any
assistance.
Sincerely,
Wei Lu
Microsoft Online Community Support
========================================
==========
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
========================================
==========
This posting is provided "AS IS" with no warranties, and confers no rights.

Wednesday, March 7, 2012

How to get number of transactions from log ?

Is there way to get the number of transactions from the SQL Server log, by
using some extended procedures ?
-NagsNags wrote:
> Is there way to get the number of transactions from the SQL Server
> log, by using some extended procedures ?
You may view the transaction log contents by executing:|||Nags wrote:
> Is there way to get the number of transactions from the SQL Server
> log, by using some extended procedures ?
You may view the log contents by executing DBCC log, but I don't know if it
works for you. See for yourself:
DBCC log ( {dbid|dbname}, [, type={0|1|2|3|4}] )
PARAMETERS:
Dbid or dbname - Enter either the dbid or the name of the database in
question.
type - is the type of output:
0 - minimum information (operation, context, transaction id)
1 - more information (plus flags, tags, row length)
2 - very detailed information (plus object name, index name, page id, slot
id)
3 - full information about each operation
4 - full information about each operation plus hexadecimal dump of the
current transaction log's row.
by default type = 0
To view the transaction log for the master database, you can use the
following command:
DBCC log (master)
sincerely,
--
Sebastian K. Zaklada
Skilled Software
http://www.skilledsoftware.com
This posting is provided "AS IS" with no warranties, and confers no rights.

How to get names of all databases using sql statements?

How can i get names of all databases using sql statements or system stored procedures? Thanks in advance!How can i get names of all databases using sql statements or system stored procedures? Thanks in advance!

try this:
select name from master..sysdatabases|||I tried and the result is very good. Thanks a lot

how to get names and types of parameters of stored procedure

Hi everybody!
I need to get names and types of parameters of stored procedures from some
system tables.
( not from SQLDMO object ) . Does somebody know in what system table(s)
these data stored?
ThanksYou can find this information in the information_schema.parameters view.
--
Jacco Schalkwijk
SQL Server MVP
"Leo" <Leo@.discussions.microsoft.com> wrote in message
news:D7FE4664-3595-4EC7-8EE3-C453B4823E74@.microsoft.com...
> Hi everybody!
> I need to get names and types of parameters of stored procedures from
> some
> system tables.
> ( not from SQLDMO object ) . Does somebody know in what system table(s)
> these data stored?
> Thanks
>|||There is also a stored procedure, sp_proc_columns, I believe, that will
parse out that information for you.
Sincerely,
Anthony Thomas
"Jacco Schalkwijk" <jacco.please.reply@.to.newsgroups.mvps.org.invalid> wrote
in message news:%23dhtDeB6EHA.1564@.TK2MSFTNGP09.phx.gbl...
You can find this information in the information_schema.parameters view.
--
Jacco Schalkwijk
SQL Server MVP
"Leo" <Leo@.discussions.microsoft.com> wrote in message
news:D7FE4664-3595-4EC7-8EE3-C453B4823E74@.microsoft.com...
> Hi everybody!
> I need to get names and types of parameters of stored procedures from
> some
> system tables.
> ( not from SQLDMO object ) . Does somebody know in what system table(s)
> these data stored?
> Thanks
>|||Thanks to both of you :)
"AnthonyThomas" wrote:
> There is also a stored procedure, sp_proc_columns, I believe, that will
> parse out that information for you.
> Sincerely,
>
> Anthony Thomas
>
> --
> "Jacco Schalkwijk" <jacco.please.reply@.to.newsgroups.mvps.org.invalid> wrote
> in message news:%23dhtDeB6EHA.1564@.TK2MSFTNGP09.phx.gbl...
> You can find this information in the information_schema.parameters view.
> --
> Jacco Schalkwijk
> SQL Server MVP
>
> "Leo" <Leo@.discussions.microsoft.com> wrote in message
> news:D7FE4664-3595-4EC7-8EE3-C453B4823E74@.microsoft.com...
> > Hi everybody!
> >
> > I need to get names and types of parameters of stored procedures from
> > some
> > system tables.
> > ( not from SQLDMO object ) . Does somebody know in what system table(s)
> > these data stored?
> >
> > Thanks
> >
> >
>
>

how to get names and types of parameters of stored procedure

Hi everybody!
I need to get names and types of parameters of stored procedures from some
system tables.
( not from SQLDMO object ) . Does somebody know in what system table(s)
these data stored?
Thanks
You can find this information in the information_schema.parameters view.
Jacco Schalkwijk
SQL Server MVP
"Leo" <Leo@.discussions.microsoft.com> wrote in message
news:D7FE4664-3595-4EC7-8EE3-C453B4823E74@.microsoft.com...
> Hi everybody!
> I need to get names and types of parameters of stored procedures from
> some
> system tables.
> ( not from SQLDMO object ) . Does somebody know in what system table(s)
> these data stored?
> Thanks
>
|||There is also a stored procedure, sp_proc_columns, I believe, that will
parse out that information for you.
Sincerely,
Anthony Thomas

"Jacco Schalkwijk" <jacco.please.reply@.to.newsgroups.mvps.org.invalid > wrote
in message news:%23dhtDeB6EHA.1564@.TK2MSFTNGP09.phx.gbl...
You can find this information in the information_schema.parameters view.
Jacco Schalkwijk
SQL Server MVP
"Leo" <Leo@.discussions.microsoft.com> wrote in message
news:D7FE4664-3595-4EC7-8EE3-C453B4823E74@.microsoft.com...
> Hi everybody!
> I need to get names and types of parameters of stored procedures from
> some
> system tables.
> ( not from SQLDMO object ) . Does somebody know in what system table(s)
> these data stored?
> Thanks
>
|||Thanks to both of you
"AnthonyThomas" wrote:

> There is also a stored procedure, sp_proc_columns, I believe, that will
> parse out that information for you.
> Sincerely,
>
> Anthony Thomas
>
> --
> "Jacco Schalkwijk" <jacco.please.reply@.to.newsgroups.mvps.org.invalid > wrote
> in message news:%23dhtDeB6EHA.1564@.TK2MSFTNGP09.phx.gbl...
> You can find this information in the information_schema.parameters view.
> --
> Jacco Schalkwijk
> SQL Server MVP
>
> "Leo" <Leo@.discussions.microsoft.com> wrote in message
> news:D7FE4664-3595-4EC7-8EE3-C453B4823E74@.microsoft.com...
>
>

Friday, February 24, 2012

How to get invalid stored procedures

Hi, All,
Is there any script or command that can get all invalid stored procedures in
SQL Server 7.0/2000. Thanks
JieWhat do you mean by invalid ?
--
HTH
Jasper Smith (SQL Server MVP)
I support PASS - the definitive, global
community for SQL Server professionals -
http://www.sqlpass.org
"J Gao" <jie.gao@.tequilasoftware.com> wrote in message
news:%23GbjhauSDHA.2196@.TK2MSFTNGP12.phx.gbl...
Hi, All,
Is there any script or command that can get all invalid stored procedures in
SQL Server 7.0/2000. Thanks
Jie|||Invalid means there is syntax error in the stored procedures. I would like
to have query to get the all stored procedures that have syntax error with
it instead of going to every stored procedure to check sybtax. Thanks
Jasper.
"Jasper Smith" <jasper_smith9@.hotmail.com> wrote in message
news:OJO%23aJvSDHA.1552@.TK2MSFTNGP10.phx.gbl...
> What do you mean by invalid ?
> --
> HTH
> Jasper Smith (SQL Server MVP)
> I support PASS - the definitive, global
> community for SQL Server professionals -
> http://www.sqlpass.org
> "J Gao" <jie.gao@.tequilasoftware.com> wrote in message
> news:%23GbjhauSDHA.2196@.TK2MSFTNGP12.phx.gbl...
> Hi, All,
> Is there any script or command that can get all invalid stored procedures
in
> SQL Server 7.0/2000. Thanks
>
> Jie
>
>|||A stored procedure cannot be submitted to SQL Server if it is invalid, with
the exception of delayed name resolution. That could be a problem. Or, if
objects that the procedure uses are dropped, then that would invalidate,
although not delete, the procedure.
There is not a way to test this directly that I know of.
What you could do is:
1. Script out all of the stored procedures using DROP / CREATE.
2. Run that script from OSQL using an output file.
3. Examine the output file for errors.
Any procedures with serious syntax errors will not recreate and will now be
missing from your database. You can examine the errors to see what is wrong
should any of them need fixing.
The downside of this is that you don't want to do it during a productive
work period.
Russell Fields
"J Gao" <jie.gao@.tequilasoftware.com> wrote in message
news:uNzatTvSDHA.3188@.tk2msftngp13.phx.gbl...
> Invalid means there is syntax error in the stored procedures. I would like
> to have query to get the all stored procedures that have syntax error with
> it instead of going to every stored procedure to check sybtax. Thanks
> Jasper.
>
> "Jasper Smith" <jasper_smith9@.hotmail.com> wrote in message
> news:OJO%23aJvSDHA.1552@.TK2MSFTNGP10.phx.gbl...
> > What do you mean by invalid ?
> >
> > --
> > HTH
> >
> > Jasper Smith (SQL Server MVP)
> >
> > I support PASS - the definitive, global
> > community for SQL Server professionals -
> > http://www.sqlpass.org
> >
> > "J Gao" <jie.gao@.tequilasoftware.com> wrote in message
> > news:%23GbjhauSDHA.2196@.TK2MSFTNGP12.phx.gbl...
> > Hi, All,
> > Is there any script or command that can get all invalid stored
procedures
> in
> > SQL Server 7.0/2000. Thanks
> >
> >
> > Jie
> >
> >
> >
>|||the only way you can do this is to build a new database
using the scripts created by scripting out your database.
Then you have to worry about dependencies. DB Ghost can do
all of this for you, displaying any syntax errors that may
exist in your database code. It will also show you
dependancy errors that may exist in your code. Both syntax
and dependancy errors can exist in the database code
simply because of inadequate change management. For
example a developer changes a column definition on a table
using an alter statement on that table. However there is a
stored procedure that relies on the original specification
of that column. You now have an error which will only
manifest itself when the stored procedure is next used.
This happens all the time, that's why we use DB Ghost for
our change management as it guarentees the source and the
deployement. Check out www.dbghost.com - it makes a good
read and the app comes with a full help manual.
Mark Baekdal
>--Original Message--
>Hi, All,
>Is there any script or command that can get all invalid
stored procedures in
>SQL Server 7.0/2000. Thanks
>
>Jie
>
>.
>