<p>Updating an old ASP/Access site for a client - I need SQL to add a column to an existing table and set a default value. Doesn't work - any ideas?</p>

<p>This works fine</p>

<pre><code>ALTER TABLE documents ADD COLUMN membersOnly NUMBER
</code></pre>

<p>I want this to work:</p>

<pre><code>ALTER TABLE documents ADD COLUMN membersOnly NUMBER DEFAULT 0
</code></pre>

<p>Have googled and seen instructions for default values work for other field types but I want to add number. Thanks!</p>

[{'answer_id': 47552, 'author': 'zappan', 'author_id': 4723, 'author_profile': 'https://Stackoverflow.com/users/4723', 'pm_score': 4, 'selected': True, 'text': '<p>Tools -&gt; Options -&gt; Tables/Queries -&gt; (At the bottom right:) Sql Server Compatible Syntax - turn option on for this database.</p>\n\n<p>then you can execute your query:</p>\n\n<pre><code>ALTER TABLE documents ADD COLUMN membersOnly NUMBER DEFAULT 0\n</code></pre>\n'}, {'answer_id': 69144, 'author': 'Community', 'author_id': -1, 'author_profile': 'https://Stackoverflow.com/users/-1', 'pm_score': 0, 'selected': False, 'text': '<p>How are you connecting to the database to run the update SQL? You can use the ODBC compatible mode through ADO. Without opening the database in Access.</p>\n'}, {'answer_id': 624863, 'author': 'mike nelson', 'author_id': 23616, 'author_profile': 'https://Stackoverflow.com/users/23616', 'pm_score': 0, 'selected': False, 'text': '<p>You may find Sql Server Compatible Syntax is already turned on, so definately worth just trying to run the sql statement mentioned above (via an ADO connection from ASP) before resorting to taking the db offline. Thanks, this helped me out.</p>\n'}, {'answer_id': 6066172, 'author': 'HansUp', 'author_id': 77335, 'author_profile': 'https://Stackoverflow.com/users/77335', 'pm_score': 3, 'selected': False, 'text': '<p>With ADO, you can execute a DDL statement to create a field and set its default value.</p>\n\n<pre><code>CurrentProject.Connection.Execute _\n   "ALTER TABLE discardme ADD COLUMN membersOnly SHORT DEFAULT 0"\n</code></pre>\n'}, {'answer_id': 25262897, 'author': 'user3921919', 'author_id': 3921919, 'author_profile': 'https://Stackoverflow.com/users/3921919', 'pm_score': -1, 'selected': False, 'text': '<p>Tools -> Options -> Tables/Queries -> (At the bottom right:) Sql Server Compatible Syntax - turn option on for this database.</p>\n\n<p>is not found on MS Access 2010</p>\n'}]
['https://Stackoverflow.com/questions/47535', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/137/']