Posts

Showing posts with the label finding

SQL FINDING ALL THE TABLE NAME COLUMN NAME WHICH HAVING IDENTITY FIELD AUTO INCREMENT

SQL FINDING ALL THE TABLE NAME COLUMN NAME WHICH HAVING IDENTITY FIELD AUTO INCREMENT --FINDING ALL THE TABLE NAME & COLUMN NAME WHICH IDENTITY IS ON(1) SELECT C.NAME AS COLNAME,T.NAME AS TABLENAME,C.IS_IDENTITY FROM SYS.COLUMNS C INNER JOIN SYS.TABLES T ON C.OBJECT_ID=T.OBJECT_ID WHERE C.IS_IDENTITY=1 This post h download  file  now

SQL SERVER Finding nth Highest Value

SQL SERVER Finding nth Highest Value --Select 4th Highest Salary (1-way) SELECT TOP 1 E_ID FROM (SELECT DISTINCT TOP 4 E_ID FROM EMP ORDER BY E_ID DESC)A ORDER BY E_ID ASC --Select 4th Highest Salary (2-way) SELECT MIN(E_ID) FROM (SELECT TOP 4 E_ID FROM EMP ORDER BY E_ID DESC)E Description:- This is one of the best query that I posted ,when I got an interesting question regarding this.Use of sub-queries makes complex perforemance. download  file  now

Solved Finding computer name using IP

Image
Solved Finding computer name using IP Windows: nbtstat -a ipaddress Linux: nmblookup -A� ipaddress download file now

SPLUNK Finding VLAN to VLAN traffic

Image
SPLUNK Finding VLAN to VLAN traffic We are most often concerned with traffic flowing out of the network or into the network. This is where the bad guys start from and most often show their intentions.. But what about the embedded bad guy that is already in your network.. **For what ever reason** Your IDS missed it, or they were already in and then you deployed your IDS... I am talking about internal VLAN traffic, from the Marketing VLAN to the finance VLAN.. that probably shouldnt be happening and we need to watch for it. Assumption: Your internal network numbering is based off of 192.168.0.0/16 So a simple Splunk search would reveal traffic being sourced from internal PC/Laptop hosts to internal PC/Laptop hosts src_ip=192.168.0.0/16 AND dest_ip=192.168.0.0/16 but this ends up with a lot of events that are hard to decipher what is going where and we  dont  have any "nice" names to determine if an infected Marketing PC is trying to get to the Finance VLAN. In comes splunk look...

SQL Function for finding Number of Column in a Given Table

SQL Function for finding Number of Column in a Given Table Below a function which can be used to find the no.of column in a specified Table.This function returns an INT(Scalar Value).This Type of function is known as scalar valued function. --FUNCTION FOR FINDING NO OF COLUMN FROM GIVEN TABLE --Create a function with Table_Name as Parameter CREATE FUNCTION FUN_COL_COUNT(@T_NAME VARCHAR(50)) RETURNS INT AS BEGIN DECLARE @CNT INT SELECT @CNT=MAX(ORDINAL_POSITION) FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME=@T_NAME RETURN @CNT END --Run the Function SELECT DBO.FUN_COL_COUNT(Table_name) This above statement return the no.of column in the Table_name .Here DBO represents DataBase Object(Schema).More about Schema read some other articles/Posts. Here Information schema views provide an internal, system table-independent view of the SQL Server metadata. Information schema views enable applications to work correctly although significant changes have been made to the underlying system tables...