December 5, 2007 at 7:32 am
How can i find in which field of a table I have the data '05/12/2006'
December 5, 2007 at 8:41 am
You'd have to query all fields.
select top 1 * from Mytable
where col1 = '05/12/2006'
select top 1 * from Mytable
where col2 = '05/12/2006'
etc.
If this is a datetime, only query date fields. If it's char, go for char, etc.
December 6, 2007 at 7:21 am
is there any other way where I can find the column name with the given data.
December 7, 2007 at 7:27 am
Mike,
Are you searching through just one table of columns, or an entire database of tables and the columns within the tables?
If you give us more information on how broad a search you need, there is most likely a dynamic SQL query that we can assist you with.
"Key"
MCITP: DBA, MCSE, MCTS: SQL 2005, OCP
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply