Posts

SIZE OF TABLES IN SQL SERVER

SELECT t . NAME AS TableName , s . Name AS SchemaName , p . rows AS RowCounts , SUM ( a . total_pages ) * 8 AS TotalSpaceKB , SUM ( a . used_pages ) * 8 AS UsedSpaceKB , ( SUM ( a . total_pages ) - SUM ( a . used_pages )) * 8 AS UnusedSpaceKB FROM sys . tables t INNER JOIN sys . indexes i ON t . OBJECT_ID = i . object_id INNER JOIN sys . partitions p ON i . object_id = p . OBJECT_ID AND i . index_id = p . index_id INNER JOIN sys . allocation_units a ON p . partition_id = a . container_id LEFT OUTER JOIN sys . schemas s ON t . schema_id = s . schema_id WHERE t . NAME NOT LIKE 'dt%' AND t . is_ms_shipped = 0 AND i . OBJECT_ID > 255 GROUP BY t . Name , s . Name , p . Rows ORDER BY t . Name
Image
Elements for IS Auditing An information system is not just a computer. Today's information systems are complex and have many components that piece together to make a business solution. Assurances about an information system can be obtained only if all the components are evaluated and secured. The proverbial weakest link is the total strength of the chain. The major elements of IS audit can be broadly classified: Physical and environmental review —This includes physical security, power supply, air conditioning, humidity control and other environmental factors. System administration review —This includes security review of the operating systems, database management systems, all system administration procedures and compliance. Application software review —The business application could be payroll, invoicing, a web-based customer order processing system or an enterprise resource planning system that actually runs the business. Review of such application software includes acce...

PL/SQL Course Coming soon

Image

CASE Statements in A SQL UPDATE Query

UPDATE [account] SET balance = ( CASE WHEN ((balance - 10.00) < 0) THEN 0 ELSE (balance - 10.00) END ) WHERE condition

DBA /BI Engineer Post

Country: Tanzania City: Dar Es Salaam Qualification A Bachelor’s degree in Computer Engineering, Computer Science, Industrial Engineering/Operations  Mathematics, Management Information Systems. Skills in Database operations, SQL queries, etc Knowledge of best practices and principles for ETL, data modeling, dashboards, report design, analytics, and data mining Strong work ethic Ability to multi-task effectively and be comfortable working in a fast-paced, dynamic environment without close guidance or supervision Strong leadership skills Excellent verbal and written communication skills High degree of attention to detAILS dEADLINE 16/07/2013

Find Last Day of Any Month (SQL Server)

a) Find the last day of the previous month, current month and next month. Last Day of Previous Month SELECT  DATEADD ( s ,- 1 , DATEADD ( mm ,  DATEDIFF ( m , 0 , GETDATE ()), 0 )) Last Day of Current Month SELECT  DATEADD ( s ,- 1 , DATEADD ( mm ,  DATEDIFF ( m , 0 , GETDATE ())+ 1 , 0 )) Last Day of Next Month SELECT  DATEADD ( s ,- 1 , DATEADD ( mm ,  DATEDIFF ( m , 0 , GETDATE ())+ 2 , 0 )) b) . Last day of any day specified. Last Day of Any Month and Year DECLARE  @dtDate  DATETIME SET  @dtDate  =  '8/18/2007' SELECT  DATEADD ( s ,- 1 , DATEADD ( mm ,  DATEDIFF ( m , 0 , @dtDate )+ 1 , 0 ))

Last_date

There is no function like last_date in sql server.

How to upload excel file to MYsql server

Save your spreadsheet as a CSV (comma separated value) file. >| >| After I save the spreadsheet as a CSV file how do I import the data >| into a MySQL table?[/color] Look under the Load Data instruction. I use the following: LOAD DATA LOCAL INFILE 'e:\\sydnet2\\_info\\curdocs.csv' INTO TABLE pnp_docs_current FIELDS TERMINATED BY ',' ENCLOSED BY '"' LINES TERMINATED BY '\n';

Maximize SQL Server Performance with SQL Tuning

Image

Memcached Functions in MySQL

Image

How to remove MYSQL from Windows 7

How To: Run Command Prompt as Administrator and execute the following command to stop and remove MySQL service. Net stop MySQL Sc delete MySQL Go to Control Panel >> Programs >> Programs and Features, select MySQL Server 5.x and click Uninstall. (If you can uninstall MySQL from Control Panel) Open Windows Explorer and go to Organize > Folder and search options, Select the “View” tab and under “Hidden files and Folders” choose “Show hidden files and folders”. Now explore the following locations and delete following folders. C:\Program Files\MySQL C:\Program Files (x86)\MySQL C:\ProgramData\MySQL And if exists, delete it too C:\Users\[User-Name]\AppData\Roaming\MySQL Restart your PC and reinstall MySQL. That’s all! Applies To: Windows Server 2008 R2 Windows Server 2008 Windows 7 Windows Vista

Enabling ARCHIVELOG Mode

The following steps will guide you to enable archivelog Mode. 1. Check the current archivelog mode.   SELECT LOG_MODE FROM V$DATABASE 2. SHUTDOWN AND RESTART YOUR DATABASE TO MOUNT STATE.   SHUTDOWN IMMEDIATE STARTUP MOUNT 3. ENABLE ARCHIVE MODE ALTER DATABASE ARCHIVELOG. 4. OPEN YOUR DATABASE. ALTER DATABASE OPEN

Introduction to Linux Security

There is a saying in the security world that the only truly safe computer system is one that is disconnected from the network, switched off and buried six feet under ground . The sentiment may be somewhat true but it is hardly a practical solution to the problems we face today in protecting servers and desktops from outside intrusion. There are more computer systems connected to the internet either directly or via local area networks than at any time in the history of technology and the numbers are growing at a rapid rate. It seems that not a month goes by without another story in the news about the internal network of a major corporation being compromised by an intruder.   The simple fact is that there really is no such thing as a truly secure system as long is it is connected to a network. If the large corporations with expensive firewalls and talented IT staff can’t always stop criminals from breaking in what chance do the rest of us have? Fortunately all is not lost an...

Introduction to Computer Security

What is computer security? Security is risk management. - unknown "A computer is secure if you can depend on it and it's software to behave as you expect" - Practical UNIX and Internet Security Security is: availability, consistency, access control, data confidentiality, authentication. -  http://www.sun.com/security/overview.html "The principal objective of computer security is to protect and assure the confidentiality, integrity, and availability of automated information systems and the data they contain." -  http://csrc.nist.gov/publications/secpubs/cslaw.txt There are numerous definitions for "computer security", and most of them are correct. Essentially computer security means enforcement of usage policies, this must be done since people and software have flaws that can result in accidents, but also because someone may want to steal your information, use your resources inappropriately or simply deny you the use of your resources. S...