Thursday, March 29, 2012
Delete Database
Edition. We would like to delete a database. Do we just open Enterprise
Manager and delete a database? Do we need to do anything else. Thanks.
Yes, it's that easy. Alternatively, you can execute a DROP DATABASE command
from Query Analyzer. In either case, there may be no connections to the
database being dropped.
Hope this helps.
Dan Guzman
SQL Server MVP
"Diane Walker" <ett9300@.yahoo.com> wrote in message
news:%23fZ3pKp0FHA.3720@.TK2MSFTNGP14.phx.gbl...
> We are running SQL 2000 Enterprise Edition under Windows 2003 Standard
> Edition. We would like to delete a database. Do we just open Enterprise
> Manager and delete a database? Do we need to do anything else. Thanks.
>
|||Thank you very much, Dan.
"Dan Guzman" <guzmanda@.nospam-online.sbcglobal.net> wrote in message
news:%23B%23qXdr0FHA.2932@.TK2MSFTNGP10.phx.gbl...
> Yes, it's that easy. Alternatively, you can execute a DROP DATABASE
command[vbcol=seagreen]
> from Query Analyzer. In either case, there may be no connections to the
> database being dropped.
> --
> Hope this helps.
> Dan Guzman
> SQL Server MVP
> "Diane Walker" <ett9300@.yahoo.com> wrote in message
> news:%23fZ3pKp0FHA.3720@.TK2MSFTNGP14.phx.gbl...
Enterprise
>
|||Hi,
Before drop Please take a backup and keep it in some archive folde incase if
you have some data inside the database .
Thanks
Hari
SQL Server MVP
"Diane Walker" <ett9300@.yahoo.com> wrote in message
news:ejCVDFs0FHA.2064@.TK2MSFTNGP09.phx.gbl...
> Thank you very much, Dan.
> "Dan Guzman" <guzmanda@.nospam-online.sbcglobal.net> wrote in message
> news:%23B%23qXdr0FHA.2932@.TK2MSFTNGP10.phx.gbl...
> command
> Enterprise
>
|||Thanks.
"Hari Prasad" <hari_prasad_k@.hotmail.com> wrote in message
news:OtSToss0FHA.3856@.tk2msftngp13.phx.gbl...
> Hi,
> Before drop Please take a backup and keep it in some archive folde incase
> if you have some data inside the database .
> Thanks
> Hari
> SQL Server MVP
> "Diane Walker" <ett9300@.yahoo.com> wrote in message
> news:ejCVDFs0FHA.2064@.TK2MSFTNGP09.phx.gbl...
>
Delete Database
Edition. We would like to delete a database. Do we just open Enterprise
Manager and delete a database? Do we need to do anything else. Thanks.Yes, it's that easy. Alternatively, you can execute a DROP DATABASE command
from Query Analyzer. In either case, there may be no connections to the
database being dropped.
--
Hope this helps.
Dan Guzman
SQL Server MVP
"Diane Walker" <ett9300@.yahoo.com> wrote in message
news:%23fZ3pKp0FHA.3720@.TK2MSFTNGP14.phx.gbl...
> We are running SQL 2000 Enterprise Edition under Windows 2003 Standard
> Edition. We would like to delete a database. Do we just open Enterprise
> Manager and delete a database? Do we need to do anything else. Thanks.
>|||Thank you very much, Dan.
"Dan Guzman" <guzmanda@.nospam-online.sbcglobal.net> wrote in message
news:%23B%23qXdr0FHA.2932@.TK2MSFTNGP10.phx.gbl...
> Yes, it's that easy. Alternatively, you can execute a DROP DATABASE
command
> from Query Analyzer. In either case, there may be no connections to the
> database being dropped.
> --
> Hope this helps.
> Dan Guzman
> SQL Server MVP
> "Diane Walker" <ett9300@.yahoo.com> wrote in message
> news:%23fZ3pKp0FHA.3720@.TK2MSFTNGP14.phx.gbl...
> > We are running SQL 2000 Enterprise Edition under Windows 2003 Standard
> > Edition. We would like to delete a database. Do we just open
Enterprise
> > Manager and delete a database? Do we need to do anything else. Thanks.
> >
> >
>|||Hi,
Before drop Please take a backup and keep it in some archive folde incase if
you have some data inside the database .
Thanks
Hari
SQL Server MVP
"Diane Walker" <ett9300@.yahoo.com> wrote in message
news:ejCVDFs0FHA.2064@.TK2MSFTNGP09.phx.gbl...
> Thank you very much, Dan.
> "Dan Guzman" <guzmanda@.nospam-online.sbcglobal.net> wrote in message
> news:%23B%23qXdr0FHA.2932@.TK2MSFTNGP10.phx.gbl...
>> Yes, it's that easy. Alternatively, you can execute a DROP DATABASE
> command
>> from Query Analyzer. In either case, there may be no connections to the
>> database being dropped.
>> --
>> Hope this helps.
>> Dan Guzman
>> SQL Server MVP
>> "Diane Walker" <ett9300@.yahoo.com> wrote in message
>> news:%23fZ3pKp0FHA.3720@.TK2MSFTNGP14.phx.gbl...
>> > We are running SQL 2000 Enterprise Edition under Windows 2003 Standard
>> > Edition. We would like to delete a database. Do we just open
> Enterprise
>> > Manager and delete a database? Do we need to do anything else.
>> > Thanks.
>> >
>> >
>>
>|||Thanks.
"Hari Prasad" <hari_prasad_k@.hotmail.com> wrote in message
news:OtSToss0FHA.3856@.tk2msftngp13.phx.gbl...
> Hi,
> Before drop Please take a backup and keep it in some archive folde incase
> if you have some data inside the database .
> Thanks
> Hari
> SQL Server MVP
> "Diane Walker" <ett9300@.yahoo.com> wrote in message
> news:ejCVDFs0FHA.2064@.TK2MSFTNGP09.phx.gbl...
>> Thank you very much, Dan.
>> "Dan Guzman" <guzmanda@.nospam-online.sbcglobal.net> wrote in message
>> news:%23B%23qXdr0FHA.2932@.TK2MSFTNGP10.phx.gbl...
>> Yes, it's that easy. Alternatively, you can execute a DROP DATABASE
>> command
>> from Query Analyzer. In either case, there may be no connections to the
>> database being dropped.
>> --
>> Hope this helps.
>> Dan Guzman
>> SQL Server MVP
>> "Diane Walker" <ett9300@.yahoo.com> wrote in message
>> news:%23fZ3pKp0FHA.3720@.TK2MSFTNGP14.phx.gbl...
>> > We are running SQL 2000 Enterprise Edition under Windows 2003 Standard
>> > Edition. We would like to delete a database. Do we just open
>> Enterprise
>> > Manager and delete a database? Do we need to do anything else.
>> > Thanks.
>> >
>> >
>>
>>
>
Delete Database
Edition. We would like to delete a database. Do we just open Enterprise
Manager and delete a database? Do we need to do anything else. Thanks.Yes, it's that easy. Alternatively, you can execute a DROP DATABASE command
from Query Analyzer. In either case, there may be no connections to the
database being dropped.
Hope this helps.
Dan Guzman
SQL Server MVP
"Diane Walker" <ett9300@.yahoo.com> wrote in message
news:%23fZ3pKp0FHA.3720@.TK2MSFTNGP14.phx.gbl...
> We are running SQL 2000 Enterprise Edition under Windows 2003 Standard
> Edition. We would like to delete a database. Do we just open Enterprise
> Manager and delete a database? Do we need to do anything else. Thanks.
>|||Thank you very much, Dan.
"Dan Guzman" <guzmanda@.nospam-online.sbcglobal.net> wrote in message
news:%23B%23qXdr0FHA.2932@.TK2MSFTNGP10.phx.gbl...
> Yes, it's that easy. Alternatively, you can execute a DROP DATABASE
command
> from Query Analyzer. In either case, there may be no connections to the
> database being dropped.
> --
> Hope this helps.
> Dan Guzman
> SQL Server MVP
> "Diane Walker" <ett9300@.yahoo.com> wrote in message
> news:%23fZ3pKp0FHA.3720@.TK2MSFTNGP14.phx.gbl...
Enterprise[vbcol=seagreen]
>|||Hi,
Before drop Please take a backup and keep it in some archive folde incase if
you have some data inside the database .
Thanks
Hari
SQL Server MVP
"Diane Walker" <ett9300@.yahoo.com> wrote in message
news:ejCVDFs0FHA.2064@.TK2MSFTNGP09.phx.gbl...
> Thank you very much, Dan.
> "Dan Guzman" <guzmanda@.nospam-online.sbcglobal.net> wrote in message
> news:%23B%23qXdr0FHA.2932@.TK2MSFTNGP10.phx.gbl...
> command
> Enterprise
>|||Thanks.
"Hari Prasad" <hari_prasad_k@.hotmail.com> wrote in message
news:OtSToss0FHA.3856@.tk2msftngp13.phx.gbl...
> Hi,
> Before drop Please take a backup and keep it in some archive folde incase
> if you have some data inside the database .
> Thanks
> Hari
> SQL Server MVP
> "Diane Walker" <ett9300@.yahoo.com> wrote in message
> news:ejCVDFs0FHA.2064@.TK2MSFTNGP09.phx.gbl...
>
Tuesday, March 27, 2012
delete builtin\administrators
I delete the login buildin\administrator and now I can't use anymore SQL
Server Enterprise Manager.
Can somebody tell how to valid an other user or haw to recreate the account
buildin\adminstrators ?
I still have sa.
Thanks in advance
rmeuser@.free.frHi,
IN Enterprise manager, Right click above the server name and remove
registration. After that register the server again with SA user.
Thanks
Hari
MCDBA
"Ralf Meuser" <rmeuser@.free.fr> wrote in message
news:4030c1c4$0$20229$626a14ce@.news.free.fr...
> Hi there
> I delete the login buildin\administrator and now I can't use anymore SQL
> Server Enterprise Manager.
> Can somebody tell how to valid an other user or haw to recreate the
account
> buildin\adminstrators ?
> I still have sa.
> Thanks in advance
> rmeuser@.free.fr
>
delete builtin\administrators
I delete the login buildin\administrator and now I can't use anymore SQL
Server Enterprise Manager.
Can somebody tell how to valid an other user or haw to recreate the account
buildin\adminstrators ?
I still have sa.
Thanks in advance
rmeuser@.free.frHi,
IN Enterprise manager, Right click above the server name and remove
registration. After that register the server again with SA user.
Thanks
Hari
MCDBA
"Ralf Meuser" <rmeuser@.free.fr> wrote in message
news:4030c1c4$0$20229$626a14ce@.news.free.fr...
> Hi there
> I delete the login buildin\administrator and now I can't use anymore SQL
> Server Enterprise Manager.
> Can somebody tell how to valid an other user or haw to recreate the
account
> buildin\adminstrators ?
> I still have sa.
> Thanks in advance
> rmeuser@.free.fr
>
Wednesday, March 21, 2012
Deinstall by deleting resistry keys
I followed the instructions at http://support.microsoft.com/?id=290991 including backing up my system state and deleting regisitry keys. I went as far as I could removing all known instances and using full text removal. When I try to reinstall, my old deleted instance name is the only one that appears in Enterprise Manager and of course I cannot see the instance I tried to install
Deinstalling the instance I just triesd to install, I went back to look at the registry again. I noticed a registry folder under LOCAL_MACHINE>SOFTWARE>MICROSOFT that was named SQL_REDIST containing a folder named 1.00.000 and one named Setup
Should these also be deleted
Thanks!I seem to have reinstalled successfully
I went back through the new install procedure and made sure to name a new instance instead of taking the default instance in the wizard. I named the new instance the exact same name as I had on the Evaluation Edition instance and everything now seems to be working.sql
Deinstall by deleting resistry keys
plet have also failed.
I followed the instructions at http://support.microsoft.com/?id=290991 including backing up my system state and deleting regisitry keys. I went as far as I could removing all known instances and using full text removal. When I try to reinstall, my old del
eted instance name is the only one that appears in Enterprise Manager and of course I cannot see the instance I tried to install.
Deinstalling the instance I just triesd to install, I went back to look at the registry again. I noticed a registry folder under LOCAL_MACHINE>SOFTWARE>MICROSOFT that was named SQL_REDIST containing a folder named 1.00.000 and one named Setup.
Should these also be deleted?
Thanks!
I seem to have reinstalled successfully.
I went back through the new install procedure and made sure to name a new instance instead of taking the default instance in the wizard. I named the new instance the exact same name as I had on the Evaluation Edition instance and everything now seems to b
e working.
Deinstall by deleting resistry keys
an reinstall my newly purchased Developer Edition License. I originally trie
d to upgrade, but the upgrade failed. Attempts to deinstall the from the Win
dows Add/Delete Programs ap
plet have also failed.
I followed the instructions at http://support.microsoft.com/?id=290991 inclu
ding backing up my system state and deleting regisitry keys. I went as far a
s I could removing all known instances and using full text removal. When I t
ry to reinstall, my old del
eted instance name is the only one that appears in Enterprise Manager and of
course I cannot see the instance I tried to install.
Deinstalling the instance I just triesd to install, I went back to look at t
he registry again. I noticed a registry folder under LOCAL_MACHINE>SOFTWARE
>MICROSOFT that was named SQL_REDIST containing a folder named 1.00.000 and
one named Setup.
Should these also be deleted?
Thanks!I seem to have reinstalled successfully.
I went back through the new install procedure and made sure to name a new in
stance instead of taking the default instance in the wizard. I named the new
instance the exact same name as I had on the Evaluation Edition instance an
d everything now seems to b
e working.
Degrade from SQL Server 2000 Enterprise Edition to SQL Server 2000 Standard Edition
Hi,
Can we degrade from SQL Server 2000 Enterprise Edition to SQL Server 2000 Standand Edition without doing Uninstall and reinstall?
Thanks in advance,
you cannot downgrade from higher version to lower version without uninstalling the sql server, but the vice-versa is possible..........refer the link,
http://msdn2.microsoft.com/en-us/library/ms143393.aspx
for possible version and edition upgrades.........
Saturday, February 25, 2012
Default Values in SQL Server
Under Enterprise Manager I am trying to set up default values for these fields
Phone, Fax = 000-000-000
Zip = 00000
However Sql Server truncates it to 0.
How do I default value as shown about in SQL server?You must have the column set to int?
Change it to varchar(30) and you should be fine.
ScAndal|||I have Phone, Fax nvarchar(12) and Zip as nvarchar(5)
I don't know why this doesn't work !!|||Ok.. I got the solution
For default value instead of putting 000-000-000 with nvarchar(12) I put '000-000-0000' and it works fine.
1) How do I use 'Formula' field in Enterprise Manager works?
2) How do I work with various Timezone issue ?|||love,
How did you determine it is storing as 0? Did you select the data from query analyzer and it shows 0?
ScAndal|||I right clicked on table and selected 'Return All Rows' where I saw 0 instead of 00000
Another way was, once I put value in Default field as 00000 and save table, return to the same column it will indiate data as (0) for zip and (0-0-0) for phone and fax.
This and your data type indicated me that there is something wrong with my default value.
Sunday, February 19, 2012
Default Value Does Not Work On Insert
In Enterprise Manager, the column will fill with the Default Value when no
data is entered as it should.
However, in my Stored Procedure, it won't.
Table:
Col1 uniqueidentifier pkey not null default newid()
Col2 tinyint not null default 20
Procedure:
@.Col1 UNIQUEIDENTIFIER = NULL,
@.Col2 TINYINT = NULL
SET @.Col1 = NEWID() /*Set to use later on*/
INSERT INTO dbo.Table1
(Col1, Col2)
VALUES (@.Col1, @.Col2)
If Col2 column is described as NOT null, it errs saying it can't insert null
into the col.
I would think that once it saw null, it would replace it with default.
If Col2 column is described as null, it would fill it with null and NOT
default.
If I replace @.Col2 with default, the default value is filled in.
Am I missing something here? I could have sworn I've done it before and it's
blowing my mind why it won't work.
Appreciating any assistance,
NathanSQL Server doesn't replace default with null. If you specify NULL, then it i
s because you want to
have NULL. Specifying NOT NULL in CREATE TABLE doesn't change this.
EM might do some strange smarts here, but EM does a lot of strange things.
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"Nathan" <Nathan@.discussions.microsoft.com> wrote in message
news:4BDDED11-1A72-45A6-B87D-ACD0F863C4B8@.microsoft.com...
> I'm totally flabbergasted,
> In Enterprise Manager, the column will fill with the Default Value when no
> data is entered as it should.
> However, in my Stored Procedure, it won't.
> Table:
> Col1 uniqueidentifier pkey not null default newid()
> Col2 tinyint not null default 20
> Procedure:
> @.Col1 UNIQUEIDENTIFIER = NULL,
> @.Col2 TINYINT = NULL
> SET @.Col1 = NEWID() /*Set to use later on*/
> INSERT INTO dbo.Table1
> (Col1, Col2)
> VALUES (@.Col1, @.Col2)
> If Col2 column is described as NOT null, it errs saying it can't insert nu
ll
> into the col.
> I would think that once it saw null, it would replace it with default.
> If Col2 column is described as null, it would fill it with null and NOT
> default.
> If I replace @.Col2 with default, the default value is filled in.
> Am I missing something here? I could have sworn I've done it before and it
's
> blowing my mind why it won't work.
> Appreciating any assistance,
> Nathan|||A little confusion here.
I want default to be used when "nothing" has been given.
In the SP, I have = Null so my app doesn't have to send anything.
If I don't have = Null in the SP, then my app is required to send something
and that may or may not be dbnull.value or "nothing".
Whatever the case, when I have nothing to give from my app, I want the DB to
set the value to the Default val.
I was just switching the Not Null for the Column for debugging purposes. I
thought it should have set the record cell to default value regardless of th
e
Null or Not Null.
I hope this is helping to clear up my situation and hope you have something
else for me.
Thanks for your input so far.
Nathan
"Tibor Karaszi" wrote:
> SQL Server doesn't replace default with null. If you specify NULL, then it
is because you want to
> have NULL. Specifying NOT NULL in CREATE TABLE doesn't change this.
> EM might do some strange smarts here, but EM does a lot of strange things.
> --
> Tibor Karaszi, SQL Server MVP
> http://www.karaszi.com/sqlserver/default.asp
> http://www.solidqualitylearning.com/
>
> "Nathan" <Nathan@.discussions.microsoft.com> wrote in message
> news:4BDDED11-1A72-45A6-B87D-ACD0F863C4B8@.microsoft.com...
>
>|||If you want SQL Server to use the default value on insert, use the
DEFAULT keyword or do not specify the column at all:
INSERT INTO dbo.Table1 (Col1, Col2) VALUES (@.Col1, DEFAULT)
or
INSERT INTO dbo.Table1 (Col1) VALUES (@.Col1)
Razvan|||See Razvan's post. He posted the two ways for which SQ!L Server will apply a
default values. I.e.,
you probably have to check parameters values in the procedure and execute th
e inserts conditionally.
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"Nathan" <Nathan@.discussions.microsoft.com> wrote in message
news:3B533344-91F5-4EF8-8BA6-637E8420DD44@.microsoft.com...
>A little confusion here.
> I want default to be used when "nothing" has been given.
> In the SP, I have = Null so my app doesn't have to send anything.
> If I don't have = Null in the SP, then my app is required to send somethin
g
> and that may or may not be dbnull.value or "nothing".
> Whatever the case, when I have nothing to give from my app, I want the DB
to
> set the value to the Default val.
> I was just switching the Not Null for the Column for debugging purposes. I
> thought it should have set the record cell to default value regardless of
the
> Null or Not Null.
> I hope this is helping to clear up my situation and hope you have somethin
g
> else for me.
> Thanks for your input so far.
> Nathan
> "Tibor Karaszi" wrote:
>|||OK, I think I will have to use a trigger for this (first timer here).
I thought I could conditionally set the value if it was Null to Default, but
it doesn't like me using the word Default in a condition (isnull).
Thanks for the help you two,
Nathan
"Razvan Socol" wrote:
> If you want SQL Server to use the default value on insert, use the
> DEFAULT keyword or do not specify the column at all:
> INSERT INTO dbo.Table1 (Col1, Col2) VALUES (@.Col1, DEFAULT)
> or
> INSERT INTO dbo.Table1 (Col1) VALUES (@.Col1)
> Razvan
>|||On Mon, 25 Apr 2005 10:27:02 -0700, Nathan wrote:
>OK, I think I will have to use a trigger for this (first timer here).
>I thought I could conditionally set the value if it was Null to Default, bu
t
>it doesn't like me using the word Default in a condition (isnull).
>Thanks for the help you two,
>Nathan
Hi Nathan,
No need to use a trigger here! Just change the code in your stored
procedure to:
@.Col1 UNIQUEIDENTIFIER = NULL,
@.Col2 TINYINT = NULL
SET @.Col1 = NEWID() /*Set to use later on*/
IF @.Col2 IS NULL
INSERT INTO dbo.Table1 (Col1, Col2)
VALUES (@.Col1, DEFAULT)
ELSE
INSERT INTO dbo.Table1 (Col1, Col2)
VALUES (@.Col1, @.Col2)
Best, Hugo
--
(Remove _NO_ and _SPAM_ to get my e-mail address)|||Hi Hugo,
If anything, I really would have liked to use an embedded conditional
statement, but don't seem to be able to.
For simplicity-sake, I only used two columns here, but there are several,
most having the possibility of being a value or needing to use a default
value.
So the combinations/permutations would just end up making it a mess.
I know, I could just set the default value (replacing =Null), but I want it
tightly-knitted with the database itself.
It seems that the trigger is the solution I'm looking for. At least there
are options. I always say, you can find at least 5 ways to copy and paste.
Thanks for the input,
Nathan
"Hugo Kornelis" wrote:
> On Mon, 25 Apr 2005 10:27:02 -0700, Nathan wrote:
>
> Hi Nathan,
> No need to use a trigger here! Just change the code in your stored
> procedure to:
> @.Col1 UNIQUEIDENTIFIER = NULL,
> @.Col2 TINYINT = NULL
> SET @.Col1 = NEWID() /*Set to use later on*/
> IF @.Col2 IS NULL
> INSERT INTO dbo.Table1 (Col1, Col2)
> VALUES (@.Col1, DEFAULT)
> ELSE
> INSERT INTO dbo.Table1 (Col1, Col2)
> VALUES (@.Col1, @.Col2)
> Best, Hugo
> --
> (Remove _NO_ and _SPAM_ to get my e-mail address)
>|||On Mon, 25 Apr 2005 19:49:18 -0700, Nathan wrote:
>Hi Hugo,
>If anything, I really would have liked to use an embedded conditional
>statement, but don't seem to be able to.
>For simplicity-sake, I only used two columns here, but there are several,
>most having the possibility of being a value or needing to use a default
>value.
>So the combinations/permutations would just end up making it a mess.
>I know, I could just set the default value (replacing =Null), but I want it
>tightly-knitted with the database itself.
>It seems that the trigger is the solution I'm looking for. At least there
>are options. I always say, you can find at least 5 ways to copy and paste.
Hi Nathan,
I agree that the IF ... ELSE tree would grow quickly is the same logic has
to be applied to many columns. Writing triggers is one way around this.
But I doubt that it is the best way.
You already use a stored procedure to insert the data. Why not include the
default value in the code of the stored procedure? You say that you don't
want to do this because you want it tightly-knitted with the DB, but then
you want to code the default value in a trigger. How is a trigger more
tightly-knitted with the DB than a stored procedure?
CREATE PROC InsertIt
(@.KeyValue int,
@.Data1 varchar(20) = NULL,
@.Data2 datetime = NULL,
@.Date3 int = NULL)
INSERT INTO YourTable (KeyCol, Data1, Data2, Data3)
SELECT @.KeyValue,
COALESCE (@.Data1, 'Default value'),
COALESCE (@.Data2, CURRENT_TIMESTAMP),
COALESCE (@.Data3, 100)
go
Best, Hugo
--
(Remove _NO_ and _SPAM_ to get my e-mail address)|||Actually, I was starting on the TR just to get some experience with it, but
figured my only app using the DB would work just fine setting the SP
parameter defaults.
I tend to think of future possibilities such as another app that will use
the DB, but not want to make use of that SP and may require another SP, and
then needing to remember to adjust the defaults for the parameters in each
SP. If I just had a single trigger, I wouldn't have to worry about default
parameters in different SPs.
But like I just said, I dropped that thought and will just stick with the
"here and now" of the single SP.
Just my way of thinking is all.
Nathan
"Hugo Kornelis" wrote:
> On Mon, 25 Apr 2005 19:49:18 -0700, Nathan wrote:
>
> Hi Nathan,
> I agree that the IF ... ELSE tree would grow quickly is the same logic has
> to be applied to many columns. Writing triggers is one way around this.
> But I doubt that it is the best way.
> You already use a stored procedure to insert the data. Why not include the
> default value in the code of the stored procedure? You say that you don't
> want to do this because you want it tightly-knitted with the DB, but then
> you want to code the default value in a trigger. How is a trigger more
> tightly-knitted with the DB than a stored procedure?
> CREATE PROC InsertIt
> (@.KeyValue int,
> @.Data1 varchar(20) = NULL,
> @.Data2 datetime = NULL,
> @.Date3 int = NULL)
> INSERT INTO YourTable (KeyCol, Data1, Data2, Data3)
> SELECT @.KeyValue,
> COALESCE (@.Data1, 'Default value'),
> COALESCE (@.Data2, CURRENT_TIMESTAMP),
> COALESCE (@.Data3, 100)
> go
> Best, Hugo
> --
> (Remove _NO_ and _SPAM_ to get my e-mail address)
>
Tuesday, February 14, 2012
default settings when creating a database
Some users create new databases using the enterprise manager console (right
click in the database section and then selecting new database).
Once created this database has default settings like "Auto shrink" checked
or "Auto close" unchecked (in the option tab).
Is there a way to set these default settings so each time a new database is
created it has the right options?
thanks
Yes, set the correct options on the Model database. That database is the
baseline from which all other databases on a server are created.
<grille11@.yahoo.com> wrote in message
news:cjju9f$bb5$1@.reader1.imaginet.fr...
> Hello,
> Some users create new databases using the enterprise manager console
(right
> click in the database section and then selecting new database).
> Once created this database has default settings like "Auto shrink" checked
> or "Auto close" unchecked (in the option tab).
> Is there a way to set these default settings so each time a new database
is
> created it has the right options?
> thanks
>
|||I could have searched a little more for this one I guess. Thanks!
"Adam Machanic" <amachanic@.hotmail._removetoemail_.com> wrote in message
news:OMxDsF9pEHA.2864@.TK2MSFTNGP12.phx.gbl...[vbcol=seagreen]
> Yes, set the correct options on the Model database. That database is the
> baseline from which all other databases on a server are created.
>
> <grille11@.yahoo.com> wrote in message
> news:cjju9f$bb5$1@.reader1.imaginet.fr...
> (right
checked
> is
>
default settings when creating a database
Some users create new databases using the enterprise manager console (right
click in the database section and then selecting new database).
Once created this database has default settings like "Auto shrink" checked
or "Auto close" unchecked (in the option tab).
Is there a way to set these default settings so each time a new database is
created it has the right options?
thanksYes, set the correct options on the Model database. That database is the
baseline from which all other databases on a server are created.
<grille11@.yahoo.com> wrote in message
news:cjju9f$bb5$1@.reader1.imaginet.fr...
> Hello,
> Some users create new databases using the enterprise manager console
(right
> click in the database section and then selecting new database).
> Once created this database has default settings like "Auto shrink" checked
> or "Auto close" unchecked (in the option tab).
> Is there a way to set these default settings so each time a new database
is
> created it has the right options?
> thanks
>|||I could have searched a little more for this one I guess. Thanks!
"Adam Machanic" <amachanic@.hotmail._removetoemail_.com> wrote in message
news:OMxDsF9pEHA.2864@.TK2MSFTNGP12.phx.gbl...
> Yes, set the correct options on the Model database. That database is the
> baseline from which all other databases on a server are created.
>
> <grille11@.yahoo.com> wrote in message
> news:cjju9f$bb5$1@.reader1.imaginet.fr...
> > Hello,
> >
> > Some users create new databases using the enterprise manager console
> (right
> > click in the database section and then selecting new database).
> > Once created this database has default settings like "Auto shrink"
checked
> > or "Auto close" unchecked (in the option tab).
> > Is there a way to set these default settings so each time a new database
> is
> > created it has the right options?
> >
> > thanks
> >
> >
>