Display Custom Field in Sidebar if Value is Present

I think, you’re mistaken in how if works…?

$post_meta = get_post_meta(
    $GLOBALS['wp_query']->post->ID,
    'TourURL',
    true
);
if (! empty($post_meta)) echo '<p>Show Link</p>';
else echo '<p>No Link</p>';

This should do what you want – if I understood you correctly.

// UPDATED

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)