1

I found the table name exist in my system, I used the following query;

select * from sys.tables where name = '%openpotab%';

But how can I find the database name using the table name?

thanks in advance, Bhavesh

1
  • 1
    I suspect you mean LIKE not = Commented Jul 11, 2018 at 14:55

1 Answer 1

1

You could use:

select DB_NAME(DB_ID()), * from sys.tables where name LIKE '%openpotab%';
Sign up to request clarification or add additional context in comments.

2 Comments

The first column is blank in the result set. It means there is no database name?
@Bob Please check now

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.