I need to "use a database" and create a table with the following attributes in SQL Server 2005:
Table name is "quiz_mailing_list" Fields are: id (typical auto-increment primary key) email (varchar size 256) optIn (boolean or tinyint size 1) referringEmail (varchar size 256)
Can someone give me the command to "use the database" and the create the proper table? This is much more confusing than MySQL.
When trying:
CREATE TABLE quiz_mailing_list(
id int identity(1,1) primary key,
email varchar(256),
optIn bit
referringEmail varchar(256))
I get this error:
System.Data.SqlClient.SqlException: Incorrect syntax near 'referringEmail'. at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection) at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection) at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj) at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj) at System.Data.SqlClient.SqlCommand.RunExecuteNonQueryTds(String methodName, Boolean async) at System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(DbAsyncResult result, String methodName, Boolean sendToPipe) at System.Data.SqlClient.SqlCommand.ExecuteNonQuery() at DotNetNuke.Data.SqlDataProvider.ExecuteADOScript(String SQL) at DotNetNuke.Data.SqlDataProvider.ExecuteScript(String Script, Boolean UseTransactions) CREATE TABLE quiz_mailing_list( id int identity(1,1) primary key, email varchar(256), optIn bit referringEmail varchar(256))
Thanks!