table-definition

Creating tables with something similar to INFORMATION_SCHEMA.VIEW_DEFINITION in SQL Server

Is there a standard method to retrieve the 'CREATE TABLE..' definition of a table in SQL Server? I can ask INFORMATION_SCHEMA for definitions of views and functions/procedures, so I thought it would be natural to get the same for tables, but I didn't find anything. ...

Postgresq, get table definition, pg_get_tabledef

Hi! Do you know what happend with pg_get_tabledef function in postgresql 8.4? I'm sure I've been using it with previous versions of postgresql? I need to get sql 'create table' syntax for existing table in db with indexes, defaults as so on... Maybe they replaced it with something else? ...

How to add 'auto_increment' to another column besides 'id' in rails table defination?

If I need to add 'auto_increment' to a new column called 'another_id' in a table, how can I make it? Is there an option like: create_table :posts do |t| t.integer :another_id, :auto_increment => true # Is there a option like this? ... t.timestamps end In development env I use sqlite3, and mysql in production env; ...

Visual Studio 2010 - copying only one table definition from .mdf file to SQL Server

I'm wondering if is it possible to copy one table definition from .mdf file to create it in SQL Server and could it be done in Visual Studio 2010? It doesn't matter if I'll do it by some kind of wizard or retrieve a SQL query with a command like "Create Table...". I just want to have one table which I created in mdf file in database on ...