views:

18

answers:

1

Is it possible to programmatically find the database context from a tsql script? ie the context that changes when you add a USE . I ask because I am not using a USE, and would like to find the database name the script is running on.

+3  A: 
select db_name()
Martin Smith
You make it look so easy
DanDan