Click here to Skip to main content
15,901,205 members

Welcome to the Lounge

   

For discussing anything related to a software developer's life but is not for programming questions. Got a programming question?

The Lounge is rated Safe For Work. If you're about to post something inappropriate for a shared office environment, then don't post it. No ads, no abuse, and no programming questions. Trolling, (political, climate, religious or whatever) will result in your account being removed.

 
GeneralRe: Day 22 Pin
BillWoodruff14-Oct-21 6:02
professionalBillWoodruff14-Oct-21 6:02 
GeneralRe: Day 22 Pin
MKJCP15-Oct-21 1:28
MKJCP15-Oct-21 1:28 
GeneralIs there anything that would give intellisense like awareness to data relationships in an Sql Server Database Pin
Dan Neely13-Oct-21 10:58
Dan Neely13-Oct-21 10:58 
GeneralRe: Is there anything that would give intellisense like awareness to data relationships in an Sql Server Database Pin
Gary R. Wheeler13-Oct-21 12:15
Gary R. Wheeler13-Oct-21 12:15 
GeneralRe: Is there anything that would give intellisense like awareness to data relationships in an Sql Server Database Pin
kmoorevs13-Oct-21 12:16
kmoorevs13-Oct-21 12:16 
GeneralRe: Is there anything that would give intellisense like awareness to data relationships in an Sql Server Database Pin
Marcos Kirchner14-Oct-21 2:09
Marcos Kirchner14-Oct-21 2:09 
GeneralRe: Is there anything that would give intellisense like awareness to data relationships in an Sql Server Database Pin
Dan Neely14-Oct-21 3:16
Dan Neely14-Oct-21 3:16 
GeneralRe: Is there anything that would give intellisense like awareness to data relationships in an Sql Server Database Pin
Jörgen Andersson14-Oct-21 4:21
professionalJörgen Andersson14-Oct-21 4:21 
You need to add a few joins to make it useful.
Here's something I found on SO and modified for my own use:
SQL
USE MyDatabase

DECLARE @SchemaName nvarchar(128) = 'dbo'
DECLARE @TableName  nvarchar(128) = 'TableWithColumnToRemove'
DECLARE @ColumnName nvarchar(128) = 'ColumnToRemove'
;

SELECT  SCHEMA_NAME(o1.schema_id) + '.' + o1.name ReferencingObject
       ,SCHEMA_NAME(o2.schema_id) + '.' + ed.referenced_entity_name ReferencedObject
       ,c.name ColumnName
       ,o2.type ReferencedObjectType
       ,o1.type ReferencingObjectType
FROM    sys.sql_expression_dependencies ed
JOIN    sys.objects o1 ON ed.referencing_id = o1.object_id
JOIN    sys.objects o2 ON ed.referenced_id = o2.object_id
JOIN    sys.sql_dependencies d ON ed.referencing_id = d.object_id
    AND d.referenced_major_id = ed.referenced_id
JOIN    sys.columns c ON c.object_id = ed.referenced_id
    AND d.referenced_minor_id = c.column_id
WHERE   1=1
    AND SCHEMA_NAME(o2.schema_id) = @SchemaName
    AND o2.name = @TableName
    AND c.name = @ColumnName
ORDER BY ReferencedObject
    ,c.column_id;

Wrong is evil and must be defeated. - Jeff Ello


modified 14-Oct-21 10:33am.

GeneralRe: Is there anything that would give intellisense like awareness to data relationships in an Sql Server Database Pin
Dan Neely14-Oct-21 4:47
Dan Neely14-Oct-21 4:47 
GeneralRe: Is there anything that would give intellisense like awareness to data relationships in an Sql Server Database Pin
RedDk14-Oct-21 6:30
RedDk14-Oct-21 6:30 
GeneralSome questions about upgrading to Windows 11 Pin
honey the codewitch13-Oct-21 10:29
mvahoney the codewitch13-Oct-21 10:29 
GeneralRe: Some questions about upgrading to Windows 11 Pin
Kent Sharkey13-Oct-21 10:41
staffKent Sharkey13-Oct-21 10:41 
GeneralRe: Some questions about upgrading to Windows 11 Pin
honey the codewitch13-Oct-21 10:53
mvahoney the codewitch13-Oct-21 10:53 
GeneralRe: Some questions about upgrading to Windows 11 PinPopular
Nelek13-Oct-21 20:58
protectorNelek13-Oct-21 20:58 
GeneralRe: Some questions about upgrading to Windows 11 Pin
Cp-Coder13-Oct-21 10:42
Cp-Coder13-Oct-21 10:42 
GeneralRe: Some questions about upgrading to Windows 11 Pin
honey the codewitch13-Oct-21 10:46
mvahoney the codewitch13-Oct-21 10:46 
GeneralRe: Some questions about upgrading to Windows 11 Pin
Nelek13-Oct-21 20:59
protectorNelek13-Oct-21 20:59 
GeneralRe: Some questions about upgrading to Windows 11 Pin
Mike Hankey13-Oct-21 10:44
mveMike Hankey13-Oct-21 10:44 
GeneralRe: Some questions about upgrading to Windows 11 Pin
honey the codewitch13-Oct-21 10:47
mvahoney the codewitch13-Oct-21 10:47 
GeneralRe: Some questions about upgrading to Windows 11 Pin
Mike Hankey13-Oct-21 10:50
mveMike Hankey13-Oct-21 10:50 
GeneralRe: Some questions about upgrading to Windows 11 Pin
honey the codewitch13-Oct-21 10:52
mvahoney the codewitch13-Oct-21 10:52 
GeneralRe: Some questions about upgrading to Windows 11 Pin
Mike Hankey13-Oct-21 10:54
mveMike Hankey13-Oct-21 10:54 
GeneralRe: Some questions about upgrading to Windows 11 Pin
honey the codewitch13-Oct-21 10:57
mvahoney the codewitch13-Oct-21 10:57 
GeneralRe: Some questions about upgrading to Windows 11 Pin
MarkTJohnson13-Oct-21 11:44
professionalMarkTJohnson13-Oct-21 11:44 
GeneralRe: Some questions about upgrading to Windows 11 Pin
honey the codewitch13-Oct-21 11:55
mvahoney the codewitch13-Oct-21 11:55 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.


Straw Poll

Were you affected by the geomagnetic storms this past weekend?
Communication disruptions, electrified pipes, random unexplained blue-screens in Windows - the list of effects is terrifying.
  Results   502 votes