Showing posts with label changing. Show all posts
Showing posts with label changing. Show all posts

Monday, March 26, 2012

How to change SA Password?

Hi, i'm running SQL Server 2000, the SA password hasn't been changed since it was installed. How do i go aobut changing the SA password? thanks in advice to any one who can help.Use EM - you'll find it under Security / Logins.

Friday, March 23, 2012

How To Change Just Year from a column(DueDate)

Hi
I am getting problem in changing just year from a column name duedate
in order to do m getting all months and day are also changing
help me out

Quote:

Originally Posted by lokaish

Hi
I am getting problem in changing just year from a column name duedate
in order to do m getting all months and day are also changing
help me out


Hey try this...

update tablename set duedate=dateadd(year,2,getdate())

Monday, March 19, 2012

How to change a table to read-only?

What is the sql for changing a table to ready-only?
Many Thanks.One method with SQL 2000:
CREATE TRIGGER MyTable_Trigger ON MyTable
INSTEAD OF INSERT, UPDATE, DELETE
AS
SET NOCOUNT ON -- do nothing
GO
--
Hope this helps.
Dan Guzman
SQL Server MVP
--
SQL FAQ links (courtesy Neil Pike):
http://www.ntfaq.com/Articles/Index.cfm?DepartmentID=800
http://www.sqlserverfaq.com
http://www.mssqlserver.com/faq
--
"MC" <chan_mc@.hotmail.com> wrote in message
news:0d1b01c38956$d7a05e70$a401280a@.phx.gbl...
> What is the sql for changing a table to ready-only?
> Many Thanks.|||Cute.
"Dan Guzman" <danguzman@.nospam-earthlink.net> wrote in message
news:Ofr0UrViDHA.1300@.TK2MSFTNGP10.phx.gbl...
> One method with SQL 2000:
> CREATE TRIGGER MyTable_Trigger ON MyTable
> INSTEAD OF INSERT, UPDATE, DELETE
> AS
> SET NOCOUNT ON -- do nothing
> GO
> --
> Hope this helps.
> Dan Guzman
> SQL Server MVP
> --
> SQL FAQ links (courtesy Neil Pike):
> http://www.ntfaq.com/Articles/Index.cfm?DepartmentID=800
> http://www.sqlserverfaq.com
> http://www.mssqlserver.com/faq
> --
> "MC" <chan_mc@.hotmail.com> wrote in message
> news:0d1b01c38956$d7a05e70$a401280a@.phx.gbl...
> > What is the sql for changing a table to ready-only?
> >
> > Many Thanks.
>|||And, of course, possibly with a RAISERROR if an error should be submitted when a modification is
attempted.
--
Tibor Karaszi, SQL Server MVP
Archive at: http://groups.google.com/groups?oi=djq&as ugroup=microsoft.public.sqlserver
"Dan Guzman" <danguzman@.nospam-earthlink.net> wrote in message
news:Ofr0UrViDHA.1300@.TK2MSFTNGP10.phx.gbl...
> One method with SQL 2000:
> CREATE TRIGGER MyTable_Trigger ON MyTable
> INSTEAD OF INSERT, UPDATE, DELETE
> AS
> SET NOCOUNT ON -- do nothing
> GO
> --
> Hope this helps.
> Dan Guzman
> SQL Server MVP
> --
> SQL FAQ links (courtesy Neil Pike):
> http://www.ntfaq.com/Articles/Index.cfm?DepartmentID=800
> http://www.sqlserverfaq.com
> http://www.mssqlserver.com/faq
> --
> "MC" <chan_mc@.hotmail.com> wrote in message
> news:0d1b01c38956$d7a05e70$a401280a@.phx.gbl...
> > What is the sql for changing a table to ready-only?
> >
> > Many Thanks.
>|||Great. Thanks for your help.
Then, another question:
What is the sql for disable and enable that trigger? Any?
I'm trying not to create and delete the trigger everytime.
My purpose is to put the table in read only while a list
of tasks are performed and put the table back to update
mode when finished.
Thanks again.
MC
>--Original Message--
>One method with SQL 2000:
>CREATE TRIGGER MyTable_Trigger ON MyTable
>INSTEAD OF INSERT, UPDATE, DELETE
>AS
>SET NOCOUNT ON -- do nothing
>GO
>--
>Hope this helps.
>Dan Guzman
>SQL Server MVP
>--
>SQL FAQ links (courtesy Neil Pike):
>http://www.ntfaq.com/Articles/Index.cfm?DepartmentID=800
>http://www.sqlserverfaq.com
>http://www.mssqlserver.com/faq
>--
>"MC" <chan_mc@.hotmail.com> wrote in message
>news:0d1b01c38956$d7a05e70$a401280a@.phx.gbl...
>> What is the sql for changing a table to ready-only?
>> Many Thanks.
>
>.
>|||> What is the sql for disable and enable that trigger?
Try:
ALTER TABLE MyTABLE
DISABLE TRIGGER MyTable_Trigger
ALTER TABLE MyTABLE
ENABLE TRIGGER MyTable_Trigger
See the Books Online for details.
--
Hope this helps.
Dan Guzman
SQL Server MVP
"MC" <chan_mc@.hotmail.com> wrote in message
news:049101c389a2$e32ed3b0$a001280a@.phx.gbl...
> Great. Thanks for your help.
> Then, another question:
> What is the sql for disable and enable that trigger? Any?
> I'm trying not to create and delete the trigger everytime.
> My purpose is to put the table in read only while a list
> of tasks are performed and put the table back to update
> mode when finished.
> Thanks again.
> MC
>
> >--Original Message--
> >One method with SQL 2000:
> >
> >CREATE TRIGGER MyTable_Trigger ON MyTable
> >INSTEAD OF INSERT, UPDATE, DELETE
> >AS
> >SET NOCOUNT ON -- do nothing
> >GO
> >
> >--
> >Hope this helps.
> >
> >Dan Guzman
> >SQL Server MVP
> >
> >--
> >SQL FAQ links (courtesy Neil Pike):
> >
> >http://www.ntfaq.com/Articles/Index.cfm?DepartmentID=800
> >http://www.sqlserverfaq.com
> >http://www.mssqlserver.com/faq
> >--
> >
> >"MC" <chan_mc@.hotmail.com> wrote in message
> >news:0d1b01c38956$d7a05e70$a401280a@.phx.gbl...
> >> What is the sql for changing a table to ready-only?
> >>
> >> Many Thanks.
> >
> >
> >.
> >