Tags » SQL Query

List down folders underlying file info using SQL query

Sometimes we need to list down file/folder’s information from a folder like filename, extension, created date and modified date etc.

The below query can give you the list of all content’s info from given folder path. 149 more words

SQL Server

Azure - All DBs that are not in Elastic pools

--

SELECT
       @@SERVERNAME as ,
       dso.elastic_pool_name,
       d.name as DatabaseName,
       dso.edition
FROM
       sys.databases d inner join sys.database_service_objectives dso on d.database_id = dso.database_id
WHERE d.Name <> 'master'
AND elastic_pool_name is NULL 
ORDER BY
       d.name, dso.elastic_pool_name
--
SQL

All Databases without geo-replica on Azure Server

Query to find all Azure database without geo-replica configured.

--

select d.* from sys.geo_replication_links r
right join sys.databases  d on d.database_id = r.database_id
where r.database_id is NULL 

--
SQL

SQL Server - Difference Between UNION And UNION ALL

I am trying to recall some of the interview questions that I was being asked during my job hunting and would like to share some studies or findings which I read from the experts regarding these questions. 183 more words

Experience Sharing

TSQL to find Deadlock count in Azure Server by date


;WITH CTE AS (
SELECT * FROM sys.event_log
WHERE event_type = 'deadlock')
SELECT convert(DATE,start_time) as Day, database_name, count(*) as Deadlock_count FROM CTE
GROUP BY convert(DATE,start_time), database_name
ORDER BY 1

--

SQL

Check IMEI Number by Luhn algorithm.

check digit (d9) = mod 10

The check digit is validated in three steps:

Starting from the right, double a digit every two digits (e.g., 5 → 10). 131 more words

SQL QUERY

Sql Query

1.

SQL> select onum,amount,odate from order1;

ONUM AMOUNT ODATE

—– ——— ———

3001 18.69 10-MAR-99

3002 767.19 10-MAR-99

3003 1900.1 10-MAR-99

3004 5160.45 10-MAR-99

3005 1098.25 10-APR-99… 4,004 more words