Jainul Khan
SENIOR EXECUTIVE MANAGER
Pages
Home
About Me
Events & Gallery
Contact
Saturday, September 13, 2014
Find Tables in a Database Who Have a Filed With Same Name
SELECT
SCHEMA_NAME
(
schema_id
)
+
'.'
+
t
.
name
AS
'Table Name'
FROM
sys
.
tables
t
INNER
JOIN
sys
.
columns
c
ON
c
.
object_id
=
t
.
object_id
WHERE
c
.
name
like
'%OrderID%'
ORDER
BY
'Table Name'
No comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment