Quantcast
Channel: Transact-SQL forum
Viewing all articles
Browse latest Browse all 23857

query to find the column value in another table

$
0
0

Hi,

I have two table, one temporary table #TEMP1 containing the result set of xp_fixeddrives  with columns- drive letter and freespace

Another table is sys.datafiles which have a column name - physical_name. (The physical name have complete path.)

I need to get the drive letter from #TEMP1 which is being included in the physical_name of the database.

I used the following statement, but not getting the desired result.

select driveletter from #temp1 where driveletter in (select physical_name from sys.datafiles)

Can you please help !!!


Viewing all articles
Browse latest Browse all 23857

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>