Guest User

Untitled

a guest
Jan 24th, 2019
84
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. What I am doing here?
  2.  
  3. %dbsqlexec fail
  4.  
  5. COLUMNPROPERTY(object_id(c.TABLE_NAME), c.COLUMN_NAME, 'IsIdentity'),
  6. c.CHARACTER_MAXIMUM_LENGTH,
  7. c.NUMERIC_PRECISION,
  8. c.NUMERIC_PRECISION_RADIX,
  9. c.NUMERIC_SCALE,
  10. c.DATETIME_PRECISION,
  11. c.CHARACTER_SET_NAME,
  12. c.COLLATION_NAME
  13.  
  14. from INFORMATION_SCHEMA.COLUMNS c
  15. join INFORMATION_SCHEMA.TABLES t
  16. on c.TABLE_SCHEMA = t.TABLE_SCHEMA
  17. and c.TABLE_NAME = t.TABLE_NAME
  18.  
  19. where c.TABLE_CATALOG = 'LW08v6_Empty'
  20. and t.TABLE_TYPE = 'BASE TABLE'
  21. and ((c.table_schema = 'dbo' and c.table_name LIKE 'ACCOUNT'))
  22.  
  23.  
  24. order by c.table_schema, c.table_name, c.ordinal_position;
  25. 2019-01-24T12:34:15.174000Z SQL MSSQL: sending query: -- params: including
  26. -- filter-list-to-where-clause including
  27. -- excluding
  28. -- filter-list-to-where-clause excluding
  29. select schema_name(schema_id) as SchemaName,
  30. o.name as TableName,
  31. REPLACE(i.name, '.', '_') as IndexName,
  32. co.[name] as ColumnName,
  33. i.is_unique,
  34. i.is_primary_key,
  35. i.filter_definition
  36.  
  37. from sys.indexes i
  38. join sys.objects o on i.object_id = o.object_id
  39. join sys.index_columns ic on ic.object_id = i.object_id
  40. and ic.index_id = i.index_id
  41. join sys.columns co on co.object_id = i.object_id
  42. and co.column_id = ic.column_id
  43.  
  44. where schema_name(schema_id) not in ('dto', 'sys')
  45. and ((schema_name(schema_id) = 'dbo' and o.name LIKE 'ACCOUNT'))
  46.  
  47.  
  48. order by SchemaName,
  49. o.[name],
  50. i.[name],
  51. ic.is_included_column,
  52. ic.key_ordinal;
RAW Paste Data