MS SQL Get Object Count Number of Tables Procedures Views Functions

January 24, 2012

0

/* specify the database to use, example below “ABCDB” means the ABCDB database use ABCDB /* Count Number Of Tables In A Database */ SELECT COUNT(*) AS TABLE_COUNT FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_TYPE=’BASE TABLE’ /* Count Number Of Views In A Database */ SELECT COUNT(*) AS VIEW_COUNT FROM INFORMATION_SCHEMA.VIEWS /* Count Number Of Stored Procedures In […]

Posted in: MSSQL, SQL, SQL Server, T-SQL

What’s it all about?

January 19, 2012

0

Welcome! In the past 10 or so years of web design, development and database work I’ve compiled endless links, references, examples, and notes saved and stored in various formats all over the web, my laptops, backup drives and post-it notes that I will attempt to slowly consolidate into this blog so that 1) I have […]

Posted in: Uncategorized

Oracle Total Number of Records in ALL TABLES of a schema

January 18, 2012

0

— Note: only works if the ALL_TABLES object is up to date – read up on the ALL_TABLES first SELECT sum(num_rows) FROM all_tables WHERE owner LIKE ‘MyObjectOwnerName’

Posted in: Oracle, PL/SQL, SQL

Display Oracle Function or Package OUTPUT when executed

January 18, 2012

0

You can display your own custom comments, debug information or output from a function or package by specifying the output using DBMS_OUTPUT() If you’re running the code and not seeing the output when executing a command start by running “set serveroutput on feedback off;” end by running “set serveroutput off feedback on;”

Posted in: Oracle, PL/SQL, SQL, SQLPlus

SQLPlus or command line CONNECT to Oracle

January 18, 2012

0

connect userid/password@dbname

Posted in: Oracle, PL/SQL, SQL

Oracle connect to or SELECT FROM table in another database

January 18, 2012

0

You must first create a “Database Link”, which is a schema object that allows you to access objects in one database, from another. The example below assumes you have already created a database link that allows adequate permissions. Let’s assume you have two Oracle database instances, one named PROD which contains your live production data, […]

Posted in: Oracle, PL/SQL, SQL, SQLPlus

Oracle Export using EXP

January 18, 2012

0

exp user/pswd@mySchema exp USER/PSWD@mySchema file=c:\temp\DBNAME_20080806.dmp exp scott/tiger file=mySchema.dmp log=mySchema.log tables=mySchema rows=yes indexes=no

Tagged: , ,
Posted in: Oracle, PL/SQL, SQL, SQLPlus

.Net Convert date to Oracle friendly date

January 18, 2012

0

Dim strDate as Date = “1/5/03” Dim strOracleDate as String = strDate.ToString(“dd-MMM-yy”).ToUpper()  

Posted in: .Net, ASP.Net, Oracle, SQL, T-SQL, VB.Net

Where to check Oracle object Permissions

January 18, 2012

0

Search for Oracle permission in the following tables, if you have access: DBA_ROLES DBA_SYS_PRIVS DBA_TAB_PRIVS

Posted in: Oracle

UPDATE FROM…Oracle and MSSQL Examples

January 18, 2012

0

UPDATE FROM ** SQL version *** UPDATE erp.rse SET expardesc = r.expardesc || ‘ – ‘ || p.parname FROM erp.rse r INNER JOIN erp.omqc_paramdesc p ON p.rsid = r.rsid AND r.rtype = ‘PSVP’ *** Oracle vesrion *** UPDATE erp.rse SET rse.expardesc = rse.expardesc || ‘ – ‘ || (SELECT p.parname FROM erp.omqc_paramdesc p WHERE p.exparid […]