Interview Question in SQL Server Clustering


 

Interview Question :: Does anne know how to translate this into MS ACCESS


Object: Table [dbo].[subscribers] Script Date: 5/22/2006 8:26:43 AM ******/
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[subscribers]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[subscribers]
GO

/****** Object: Table [dbo].[subscribers] Script Date: 5/22/2006 8:26:43 AM ******/
CREATE TABLE [dbo].[subscribers] (
[id] [int] IDENTITY (1, 1) NOT NULL ,
[email] [nvarchar] (255) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
[token] [nvarchar] (35) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL
) ON [PRIMARY]
GO

ALTER TABLE [dbo].[subscribers] WITH NOCHECK ADD
CONSTRAINT [PK_subscribers] PRIMARY KEY CLUSTERED
(
[id]
) ON [PRIMARY]
GO
Answers to "Does anne know how to translate this into MS ACCESS"
RE: Does anne know how to translate this into MS ACCESS?

up to the first 'GO' just gets rid of a table if it already exists.

although standard SQL generator created you probably don't need it for MSAccess

but,

DoCmd.RunSQL ("DROP TABLE subscribers;")



to the second 'GO'

is creating a table.

DoCmd.RunSQL ("CREATE TABLE subscribers (identity int, email text (255), token text (35));")



to the third 'GO' is just specifing the primary key as id or the first column called identity. I don't know how to do this in a script as I would just do it in the table designer.





=================================

the above is for creating the table in code on the fly, you could put it in the click event of a button for instance.



If you don't understand all of this, just create a new table with the wizard with the three columns.

identity

email

token

as that is all this is about.....
 
Vote for this answer ::  
RE: Does anne know how to translate this into MS ACCESS?

Yes You Must Compute the rational nationical and then the marutlarion.
 
Vote for this answer ::  
Update Alert Setting