i want to know weather table contain row which have some value like "987654321"(primary key).

This code will return exactly the record which contains 98765432

String command="Select * from Emp_Information where employee_id=98765432"

This code will return all values containing sub-string 987654321

String command="Select * from Emp_Information where employee_id like '%987654321%'"

This code will help you finding the primary key of any table...

SELECT ISKC.TABLE_NAME, ISKC.COLUMN_NAME
FROM INFORMATION_SCHEMA.TABLE_CONSTRAINTS AS ISTC
INNER JOIN
INFORMATION_SCHEMA.KEY_COLUMN_USAGE AS ISKC
ON ISTC.CONSTRAINT_TYPE = 'PRIMARY KEY' AND
ISTC.CONSTRAINT_NAME = ISKC.CONSTRAINT_NAME
WHERE ISKC.TABLE_NAME = 'Emp_Information'
ORDER BY ISKC.TABLE_NAME, ISKC.ORDINAL_POSITION
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.