Showing posts with label regards. Show all posts
Showing posts with label regards. Show all posts

Monday, March 12, 2012

How to list (Export to txt) the Built-In and User Store Procedures

Good afternoon,
How can I export a list of Built-In and User Made Stored Procedures on an
SQL-2005 server ?
Regards,
LuisHi
How about querying sys.objects? If you want to do this manually save the
output from SSMS or use output option for SQLCMD, or use a query with BCP!
John
"gatox" wrote:
> Good afternoon,
> How can I export a list of Built-In and User Made Stored Procedures on an
> SQL-2005 server ?
> Regards,
> Luis

Sunday, February 19, 2012

How to know how many users are connected to my sql server 2000 and how many resources are

how can i know it? can i do it with sql 2000 tools or i need other kind of
tool?
Regards
RickEXEC master.dbo.sp_who2;
--
Aaron Bertrand
SQL Server MVP
http://www.sqlblog.com/
http://www.aspfaq.com/5006
"Rick" <zatankloz@.gmail.com> wrote in message
news:%23aXjgLGqHHA.2044@.TK2MSFTNGP04.phx.gbl...
> how can i know it? can i do it with sql 2000 tools or i need other kind of
> tool?
> Regards
> Rick
>|||Hello,
For SQL 2000 query the MASTER..SYPROCESSES table. Use the filtering and
group based on your requirement.
For SQL 2005 you could the dynamic management view (DMV)
sys.dm_exec_sessions
SELECT
session_id,login_name,
last_request_end_time,cpu_time
FROM sys.dm_exec_sessions
WHERE session_id >= 51 - All user SessionsSee the below URL for more
details:-
http://www.codeproject.com/useritems/Dynamic_Management_Views.asp
Thanks
Hari
"Rick" <zatankloz@.gmail.com> wrote in message
news:%23aXjgLGqHHA.2044@.TK2MSFTNGP04.phx.gbl...
> how can i know it? can i do it with sql 2000 tools or i need other kind of
> tool?
> Regards
> Rick
>

how to know how many records in each table and output to textfile?

Hi,
Is there a fast way to know how many records in every tables?
--
Thanks a lot!
regards,
florenceleeThis is an approximate rowcount, depending on when SQL Server last updated
its statistics, but it's fast.
SELECT OBJECT_NAME(id), rowcnt FROM sysindexes WHERE indid IN (0, 1) ORDER
BY 1
On the output, you could just copy/paste in Query Analyzer, or set up a
command line task and redirect the output to a file e.g.
osql -E -d <dbname> -Q "SELECT ...." > TableRowCount.txt
--
Peter Yeoh
http://www.yohz.com
Need smaller SQL2K backup files? Use MiniSQLBackup Lite, free!
"Florencelee" <florencelee@.visualsolutions.com.my> wrote in message
news:e7YZ39o0EHA.4004@.tk2msftngp13.phx.gbl...
> Hi,
> Is there a fast way to know how many records in every tables?
> --
> Thanks a lot!
> regards,
> florencelee
>|||florencelee,
Or if you want accurate info use this query:
exec sp_msforeachtable 'select ''?'' as tablename, count(*) as
[rowcount] from ?'
Note: if your tables are large this query will take significant amount
of time.
--
Mark Allison, SQL Server MVP
http://www.markallison.co.uk
Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602m.html
Peter Yeoh wrote:
> This is an approximate rowcount, depending on when SQL Server last updated
> its statistics, but it's fast.
> SELECT OBJECT_NAME(id), rowcnt FROM sysindexes WHERE indid IN (0, 1) ORDER
> BY 1
> On the output, you could just copy/paste in Query Analyzer, or set up a
> command line task and redirect the output to a file e.g.
> osql -E -d <dbname> -Q "SELECT ...." > TableRowCount.txt
>