Turn it off, turn it on 
Author Message
 Turn it off, turn it on

Hi

I have a table (see below) that has an AutoNotify field of type bit in it.
What I would like to do is create a SPROC that will change the AutoNotify
field.

If AutoNotify is 'Off' then turn it 'On' and vice versa.  I will need to
pass in the EmployeeID to make sure only the relevant one is changed.

Thanks

Tim
****************************************************************************
**************
CREATE TABLE [dbo].[EmployeeInfo] (
 [EmployeeID] [smallint] IDENTITY (1, 1) NOT NULL ,
 [FirstName] [varchar] (50) NOT NULL ,
 [LastName] [varchar] (50) NOT NULL ,
 [Email] [varchar] (70) NULL ,
 [Address] [varchar] (100) NULL ,
 [City] [varchar] (50) NULL ,
 [Province] [tinyint] NOT NULL ,
 [PC] [varchar] (12) NULL ,
 [Country] [varchar] (50) NULL ,
 [TimeStamp] [smalldatetime] NOT NULL ,
 [AutoNotify] [bit] NOT NULL
) ON [PRIMARY]
GO



Sat, 06 Dec 2003 09:04:03 GMT
 Turn it off, turn it on


AS

UPDATE EmployeeInfo
  SET AutoNotify = ~ AutoNotify



Quote:
> Hi

> I have a table (see below) that has an AutoNotify field of type bit in it.
> What I would like to do is create a SPROC that will change the AutoNotify
> field.

> If AutoNotify is 'Off' then turn it 'On' and vice versa.  I will need to
> pass in the EmployeeID to make sure only the relevant one is changed.

> Thanks

> Tim

HTH,

Tim



Sat, 06 Dec 2003 09:54:37 GMT
 Turn it off, turn it on
Wow, it looks pretty simple, but I would never have guessed that!

Thanks Tim


Quote:

> AS

> UPDATE EmployeeInfo
>   SET AutoNotify = ~ AutoNotify



> > Hi

> > I have a table (see below) that has an AutoNotify field of type bit in
it.
> > What I would like to do is create a SPROC that will change the
AutoNotify
> > field.

> > If AutoNotify is 'Off' then turn it 'On' and vice versa.  I will need to
> > pass in the EmployeeID to make sure only the relevant one is changed.

> > Thanks

> > Tim

> HTH,

> Tim



Sat, 06 Dec 2003 18:55:45 GMT
 
 [ 3 post ] 

 Relevant Pages 

1. Turn off system warning

2. Can Transaction log be turned off?

3. Turn off logging

4. Turn off Logging of TEXT columns ?

5. Turn off logging?

6. concat nulls yields null - how to turn off

7. SQL Server & turning RAID Cache Off

8. Turn column headings off programmatically

9. Turn off Auto-Commit Mode

10. Turn off ODBC informational messages?

11. Autocommit On even when it′s turned off??????

12. Turn off table locks


 
Powered by phpBB® Forum Software