SELECT c.name ‘Column Name’, t.Name ‘Data type’, c.max_length ‘Max Length’, c.precision , c.scale , c.is_nullable, ISNULL(i.is_primary_key, 0) ‘Primary Key’ FROM sys.columns c INNER JOIN sys.types t ON c.user_type_id = t.user_type_id LEFT OUTER JOIN sys.index_columns ic ON ic.object_id = c.object_id AND ic.column_id = c.column_id LEFT OUTER JOIN sys.indexes i ON ic.object_id = i.object_id AND ic.index_id =…
Tag Archives: Sql
Sql return duplicate copies of a row based on a value in a column that row
This Row: ID DESC QUANTITY 1 ITEM 3 Is it possible form a query to give me a result such as: 1 ITEM 1 ITEM 1 ITEM select t.id,t.desc from yourtable t inner join master.dbo.spt_values v on v.type = ‘p’ and v.number<t.qty Kaynak: http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=106029…
Mssql’de kayıtlı triggerları listeleme
SELECT ParentObject = o.name,TriggerName = t.name,[Type] = t.type,TypeDesc = t.type_desc FROM sys.triggers t LEFT JOIN sys.objects o ON t.parent_id = o.object_id WHERE t.is_ms_shipped = 0 ORDER BY [Type],ParentObject,TriggerName…