title: How I can get ddl of all objects like table,triggers,procedures etc in SQL SERVER 2008
body: <p>I have create sample program in which i have get ddl of all objects like table, trigger etc using get_ddl methods which are:-</p>
  
  <pre><code>SELECT DBMS_METADATA.GET_DDL('TABLE', TABLE_NAME) FROM USER_TABLES;
  SELECT DBMS_METADATA.GET_DDL('TRIGGER', TRIGGER_NAME) FROM USER_TRIGGERS;
  SELECT DBMS_METADATA.GET_DDL('VIEW', VIEW_NAME) FROM USER_VIEWS;
  SELECT DBMS_METADATA.GET_DDL('FUNCTION', OBJECT_NAME) FROM USER_PROCEDURES WHERE OBJECT_TYPE = 'FUNCTION';
  SELECT DBMS_METADATA.GET_DDL('PROCEDURE', OBJECT_NAME) FROM USER_PROCEDURES WHERE OBJECT_TYPE = 'PROCEDURE';
  SELECT DBMS_METADATA.GET_DDL('INDEX', INDEX_NAME) FROM USER_INDEXES ;
  </code></pre>
  
  <p>Now I m trying to create same sample for sql server to get ddl of all objects so I want to know that Is sql server 2008 supports get_ddl methods or there are any other tools for creating ddl of all objects. Please help how to do this.</p>