Select Queries tricks..!

by 9:12 PM 0 comments

select 'Ravi','Rajesh','Mehul','Harshad' where exists (select COUNT(*))
SELECT @@version
SELECT 2 -- comment

SELECT /*comment*/1
SELECT USER;
SELECT system_user;

SELECT user;
SELECT loginame FROM master..sysprocesses WHERE spid = @@SPID
SELECT name FROM master..syslogins
SELECT name, master.dbo.fn_varbintohexstr(password) FROM master..sysxlogins
SELECT name, password_hash FROM master.sys.sql_logins -- priv, mssql 2005;
SELECT name + '-' + master.sys.fn_varbintohexstr(password_hash) from master.sys.sql_logins -- priv, mssql 2005

SELECT is_srvrolemember('sysadmin');
SELECT DB_NAME()
SELECT name FROM master..sysdatabases;

SELECT DB_NAME(3);

SELECT name FROM syscolumns WHERE id = (SELECT id FROM sysobjects WHERE name = 'mytable');
SELECT TOP 1 name FROM (SELECT TOP 9 name FROM master..syslogins ORDER BY name ASC) sq ORDER BY name DESC
SELECT master..syscolumns.name as ColumnName, TYPE_NAME(master..syscolumns.xtype) as DataType FROM master..syscolumns, master..sysobjects WHERE master..syscolumns.id=master..sysobjects.id AND master..sysobjects.name='allData';
SELECT 6 & 2
SELECT 6 & 1
WAITFOR DELAY '0:0:1'
SELECT HOST_NAME()

ravi tuwar

Developer

Cras justo odio, dapibus ac facilisis in, egestas eget quam. Curabitur blandit tempus porttitor. Vivamus sagittis lacus vel augue laoreet rutrum faucibus dolor auctor.

0 comments:

Post a Comment