Skip to content

Tag: sql-server

Query to join two tables with like operator

I have two table which has data as below Table1 I would like to create where clause to get rows with like operator. for ex. But my problem is that there are more than 15-20 different parameter in where clause, it can also increase latter. So I have decided to create a new table in database lets called it Tabl…

Compare values in Different column and row

I have the following table: What I need is to select all rows where Col1 value is available in Col2 and vice versa. This case only ROW 4 or ROW 3 should be returned. They have same values (13 17). Take it as col1 is Buyer and col2 is Seller I want to know who are the users who bought

Is there a way to obtain linked server query information?

I’m trying to query information on a linked server. The code works fine when run on the machine but doesn’t when connected via a linked server: The error I get is: Purpose behind it is to keep a track of queries run across an estate of servers into 1 central so we can monitor impacts (basically bu…