Showing posts with label command. Show all posts
Showing posts with label command. Show all posts

Tuesday, March 6, 2012

"Owner Name" cannot be omitted in sql 2005 querries?

Dear All,
Our project was done in SQL 2000, now we are migrating to 2005.
however, there are lots of command such as:
a) SELECT * FROM myTableName
which, shall be
b) SELECT * FROM myLoginId.myTableName
both (a) and (b) are ok in sql 2000, as long as you login with
myLoginId, but, only (b) works in sql 2005.
seems in sql 2005, you can not omit the "Owner Name" when speifying a
table, unless the table's owner is 'DBO'.
which means, even if I login with myLoginId, I have to use the detailed
format (b),not (a).
this causes trouble in our project -- developed in sql 2000, hundreds
of command omitted the owner name prefix, troublesome to modify one by
one.
Any workaround or suggestions, please? Thanks.
Hi, athos
In SQL Server 2005, schemas and users are different things (in SQL
Server 2000, they were about the same thing). You need to specify the
default schema for each user and then it will work without the prefix.
Use something like this:
ALTER USER myLoginId WITH DEFAULT_SCHEMA = myLoginId
For more informations, see:
http://msdn2.microsoft.com/en-us/library/ms190387.aspx
Razvan
|||Hi Athos
In addition to Razvan's comments, please keep in mind that a login ID and a
database user are two different things. Only a database user can own objects
in a database; a login never does. Although the user name and login id might
be the same name, they are still two different things. And now in SQL 2005
we also have schema names and default schemas. If an object is in your
default schema, no matter who owns the object or the schema, you don't need
to specify the schema.
But it is good practice, and it has ALWAYS been good practice even in SQL
2000, to specify the owner name to avoid ambiguity. There is also a
performance benefit to fully qualifying the object as there is more chance
an existing query plan can be reused the object is fully qualified.
Please read about users and logins in the SQL 2000 BOL.
Please read about user/schema separation in the SQL 2005 BOL.
HTH
Kalen Delaney, SQL Server MVP
www.solidqualitylearning.com
"athos" <athos.liu@.gmail.com> wrote in message
news:1136380087.559222.4320@.o13g2000cwo.googlegrou ps.com...
> Dear All,
> Our project was done in SQL 2000, now we are migrating to 2005.
> however, there are lots of command such as:
> a) SELECT * FROM myTableName
> which, shall be
> b) SELECT * FROM myLoginId.myTableName
> both (a) and (b) are ok in sql 2000, as long as you login with
> myLoginId, but, only (b) works in sql 2005.
> seems in sql 2005, you can not omit the "Owner Name" when speifying a
> table, unless the table's owner is 'DBO'.
> which means, even if I login with myLoginId, I have to use the detailed
> format (b),not (a).
> this causes trouble in our project -- developed in sql 2000, hundreds
> of command omitted the owner name prefix, troublesome to modify one by
> one.
> Any workaround or suggestions, please? Thanks.
>
|||Hi guys,
thanks for your clarificatoin of my misunderstanding of some concepts.
yeah, it's good to fully specify the owner or schema name to avoid
ambiguity, however, it's me that suggest to upgrade our project from
SQL Server 2000 to 2005, and in our developing team I'm trying to avoid
other members' criticizing such as "why shall I search every line to
add some code due to your suggestion?" , or "why something runs fine in
SQL 2000 but not this modern 2005?"
back to my issue, let's say
--On my server "myServer" there is a login named "myLogin", and a
database "myDatabase".
--In "myDatabase" i have a user named "myUserFromMyLogin" which mapped
to the login "myLogin", and a table named "myTable" whose owner (user)
is "myUserFromMyLogin", and a schema named "mySchema" which has one
user "myUserFromMyLogin"
now, "If an object is in your default schema, no matter who owns the
object or the schema, you don't need
to specify the schema. " thanks for you help Kalen, however still a
little bit uncertain here, pls help...
first, when i loggin as the user "myUserFromMyLogin", I shall be using
its default schema "mySchema", right?
second, how to put the object, the table named "myTable", into the
default schema "mySchema"? I can see in the object explorer that the
table's full name is "myUserFromMyLogin.myTable", which means its owner
is "myUserFromMyLogin", which command shall I use to link the object
and the schema?
third, I can directly use commands like "SELECT * FROM myTable" now,
right?
thanks for your valuable time, pls help. Thanks.
yours,
athos.
|||Hi, Athos
If the table's full name is "myUserFromMyLogin.myTable", this means
that it's in the "myUserFromMyLogin" schema. You only need to execute
the following (once), to make the "myUserFromMyLogin" schema to be the
default schema for the "myUserFromMyLogin" user:
ALTER USER myUserFromMyLogin WITH DEFAULT_SCHEMA = myUserFromMyLogin
Razvan
|||Dear Razvan,
Thanks for your reply. Still cannot fix it.
First I made a mistake again. that is, the prefix of the table's
fullname is the schma, not the user.
OK, now what i did is:
Step1. create a Database named [Test], it's default owner is [sa]
Step2. create a User in Database [Test] named [kimliuTest], which maps
to the Login [kkhad\kimliu] on this Database Server, it's a windows
domain user.
Step3. create a Schema in Database [Test] named [schTest], whose Schema
Owner is User [kimliuTest]
Step4. created two tables: [dbo].[t1] and [schTest].[t2]
Step5. run the script
ALTER USER kimliuTest WITH DEFAULT_SCHEMA = schTest
to set the default schema.
now my problem is:
Problem 1.
when I try to run
exec sp_changeobjectowner 'dbo.t1', 'schTest'
exec sp_changeobjectowner 'dbo.t1', 'kimliuTest'
, it returns
Msg 15411, Level 11, State 1, Procedure
sp_changeobjectowner, Line 107
Database principal or schema 'schTest' does not exist in
this database.
Msg 15411, Level 11, State 1, Procedure
sp_changeobjectowner, Line 107
Database principal or schema 'kimliuTest' does not exist in
this database.
why?
Problem 2:
when I try to run
select * from schTest.t2
, everything is OK, but if I run
select * from t2
the error message says:
Msg 208, Level 16, State 1, Line 1
Invalid object name 't2'.
why? I'm loggin in with my [kkhad\kimliu] windows domain id , Active
Monitor also shows that. but the command does not work?
Please help, thank you!
yours,
Athos.
|||Hello, Athos

> Problem 1:
> when I try to run: exec sp_changeobjectowner [...]
> it returns:
> Msg 15411, Level 11, State 1, Procedure sp_changeobjectowner, Line 107
> Database principal or schema 'schTest' does not exist in this database.
Books Online 2005 says the following about sp_changeobjectowner:
Avoid using this feature in new development work, and plan to modify
applications that currently use this feature. Use ALTER SCHEMA or
ALTER AUTHORIZATION instead. sp_changeobjectowner changes both
the schema and the owner. To preserve compatibility with earlier
versions of SQL Server, this stored procedure will only change
object owners when both the current owner and the new owner
own schemas that have the same name as their database user names.
So that's why it didn't work: the schema name and the owner name were
different. We can use one of the following:
ALTER SCHEMA schTest TRANSFER dbo.t1
or:
ALTER AUTHORIZATION ON dbo.t1 to kimliuTest
Note that the two statements written above have different effects:
the first changes the schema, the second changes the owner.
You probably want to run:
ALTER SCHEMA schTest TRANSFER dbo.t1
ALTER AUTHORIZATION ON schTest.t1 TO SCHEMA OWNER
This will make the table to appear as if it was created as
"schTest.t1". Of course, it's better to create the table in the correct
schema from the start (instead of creating it in the dbo schema and
moving it to some other schema after that).

> Problem 2:
> when I try to run [...] select * from t2
> the error message says: "Invalid object name 't2'."
As I've said, you need to change the default schema for the user:
ALTER USER kimliuTest WITH DEFAULT_SCHEMA = schTest
After running the above, if you run "select * from t2" it should work.
You need to keep in mind that if the schema "x" is owned by the user
"y", this does not imply that the user "y" has the schema "x" as his
default schema.
Razvan
|||anybody could help please? thanks!
|||anybody could help, please?
|||anybody could help, please?

"Owner Name" cannot be omitted in sql 2005 querries?

Dear All,
Our project was done in SQL 2000, now we are migrating to 2005.
however, there are lots of command such as:
a) SELECT * FROM myTableName
which, shall be
b) SELECT * FROM myLoginId.myTableName
both (a) and (b) are ok in sql 2000, as long as you login with
myLoginId, but, only (b) works in sql 2005.
seems in sql 2005, you can not omit the "Owner Name" when speifying a
table, unless the table's owner is 'DBO'.
which means, even if I login with myLoginId, I have to use the detailed
format (b),not (a).
this causes trouble in our project -- developed in sql 2000, hundreds
of command omitted the owner name prefix, troublesome to modify one by
one.
Any workaround or suggestions, please? Thanks.Hi, athos
In SQL Server 2005, schemas and users are different things (in SQL
Server 2000, they were about the same thing). You need to specify the
default schema for each user and then it will work without the prefix.
Use something like this:
ALTER USER myLoginId WITH DEFAULT_SCHEMA = myLoginId
For more informations, see:
http://msdn2.microsoft.com/en-us/library/ms190387.aspx
Razvan|||Hi Athos
In addition to Razvan's comments, please keep in mind that a login ID and a
database user are two different things. Only a database user can own objects
in a database; a login never does. Although the user name and login id might
be the same name, they are still two different things. And now in SQL 2005
we also have schema names and default schemas. If an object is in your
default schema, no matter who owns the object or the schema, you don't need
to specify the schema.
But it is good practice, and it has ALWAYS been good practice even in SQL
2000, to specify the owner name to avoid ambiguity. There is also a
performance benefit to fully qualifying the object as there is more chance
an existing query plan can be reused the object is fully qualified.
Please read about users and logins in the SQL 2000 BOL.
Please read about user/schema separation in the SQL 2005 BOL.
HTH
Kalen Delaney, SQL Server MVP
www.solidqualitylearning.com
"athos" <athos.liu@.gmail.com> wrote in message
news:1136380087.559222.4320@.o13g2000cwo.googlegroups.com...
> Dear All,
> Our project was done in SQL 2000, now we are migrating to 2005.
> however, there are lots of command such as:
> a) SELECT * FROM myTableName
> which, shall be
> b) SELECT * FROM myLoginId.myTableName
> both (a) and (b) are ok in sql 2000, as long as you login with
> myLoginId, but, only (b) works in sql 2005.
> seems in sql 2005, you can not omit the "Owner Name" when speifying a
> table, unless the table's owner is 'DBO'.
> which means, even if I login with myLoginId, I have to use the detailed
> format (b),not (a).
> this causes trouble in our project -- developed in sql 2000, hundreds
> of command omitted the owner name prefix, troublesome to modify one by
> one.
> Any workaround or suggestions, please? Thanks.
>|||Hi guys,
thanks for your clarificatoin of my misunderstanding of some concepts.
yeah, it's good to fully specify the owner or schema name to avoid
ambiguity, however, it's me that suggest to upgrade our project from
SQL Server 2000 to 2005, and in our developing team I'm trying to avoid
other members' criticizing such as "why shall I search every line to
add some code due to your suggestion?" , or "why something runs fine in
SQL 2000 but not this modern 2005?"
back to my issue, let's say
--On my server "myServer" there is a login named "myLogin", and a
database "myDatabase".
--In "myDatabase" i have a user named "myUserFromMyLogin" which mapped
to the login "myLogin", and a table named "myTable" whose owner (user)
is "myUserFromMyLogin", and a schema named "mySchema" which has one
user "myUserFromMyLogin"
now, "If an object is in your default schema, no matter who owns the
object or the schema, you don't need
to specify the schema. " thanks for you help Kalen, however still a
little bit uncertain here, pls help...
first, when i loggin as the user "myUserFromMyLogin", I shall be using
its default schema "mySchema", right?
second, how to put the object, the table named "myTable", into the
default schema "mySchema"? I can see in the object explorer that the
table's full name is "myUserFromMyLogin.myTable", which means its owner
is "myUserFromMyLogin", which command shall I use to link the object
and the schema?
third, I can directly use commands like "SELECT * FROM myTable" now,
right?
thanks for your valuable time, pls help. Thanks.
yours,
athos.|||Hi, Athos
If the table's full name is "myUserFromMyLogin.myTable", this means
that it's in the "myUserFromMyLogin" schema. You only need to execute
the following (once), to make the "myUserFromMyLogin" schema to be the
default schema for the "myUserFromMyLogin" user:
ALTER USER myUserFromMyLogin WITH DEFAULT_SCHEMA = myUserFromMyLogin
Razvan|||Dear Razvan,
Thanks for your reply. Still cannot fix it.
First I made a mistake again. that is, the prefix of the table's
fullname is the schma, not the user.
OK, now what i did is:
Step1. create a Database named [Test], it's default owner is [sa]
Step2. create a User in Database [Test] named [kimliuTest], which ma
ps
to the Login [kkhad\kimliu] on this Database Server, it's a windows
domain user.
Step3. create a Schema in Database [Test] named [schTest], whose Sch
ema
Owner is User [kimliuTest]
Step4. created two tables: [dbo].[t1] and [schTest].[t2]
Step5. run the script
ALTER USER kimliuTest WITH DEFAULT_SCHEMA = schTest
to set the default schema.
now my problem is:
Problem 1.
when I try to run
exec sp_changeobjectowner 'dbo.t1', 'schTest'
exec sp_changeobjectowner 'dbo.t1', 'kimliuTest'
, it returns
Msg 15411, Level 11, State 1, Procedure
sp_changeobjectowner, Line 107
Database principal or schema 'schTest' does not exist in
this database.
Msg 15411, Level 11, State 1, Procedure
sp_changeobjectowner, Line 107
Database principal or schema 'kimliuTest' does not exist in
this database.
why?
Problem 2:
when I try to run
select * from schTest.t2
, everything is OK, but if I run
select * from t2
the error message says:
Msg 208, Level 16, State 1, Line 1
Invalid object name 't2'.
why? I'm loggin in with my [kkhad\kimliu] windows domain id , Active
Monitor also shows that. but the command does not work?
Please help, thank you!
yours,
Athos.|||Hello, Athos

> Problem 1:
> when I try to run: exec sp_changeobjectowner [...]
> it returns:
> Msg 15411, Level 11, State 1, Procedure sp_changeobjectowner, Line 107
> Database principal or schema 'schTest' does not exist in this database.
Books Online 2005 says the following about sp_changeobjectowner:
Avoid using this feature in new development work, and plan to modify
applications that currently use this feature. Use ALTER SCHEMA or
ALTER AUTHORIZATION instead. sp_changeobjectowner changes both
the schema and the owner. To preserve compatibility with earlier
versions of SQL Server, this stored procedure will only change
object owners when both the current owner and the new owner
own schemas that have the same name as their database user names.
So that's why it didn't work: the schema name and the owner name were
different. We can use one of the following:
ALTER SCHEMA schTest TRANSFER dbo.t1
or:
ALTER AUTHORIZATION ON dbo.t1 to kimliuTest
Note that the two statements written above have different effects:
the first changes the schema, the second changes the owner.
You probably want to run:
ALTER SCHEMA schTest TRANSFER dbo.t1
ALTER AUTHORIZATION ON schTest.t1 TO SCHEMA OWNER
This will make the table to appear as if it was created as
"schTest.t1". Of course, it's better to create the table in the correct
schema from the start (instead of creating it in the dbo schema and
moving it to some other schema after that).

> Problem 2:
> when I try to run [...] select * from t2
> the error message says: "Invalid object name 't2'."
As I've said, you need to change the default schema for the user:
ALTER USER kimliuTest WITH DEFAULT_SCHEMA = schTest
After running the above, if you run "select * from t2" it should work.
You need to keep in mind that if the schema "x" is owned by the user
"y", this does not imply that the user "y" has the schema "x" as his
default schema.
Razvan|||anybody could help please? thanks!|||anybody could help, please?|||anybody could help, please?

"owner name" cannot be omitted in sql 2005 querries?

Dear All,

Our project was done in SQL 2000, now we are migrating to 2005.
however, there are lots of command such as:

a) SELECT * FROM myTableName

which, shall be

b) SELECT * FROM myLoginId.myTableName

both (a) and (b) are ok in sql 2000, as long as you login with
myLoginId, but, only (b) works in sql 2005.

seems in sql 2005, you can not omit the "Owner Name" when speifying a
table, unless the table's owner is 'DBO'.

which means, even if I login with myLoginId, I have to use the detailed
format (b),not (a).

this causes trouble in our project -- developed in sql 2000, hundreds
of command omitted the owner name prefix, troublesome to modify one by
one.

Any workaround or suggestions, please? Thanks.Hi, athos

Please do not "multi-post". If you really want to send a message to
more than one newsgroup, post a single message with all the newsgroups
in the "To:" field (this is called "cross-posting". See:
http://www.aspfaq.com/etiquette.asp?id=5003
http://www.aspfaq.com/etiquette.asp?id=5004

See my answer in the microsoft.public.sqlserver.server newsgroup:
http://groups.google.com/group/micr...ede4803725ce795

Razvan|||Dear Razvan,

thanks for your information. Sorry I never noticed the line saying
"(Separate multiple groups with commas)". thanks.

yours
Athos.

"Owner Name" cannot be omitted in sql 2005 querries?

Dear All,
Our project was done in SQL 2000, now we are migrating to 2005.
however, there are lots of command such as:
a) SELECT * FROM myTableName
which, shall be
b) SELECT * FROM myLoginId.myTableName
both (a) and (b) are ok in sql 2000, as long as you login with
myLoginId, but, only (b) works in sql 2005.
seems in sql 2005, you can not omit the "Owner Name" when speifying a
table, unless the table's owner is 'DBO'.
which means, even if I login with myLoginId, I have to use the detailed
format (b),not (a).
this causes trouble in our project -- developed in sql 2000, hundreds
of command omitted the owner name prefix, troublesome to modify one by
one.
Any workaround or suggestions, please? Thanks.Hi, athos
In SQL Server 2005, schemas and users are different things (in SQL
Server 2000, they were about the same thing). You need to specify the
default schema for each user and then it will work without the prefix.
Use something like this:
ALTER USER myLoginId WITH DEFAULT_SCHEMA = myLoginId
For more informations, see:
http://msdn2.microsoft.com/en-us/library/ms190387.aspx
Razvan|||Hi Athos
In addition to Razvan's comments, please keep in mind that a login ID and a
database user are two different things. Only a database user can own objects
in a database; a login never does. Although the user name and login id might
be the same name, they are still two different things. And now in SQL 2005
we also have schema names and default schemas. If an object is in your
default schema, no matter who owns the object or the schema, you don't need
to specify the schema.
But it is good practice, and it has ALWAYS been good practice even in SQL
2000, to specify the owner name to avoid ambiguity. There is also a
performance benefit to fully qualifying the object as there is more chance
an existing query plan can be reused the object is fully qualified.
Please read about users and logins in the SQL 2000 BOL.
Please read about user/schema separation in the SQL 2005 BOL.
--
HTH
Kalen Delaney, SQL Server MVP
www.solidqualitylearning.com
"athos" <athos.liu@.gmail.com> wrote in message
news:1136380087.559222.4320@.o13g2000cwo.googlegroups.com...
> Dear All,
> Our project was done in SQL 2000, now we are migrating to 2005.
> however, there are lots of command such as:
> a) SELECT * FROM myTableName
> which, shall be
> b) SELECT * FROM myLoginId.myTableName
> both (a) and (b) are ok in sql 2000, as long as you login with
> myLoginId, but, only (b) works in sql 2005.
> seems in sql 2005, you can not omit the "Owner Name" when speifying a
> table, unless the table's owner is 'DBO'.
> which means, even if I login with myLoginId, I have to use the detailed
> format (b),not (a).
> this causes trouble in our project -- developed in sql 2000, hundreds
> of command omitted the owner name prefix, troublesome to modify one by
> one.
> Any workaround or suggestions, please? Thanks.
>|||Hi guys,
thanks for your clarificatoin of my misunderstanding of some concepts.
yeah, it's good to fully specify the owner or schema name to avoid
ambiguity, however, it's me that suggest to upgrade our project from
SQL Server 2000 to 2005, and in our developing team I'm trying to avoid
other members' criticizing such as "why shall I search every line to
add some code due to your suggestion?" , or "why something runs fine in
SQL 2000 but not this modern 2005?"
back to my issue, let's say
--On my server "myServer" there is a login named "myLogin", and a
database "myDatabase".
--In "myDatabase" i have a user named "myUserFromMyLogin" which mapped
to the login "myLogin", and a table named "myTable" whose owner (user)
is "myUserFromMyLogin", and a schema named "mySchema" which has one
user "myUserFromMyLogin"
now, "If an object is in your default schema, no matter who owns the
object or the schema, you don't need
to specify the schema. " thanks for you help Kalen, however still a
little bit uncertain here, pls help...
first, when i loggin as the user "myUserFromMyLogin", I shall be using
its default schema "mySchema", right?
second, how to put the object, the table named "myTable", into the
default schema "mySchema"? I can see in the object explorer that the
table's full name is "myUserFromMyLogin.myTable", which means its owner
is "myUserFromMyLogin", which command shall I use to link the object
and the schema?
third, I can directly use commands like "SELECT * FROM myTable" now,
right?
thanks for your valuable time, pls help. Thanks.
yours,
athos.|||Hi, Athos
If the table's full name is "myUserFromMyLogin.myTable", this means
that it's in the "myUserFromMyLogin" schema. You only need to execute
the following (once), to make the "myUserFromMyLogin" schema to be the
default schema for the "myUserFromMyLogin" user:
ALTER USER myUserFromMyLogin WITH DEFAULT_SCHEMA = myUserFromMyLogin
Razvan|||Dear Razvan,
Thanks for your reply. Still cannot fix it.
First I made a mistake again. that is, the prefix of the table's
fullname is the schma, not the user.
OK, now what i did is:
Step1. create a Database named [Test], it's default owner is [sa]
Step2. create a User in Database [Test] named [kimliuTest], which maps
to the Login [kkhad\kimliu] on this Database Server, it's a windows
domain user.
Step3. create a Schema in Database [Test] named [schTest], whose Schema
Owner is User [kimliuTest]
Step4. created two tables: [dbo].[t1] and [schTest].[t2]
Step5. run the script
ALTER USER kimliuTest WITH DEFAULT_SCHEMA = schTest
to set the default schema.
now my problem is:
Problem 1.
when I try to run
exec sp_changeobjectowner 'dbo.t1', 'schTest'
exec sp_changeobjectowner 'dbo.t1', 'kimliuTest'
, it returns
Msg 15411, Level 11, State 1, Procedure
sp_changeobjectowner, Line 107
Database principal or schema 'schTest' does not exist in
this database.
Msg 15411, Level 11, State 1, Procedure
sp_changeobjectowner, Line 107
Database principal or schema 'kimliuTest' does not exist in
this database.
why?
Problem 2:
when I try to run
select * from schTest.t2
, everything is OK, but if I run
select * from t2
the error message says:
Msg 208, Level 16, State 1, Line 1
Invalid object name 't2'.
why? I'm loggin in with my [kkhad\kimliu] windows domain id , Active
Monitor also shows that. but the command does not work?
Please help, thank you!
yours,
Athos.|||Hello, Athos
> Problem 1:
> when I try to run: exec sp_changeobjectowner [...]
> it returns:
> Msg 15411, Level 11, State 1, Procedure sp_changeobjectowner, Line 107
> Database principal or schema 'schTest' does not exist in this database.
Books Online 2005 says the following about sp_changeobjectowner:
Avoid using this feature in new development work, and plan to modify
applications that currently use this feature. Use ALTER SCHEMA or
ALTER AUTHORIZATION instead. sp_changeobjectowner changes both
the schema and the owner. To preserve compatibility with earlier
versions of SQL Server, this stored procedure will only change
object owners when both the current owner and the new owner
own schemas that have the same name as their database user names.
So that's why it didn't work: the schema name and the owner name were
different. We can use one of the following:
ALTER SCHEMA schTest TRANSFER dbo.t1
or:
ALTER AUTHORIZATION ON dbo.t1 to kimliuTest
Note that the two statements written above have different effects:
the first changes the schema, the second changes the owner.
You probably want to run:
ALTER SCHEMA schTest TRANSFER dbo.t1
ALTER AUTHORIZATION ON schTest.t1 TO SCHEMA OWNER
This will make the table to appear as if it was created as
"schTest.t1". Of course, it's better to create the table in the correct
schema from the start (instead of creating it in the dbo schema and
moving it to some other schema after that).
> Problem 2:
> when I try to run [...] select * from t2
> the error message says: "Invalid object name 't2'."
As I've said, you need to change the default schema for the user:
ALTER USER kimliuTest WITH DEFAULT_SCHEMA = schTest
After running the above, if you run "select * from t2" it should work.
You need to keep in mind that if the schema "x" is owned by the user
"y", this does not imply that the user "y" has the schema "x" as his
default schema.
Razvan|||anybody could help please? thanks!|||anybody could help, please?|||anybody could help, please?|||anybody could help please?|||Dear Razvan,
Thanks for you explanation about [sp_changeobjectowner], [ALTER
SCHEMA..] and [ALTER AUTHORIZATION ..], however, the main issue is
still not solved.
Maybe there is some misunderstanding, what I did is:
Step1. create a Database named [Test] with default owner [sa]
Step2. in Database [Test], create a User [kimliuTest] mapping to Login
[kimliu] on this Database Server
Step3. in Database [Test], create a Schema [schTest] owned by
[kimliuTest]
Step4. created two tables: [dbo].[t1] and [schTest].[t2]
Step5. run the script
ALTER USER kimliuTest WITH DEFAULT_SCHEMA = schTest
to set the default schema.
Repeat, I HAVE gone through Step 5, run the script "ALTER USER
kimliuTest WITH DEFAULT_SCHEMA = schTest " to set the default schema.
Then, after all of these steps --
Case 1: Of course, everything is OK when run "SELECT * FROM
schTest.t2", either by running in a SQL Query Editor Window or by .net
code.
Case 2: Cannot use "SELECT * FROM t2", the error message says: "Msg
208, Level 16, State 1, Line 1, Invalid object name 't2'. ".
Case 3: Strangely enough, everything is OK when run "EXECUTE AS
USER='kimliuTest'; SELECT * FROM schTest.t2".
Case 4: Everything is also OK when only run "EXECUTE AS LOGIN='kimliu'
".
Case 5: But, cannot use "EXECUTE AS LOGIN='kimliu'; SELECT * FROM t2",
the error message is the same: "Msg 208, Level 16, State 1, Line 1,
Invalid object name 't2'. ".
I am LOST! Anybody could help PLEASE~~ Thank you very much~
yours
Athos|||Dear Razvan,
Thanks for you explanation about [sp_changeobjectowner], [ALTER
SCHEMA..] and [ALTER AUTHORIZATION ..], however, the main issue is
still not solved.
Maybe there is some misunderstanding, what I did is:
Step1. create a Database named [Test] with default owner [sa]
Step2. in Database [Test], create a User [kimliuTest] mapping to Login
[kimliu] on this Database Server
Step3. in Database [Test], create a Schema [schTest] owned by
[kimliuTest]
Step4. created two tables: [dbo].[t1] and [schTest].[t2]
Step5. run the script
ALTER USER kimliuTest WITH DEFAULT_SCHEMA = schTest
to set the default schema.
Repeat, I HAVE gone through Step 5, run the script "ALTER USER
kimliuTest WITH DEFAULT_SCHEMA = schTest " to set the default schema.
Then, after all of these steps --
Case 1: Of course, everything is OK when run "SELECT * FROM
schTest.t2", either by running in a SQL Query Editor Window or by .net
code.
Case 2: Cannot use "SELECT * FROM t2", the error message says: "Msg
208, Level 16, State 1, Line 1, Invalid object name 't2'. ".
Case 3: Strangely enough, everything is OK when run "EXECUTE AS
USER='kimliuTest'; SELECT * FROM t2".
Case 4: Everything is also OK when only run "EXECUTE AS LOGIN='kimliu'
".
Case 5: But, cannot use "EXECUTE AS LOGIN='kimliu'; SELECT * FROM t2",
the error message is the same: "Msg 208, Level 16, State 1, Line 1,
Invalid object name 't2'. ".
I am LOST! Anybody could help PLEASE~~ Thank you very much~
yours
Athos|||Hi, Athos
> Repeat, I HAVE gone through Step 5, run the script "ALTER USER
> kimliuTest WITH DEFAULT_SCHEMA = schTest " to set the default schema.
Sorry, I overlook that part when I first read your previous message.
I was able to reproduce the behaviour you mentioned, but not
consistently.
Please try the following:
USE test
EXECUTE AS LOGIN='kkhad\kimliu'
SELECT SYSTEM_USER AS SystemUser, DB_NAME() as DatabaseName,
USER as UserName, default_schema_name
FROM sys.database_principals WHERE name=USER
REVERT
What result do you get ?
Razvan

"Not enough server storage is available to process this command"

Hi,
We have several customers using replication on similar databases - all with the same schema, published using essentially the same script. One of them has been getting the "Not enough server storage" message when they try to access any network shares on th
e server with the published database on it. This starts happening between 24-36 hours after they first run the snapshot agent.
The application log contains an entry saying "The process could not create file \\[SERVER]\REPLDATA\unc",
and the system log has one saying "The server was unable to allocate from the system paged pool because the pool was empty".
When they turn off the replication everything is fine.
I suggested increasing the IRPStackSize value in the registry, as this was mentioned in the closest article I could find on MSDN/KB (something about Norton AntiVirus), but this didn't make any difference.
This is SQL Server 2000 running on Windows 2000 Server, all with up-to-date service packs.
Any ideas or suggestions would be appreciated.
Mark
from your earlier post i understand that the snapshot creation part gives
out this message.
If the error occurs while the snapshot is being generated, check the
following"
1. Check if the sql server service account has appropriate NTFS and share
level permissions to write to the repldata directory.
2. Check if there is enough storage space on the disk for creating files
in repldata directory.
3. Check if you can run xp_cmdshell "dir
\\distributorname\c$\mssql\repldata"
and dir \\distributor\c$\mssql\repldata from command prompt.
If the error occurs after the snapshot has been completely generated, Refer
-
* KB : 285089 IRPStackSize Parameter in Windows 2000
http://support.microsoft.com/?id=285089
Pls do let me know of the SQL server version (build number). and the event
id's of the event log messages.
Does this message stop replication? are the subscribers and publisher in
sync? - Just to confirm if this message is obstructing replication from
being in sync.

Saturday, February 25, 2012

"Net Send" from SQL2000 on Windows 2003.

Hi all.
The following command don't work on ours SQL server anymore. Not sure why,
but could it be that the command "Net Send" is removed for NT 2000?
Any ideas.
Thanks
Geir
DECLARE @.Message varchar(255)
Set @.Message = 'net send USER Message to OLNY from SAM : . TEST, TEST, Price
to low!. Order 6555 '
EXEC master.. xp_cmdshell @.Message, no_outputHi
Is your SQL Server Service Account a Domain account? If not, change it to a
domain account.
Regards
--
Mike Epprecht, Microsoft SQL Server MVP
Zurich, Switzerland
IM: mike@.epprecht.net
MVP Program: http://www.microsoft.com/mvp
Blog: http://www.msmvps.com/epprecht/
"Geir Holme" <geir@.multicase.no> wrote in message
news:%23lrHkVOxFHA.3720@.TK2MSFTNGP11.phx.gbl...
> Hi all.
> The following command don't work on ours SQL server anymore. Not sure why,
> but could it be that the command "Net Send" is removed for NT 2000?
> Any ideas.
> Thanks
> Geir
> DECLARE @.Message varchar(255)
> Set @.Message = 'net send USER Message to OLNY from SAM : . TEST, TEST,
> Price to low!. Order 6555 '
> EXEC master.. xp_cmdshell @.Message, no_output
>|||Hi
See this example written by Tibor
USE master
GO
CREATE PROC sp_dbm_notify_users @.msg VARCHAR(255) AS
/ ****************************************
***********************************
****/
/* This procedure does a NET SEND to all connected computers.
*/
/* Requires that the messenger service is running on the client.
*/
/* The bat file is a sample showing how a message can be sent from the OS.
A */
/* shortcut to the bat file can be placed on the desktop, for instance
*/
/* The procedure takes the following parameter:
*/
/* @.msg VARCHAR(255) (required): The message to be sent
*/
/* Written by Tibor Karaszi and Brje Carlsson 1999. www.dbmaint.com
*/
/* Tested on verion 6.5, 7.0 and 8.0.
*/
/ ****************************************
***********************************
****/
SET NOCOUNT ON
--Get version number and verify supported version
DECLARE @.ver VARCHAR(7)
SELECT @.ver = CASE
WHEN CHARINDEX('6.50', @.@.VERSION) > 0 THEN '6.50'
WHEN CHARINDEX('7.00', @.@.VERSION) > 0 THEN '7.00'
WHEN CHARINDEX('8.00', @.@.VERSION) > 0 THEN '8.00'
ELSE 'Unknown'
END
IF @.ver = 'Unknown'
BEGIN
RAISERROR('Unsupported version of SQL Server.',16,1)
RETURN -101
END
--Declare variables section
DECLARE loop_name INSENSITIVE CURSOR FOR
SELECT DISTINCT LTRIM(RTRIM(hostname))
FROM master..sysprocesses
WHERE DATALENGTH(LTRIM(RTRIM(hostname))) > 0
OPEN loop_name
DECLARE @.host_name VARCHAR(30)
DECLARE @.exec_str VARCHAR(255)
FETCH NEXT FROM loop_name INTO @.host_name
WHILE (@.@.fetch_status = 0)
BEGIN
SELECT @.exec_str = 'master..xp_cmdshell "NET SEND ' + @.host_name + ' '
+ @.msg + '"'
EXEC( @.exec_str)
FETCH NEXT FROM loop_name INTO @.host_name
END
DEALLOCATE loop_name
GO
/* Sample Execution:
EXEC sp_dbm_notify_users 'SQL Server will shut down in 30 minutes!'
*/

"Geir Holme" <geir@.multicase.no> wrote in message
news:%23lrHkVOxFHA.3720@.TK2MSFTNGP11.phx.gbl...
> Hi all.
> The following command don't work on ours SQL server anymore. Not sure why,
> but could it be that the command "Net Send" is removed for NT 2000?
> Any ideas.
> Thanks
> Geir
> DECLARE @.Message varchar(255)
> Set @.Message = 'net send USER Message to OLNY from SAM : . TEST, TEST,
> Price to low!. Order 6555 '
> EXEC master.. xp_cmdshell @.Message, no_output
>|||it's possible that your messenger service may be shut down (check start ->
run-> services.msc -> messenger).
Regards,
Mary
"Geir Holme" <geir@.multicase.no> wrote in message
news:%23lrHkVOxFHA.3720@.TK2MSFTNGP11.phx.gbl...
> Hi all.
> The following command don't work on ours SQL server anymore. Not sure why,
> but could it be that the command "Net Send" is removed for NT 2000?
> Any ideas.
> Thanks
> Geir
> DECLARE @.Message varchar(255)
> Set @.Message = 'net send USER Message to OLNY from SAM : . TEST, TEST,
> Price to low!. Order 6555 '
> EXEC master.. xp_cmdshell @.Message, no_output
>

Friday, February 24, 2012

"Invalid distribution command" in transaction replication

HI
I had a replication working nicely for long time. SQL 2k, SP3.
One day it stoped working with the error "Invalid distribution command." and
last action is: insert into "ponim" ("tz_pone.
Transaction sequence number and command ID of last execution batch are
0x0000829800000ABB000100000000 and 1.
I think maybe that day I added a new column using sp_repladdcolumn.
I want to say that the same script I run for that replication I ran for
another 3 similar replication and they all still work prefectly.
Any Ideas what I can do?
Please take in consider that I have lots of data in the publication that
couldn't be send to the subscriber becouse of the above error.
Thanks
use sp_browsereplcmds to identiy this command. Then apply this command
on the subcriber.
Then update msreplication_subscripions with the xaxct_seqno for this
command. This will cause it to skip this command.

"Invalid distribution command" in transaction replication

HI
I had a replication working nicely for long time. SQL 2k, SP3.
One day it stoped working with the error "Invalid distribution command." and
last action is: insert into "ponim" ("tz_pone.
Transaction sequence number and command ID of last execution batch are
0x0000829800000ABB000100000000 and 1.
I think maybe that day I added a new column using sp_repladdcolumn.
I want to say that the same script I run for that replication I ran for
another 3 similar replication and they all still work prefectly.
Any Ideas what I can do?
Please take in consider that I have lots of data in the publication that
couldn't be send to the subscriber becouse of the above error.
Thanksuse sp_browsereplcmds to identiy this command. Then apply this command
on the subcriber.
Then update msreplication_subscripions with the xaxct_seqno for this
command. This will cause it to skip this command.

"Invalid distribution command" in transaction replication

HI
I had a replication working nicely for long time. SQL 2k, SP3.
One day it stoped working with the error "Invalid distribution
command." and
last action is: insert into "ponim" ("tz_pone.
Transaction sequence number and command ID of last execution batch are
0x0000829800000ABB000100000000 and 1.
I think maybe that day I added a new column using sp_repladdcolumn.
I want to say that the same script I run for that replication I ran for
another 3 similar replication and they all still work prefectly.
Any Ideas what I can do?
Please take in consider that I have lots of data in the publication
that
couldn't be send to the subscriber becouse of the above error.
Thanks
Please enable logging as per this article:
http://support.microsoft.com/?id=312292 to get more details about the
failing command.
sp_browsereplcmds could also be used to find these details.
Cheers,
Paul Ibison SQL Server MVP, www.replicationanswers.com .

"Invalid distribution command" in transaction replication

HI
I had a replication working nicely for long time. SQL 2k, SP3.
One day it stoped working with the error "Invalid distribution command." and
last action is: insert into "ponim" ("tz_pone.
Transaction sequence number and command ID of last execution batch are
0x0000829800000ABB000100000000 and 1.
I think maybe that day I added a new column using sp_repladdcolumn.
I want to say that the same script I run for that replication I ran for
another 3 similar replication and they all still work prefectly.
Any Ideas what I can do?
Please take in consider that I have lots of data in the publication that
couldn't be send to the subscriber becouse of the above error.
Thanks
use sp_browsereplcmds to identiy this command. Then apply this command
on the subcriber.
Then update msreplication_subscripions with the xaxct_seqno for this
command. This will cause it to skip this command.

"Invalid distribution command" in transaction replication

HI
I had a replication working nicely for long time. SQL 2k, SP3.
One day it stoped working with the error "Invalid distribution command." and
last action is: insert into "ponim" ("tz_pone.
Transaction sequence number and command ID of last execution batch are
0x0000829800000ABB000100000000 and 1.
I think maybe that day I added a new column using sp_repladdcolumn.
I want to say that the same script I run for that replication I ran for
another 3 similar replication and they all still work prefectly.
Any Ideas what I can do?
Please take in consider that I have lots of data in the publication that
couldn't be send to the subscriber becouse of the above error.
Thanksuse sp_browsereplcmds to identiy this command. Then apply this command
on the subcriber.
Then update msreplication_subscripions with the xaxct_seqno for this
command. This will cause it to skip this command.

Sunday, February 19, 2012

"Invalid command option D."

When trying to start SQL 2000 from dos prompt.
I changed the start up locations -D -L -E for my server from EM
server properties, Moved the Data and log files (MDF and LDFs), then tried
to
restart the server and it failed. I duplicated all files to their original
locations,
and again tried to restart from command-line with -d -l but nothing works...
When I changed the Server Properties I used capital D, and when I try to
start
SQL from DOS I get "Invalid command option D."
Please help me !! what Have I done to myself
Does anyone have any idea what I need to do to get this server backup'
Thanks!!WANNABE wrote:
> When trying to start SQL 2000 from dos prompt.
> I changed the start up locations -D -L -E for my server from EM
> server properties, Moved the Data and log files (MDF and LDFs), then tried
> to
> restart the server and it failed. I duplicated all files to their original
> locations,
> and again tried to restart from command-line with -d -l but nothing works...
> When I changed the Server Properties I used capital D, and when I try to
> start
> SQL from DOS I get "Invalid command option D."
> Please help me !! what Have I done to myself
> Does anyone have any idea what I need to do to get this server backup'
> Thanks!!
>
What is the EXACT command, including switches, that you are running from
the DOS prompt?
Tracy McKibben
MCDBA
http://www.realsqlguy.com|||You need to put back the model database to where it used to be. The reference to the model database
is *inside* master.mdf. SQL Server cannot start without model since it cannot create tempdb, and SQL
Server cannot live without tempdb. You probably want to do the same for msdb, and other user
database, but those will not prohibit SQL Server from starting. You really should read KB 224071
first... :-)
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"WANNABE" <breichenbach AT istate DOT com> wrote in message
news:O%23ITWuKvGHA.4460@.TK2MSFTNGP04.phx.gbl...
> When trying to start SQL 2000 from dos prompt.
> I changed the start up locations -D -L -E for my server from EM
> server properties, Moved the Data and log files (MDF and LDFs), then tried to
> restart the server and it failed. I duplicated all files to their original locations,
> and again tried to restart from command-line with -d -l but nothing works...
> When I changed the Server Properties I used capital D, and when I try to start
> SQL from DOS I get "Invalid command option D."
> Please help me !! what Have I done to myself
> Does anyone have any idea what I need to do to get this server backup'
> Thanks!!
>|||Thanks, but I do have all dbs in both places, and it still wont start. I
try "sqlservr" and it returns the "Invalid command option D."
error
"Tibor Karaszi" <tibor_please.no.email_karaszi@.hotmail.nomail.com> wrote in
message news:%23FpPvYLvGHA.428@.TK2MSFTNGP03.phx.gbl...
> You need to put back the model database to where it used to be. The
> reference to the model database is *inside* master.mdf. SQL Server cannot
> start without model since it cannot create tempdb, and SQL Server cannot
> live without tempdb. You probably want to do the same for msdb, and other
> user database, but those will not prohibit SQL Server from starting. You
> really should read KB 224071 first... :-)
> --
> Tibor Karaszi, SQL Server MVP
> http://www.karaszi.com/sqlserver/default.asp
> http://www.solidqualitylearning.com/
>
> "WANNABE" <breichenbach AT istate DOT com> wrote in message
> news:O%23ITWuKvGHA.4460@.TK2MSFTNGP04.phx.gbl...
>> When trying to start SQL 2000 from dos prompt.
>> I changed the start up locations -D -L -E for my server from EM
>> server properties, Moved the Data and log files (MDF and LDFs), then
>> tried to
>> restart the server and it failed. I duplicated all files to their
>> original locations,
>> and again tried to restart from command-line with -d -l but nothing
>> works...
>> When I changed the Server Properties I used capital D, and when I try to
>> start
>> SQL from DOS I get "Invalid command option D."
>> Please help me !! what Have I done to myself
>> Does anyone have any idea what I need to do to get this server backup'
>> Thanks!!
>|||Can you post what you try to execute in the command prompt? Also, the switches to SQL Server
programs are case sensitive.
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"WANNABE" <breichenbach AT istate DOT com> wrote in message
news:e%23rPBuLvGHA.4460@.TK2MSFTNGP05.phx.gbl...
> Thanks, but I do have all dbs in both places, and it still wont start. I try "sqlservr" and it
> returns the "Invalid command option D."
> error
> "Tibor Karaszi" <tibor_please.no.email_karaszi@.hotmail.nomail.com> wrote in message
> news:%23FpPvYLvGHA.428@.TK2MSFTNGP03.phx.gbl...
>> You need to put back the model database to where it used to be. The reference to the model
>> database is *inside* master.mdf. SQL Server cannot start without model since it cannot create
>> tempdb, and SQL Server cannot live without tempdb. You probably want to do the same for msdb, and
>> other user database, but those will not prohibit SQL Server from starting. You really should read
>> KB 224071 first... :-)
>> --
>> Tibor Karaszi, SQL Server MVP
>> http://www.karaszi.com/sqlserver/default.asp
>> http://www.solidqualitylearning.com/
>>
>> "WANNABE" <breichenbach AT istate DOT com> wrote in message
>> news:O%23ITWuKvGHA.4460@.TK2MSFTNGP04.phx.gbl...
>> When trying to start SQL 2000 from dos prompt.
>> I changed the start up locations -D -L -E for my server from EM
>> server properties, Moved the Data and log files (MDF and LDFs), then tried to
>> restart the server and it failed. I duplicated all files to their original locations,
>> and again tried to restart from command-line with -d -l but nothing works...
>> When I changed the Server Properties I used capital D, and when I try to start
>> SQL from DOS I get "Invalid command option D."
>> Please help me !! what Have I done to myself
>> Does anyone have any idea what I need to do to get this server backup'
>> Thanks!!
>>
>|||I will be gone until next Tuesday.. I'll repost this if I still need help..
All I enter from the command line prompt is
sqlservr
"Tibor Karaszi" <tibor_please.no.email_karaszi@.hotmail.nomail.com> wrote in
message news:%23dIFp4LvGHA.324@.TK2MSFTNGP06.phx.gbl...
> Can you post what you try to execute in the command prompt? Also, the
> switches to SQL Server programs are case sensitive.
> --
> Tibor Karaszi, SQL Server MVP
> http://www.karaszi.com/sqlserver/default.asp
> http://www.solidqualitylearning.com/
>
> "WANNABE" <breichenbach AT istate DOT com> wrote in message
> news:e%23rPBuLvGHA.4460@.TK2MSFTNGP05.phx.gbl...
>> Thanks, but I do have all dbs in both places, and it still wont start. I
>> try "sqlservr" and it returns the "Invalid command option D."
>> error
>> "Tibor Karaszi" <tibor_please.no.email_karaszi@.hotmail.nomail.com> wrote
>> in message news:%23FpPvYLvGHA.428@.TK2MSFTNGP03.phx.gbl...
>> You need to put back the model database to where it used to be. The
>> reference to the model database is *inside* master.mdf. SQL Server
>> cannot start without model since it cannot create tempdb, and SQL Server
>> cannot live without tempdb. You probably want to do the same for msdb,
>> and other user database, but those will not prohibit SQL Server from
>> starting. You really should read KB 224071 first... :-)
>> --
>> Tibor Karaszi, SQL Server MVP
>> http://www.karaszi.com/sqlserver/default.asp
>> http://www.solidqualitylearning.com/
>>
>> "WANNABE" <breichenbach AT istate DOT com> wrote in message
>> news:O%23ITWuKvGHA.4460@.TK2MSFTNGP04.phx.gbl...
>> When trying to start SQL 2000 from dos prompt.
>> I changed the start up locations -D -L -E for my server from EM
>> server properties, Moved the Data and log files (MDF and LDFs), then
>> tried to
>> restart the server and it failed. I duplicated all files to their
>> original locations,
>> and again tried to restart from command-line with -d -l but nothing
>> works...
>> When I changed the Server Properties I used capital D, and when I try
>> to start
>> SQL from DOS I get "Invalid command option D."
>> Please help me !! what Have I done to myself
>> Does anyone have any idea what I need to do to get this server backup'
>> Thanks!!
>>
>>
>|||If you only run sqlservr from command line, then the parameters are picked up from the registry. I
suggest you edit the registry to put in the right case, d instead of D.
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"WANNABE" <breichenbach AT istate DOT com> wrote in message
news:OspGsOMvGHA.4436@.TK2MSFTNGP05.phx.gbl...
>I will be gone until next Tuesday.. I'll repost this if I still need help..
> All I enter from the command line prompt is
> sqlservr
> "Tibor Karaszi" <tibor_please.no.email_karaszi@.hotmail.nomail.com> wrote in message
> news:%23dIFp4LvGHA.324@.TK2MSFTNGP06.phx.gbl...
>> Can you post what you try to execute in the command prompt? Also, the switches to SQL Server
>> programs are case sensitive.
>> --
>> Tibor Karaszi, SQL Server MVP
>> http://www.karaszi.com/sqlserver/default.asp
>> http://www.solidqualitylearning.com/
>>
>> "WANNABE" <breichenbach AT istate DOT com> wrote in message
>> news:e%23rPBuLvGHA.4460@.TK2MSFTNGP05.phx.gbl...
>> Thanks, but I do have all dbs in both places, and it still wont start. I try "sqlservr" and it
>> returns the "Invalid command option D."
>> error
>> "Tibor Karaszi" <tibor_please.no.email_karaszi@.hotmail.nomail.com> wrote in message
>> news:%23FpPvYLvGHA.428@.TK2MSFTNGP03.phx.gbl...
>> You need to put back the model database to where it used to be. The reference to the model
>> database is *inside* master.mdf. SQL Server cannot start without model since it cannot create
>> tempdb, and SQL Server cannot live without tempdb. You probably want to do the same for msdb,
>> and other user database, but those will not prohibit SQL Server from starting. You really
>> should read KB 224071 first... :-)
>> --
>> Tibor Karaszi, SQL Server MVP
>> http://www.karaszi.com/sqlserver/default.asp
>> http://www.solidqualitylearning.com/
>>
>> "WANNABE" <breichenbach AT istate DOT com> wrote in message
>> news:O%23ITWuKvGHA.4460@.TK2MSFTNGP04.phx.gbl...
>> When trying to start SQL 2000 from dos prompt.
>> I changed the start up locations -D -L -E for my server from EM
>> server properties, Moved the Data and log files (MDF and LDFs), then tried to
>> restart the server and it failed. I duplicated all files to their original locations,
>> and again tried to restart from command-line with -d -l but nothing works...
>> When I changed the Server Properties I used capital D, and when I try to start
>> SQL from DOS I get "Invalid command option D."
>> Please help me !! what Have I done to myself
>> Does anyone have any idea what I need to do to get this server backup'
>> Thanks!!
>>
>>
>

"Invalid command option D."

When trying to start SQL 2000 from dos prompt.
I changed the start up locations -D -L -E for my server from EM
server properties, Moved the Data and log files (MDF and LDFs), then tried
to
restart the server and it failed. I duplicated all files to their original
locations,
and again tried to restart from command-line with -d -l but nothing works...
When I changed the Server Properties I used capital D, and when I try to
start
SQL from DOS I get "Invalid command option D."
Please help me !! what Have I done to myself
Does anyone have any idea what I need to do to get this server backup'
Thanks!!WANNABE wrote:
> When trying to start SQL 2000 from dos prompt.
> I changed the start up locations -D -L -E for my server from EM
> server properties, Moved the Data and log files (MDF and LDFs), then tried
> to
> restart the server and it failed. I duplicated all files to their origina
l
> locations,
> and again tried to restart from command-line with -d -l but nothing works.
.
> When I changed the Server Properties I used capital D, and when I try to
> start
> SQL from DOS I get "Invalid command option D."
> Please help me !! what Have I done to myself
> Does anyone have any idea what I need to do to get this server backup'
> Thanks!!
>
What is the EXACT command, including switches, that you are running from
the DOS prompt?
Tracy McKibben
MCDBA
http://www.realsqlguy.com|||You need to put back the model database to where it used to be. The referenc
e to the model database
is *inside* master.mdf. SQL Server cannot start without model since it canno
t create tempdb, and SQL
Server cannot live without tempdb. You probably want to do the same for msdb
, and other user
database, but those will not prohibit SQL Server from starting. You really s
hould read KB 224071
first... :-)
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"WANNABE" <breichenbach AT istate DOT com> wrote in message
news:O%23ITWuKvGHA.4460@.TK2MSFTNGP04.phx.gbl...
> When trying to start SQL 2000 from dos prompt.
> I changed the start up locations -D -L -E for my server from EM
> server properties, Moved the Data and log files (MDF and LDFs), then tried
to
> restart the server and it failed. I duplicated all files to their origina
l locations,
> and again tried to restart from command-line with -d -l but nothing works.
.
> When I changed the Server Properties I used capital D, and when I try to s
tart
> SQL from DOS I get "Invalid command option D."
> Please help me !! what Have I done to myself
> Does anyone have any idea what I need to do to get this server backup'
> Thanks!!
>|||Thanks, but I do have all dbs in both places, and it still wont start. I
try "sqlservr" and it returns the "Invalid command option D."
error
"Tibor Karaszi" <tibor_please.no.email_karaszi@.hotmail.nomail.com> wrote in
message news:%23FpPvYLvGHA.428@.TK2MSFTNGP03.phx.gbl...
> You need to put back the model database to where it used to be. The
> reference to the model database is *inside* master.mdf. SQL Server cannot
> start without model since it cannot create tempdb, and SQL Server cannot
> live without tempdb. You probably want to do the same for msdb, and other
> user database, but those will not prohibit SQL Server from starting. You
> really should read KB 224071 first... :-)
> --
> Tibor Karaszi, SQL Server MVP
> http://www.karaszi.com/sqlserver/default.asp
> http://www.solidqualitylearning.com/
>
> "WANNABE" <breichenbach AT istate DOT com> wrote in message
> news:O%23ITWuKvGHA.4460@.TK2MSFTNGP04.phx.gbl...
>|||Can you post what you try to execute in the command prompt? Also, the switch
es to SQL Server
programs are case sensitive.
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"WANNABE" <breichenbach AT istate DOT com> wrote in message
news:e%23rPBuLvGHA.4460@.TK2MSFTNGP05.phx.gbl...
> Thanks, but I do have all dbs in both places, and it still wont start. I
try "sqlservr" and it
> returns the "Invalid command option D."
> error
> "Tibor Karaszi" <tibor_please.no.email_karaszi@.hotmail.nomail.com> wrote i
n message
> news:%23FpPvYLvGHA.428@.TK2MSFTNGP03.phx.gbl...
>|||I will be gone until next Tuesday.. I'll repost this if I still need help..
All I enter from the command line prompt is
sqlservr
"Tibor Karaszi" <tibor_please.no.email_karaszi@.hotmail.nomail.com> wrote in
message news:%23dIFp4LvGHA.324@.TK2MSFTNGP06.phx.gbl...
> Can you post what you try to execute in the command prompt? Also, the
> switches to SQL Server programs are case sensitive.
> --
> Tibor Karaszi, SQL Server MVP
> http://www.karaszi.com/sqlserver/default.asp
> http://www.solidqualitylearning.com/
>
> "WANNABE" <breichenbach AT istate DOT com> wrote in message
> news:e%23rPBuLvGHA.4460@.TK2MSFTNGP05.phx.gbl...
>|||If you only run sqlservr from command line, then the parameters are picked u
p from the registry. I
suggest you edit the registry to put in the right case, d instead of D.
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"WANNABE" <breichenbach AT istate DOT com> wrote in message
news:OspGsOMvGHA.4436@.TK2MSFTNGP05.phx.gbl...
>I will be gone until next Tuesday.. I'll repost this if I still need help.
.
> All I enter from the command line prompt is
> sqlservr
> "Tibor Karaszi" <tibor_please.no.email_karaszi@.hotmail.nomail.com> wrote i
n message
> news:%23dIFp4LvGHA.324@.TK2MSFTNGP06.phx.gbl...
>

"INSERT INTO" - Question

Hello,

if I have a row full of Data, lets call it Row "A". Now i have the "Insert Into" Command in my Application. So, when the User executes the Command again, will it update Row "A" or will it produce just a double?

This is important for my further Work with SQL.

I am using SQL Server 2006 Express or something like this. The Table in which Row "A" is has no primary key!

Greetz,

Eroli

Unless you have constraints/triggers or your INSERT violates the defaults/constraints, it will add a NEW ROW to the table irrespective of the existing data.

|||

Hi,

but when i put it all into a for-command like this one

for(int i = 0; i != 5;i++)

{

//All the Commands

}

I get only one row.

So, whats right now?

Greetz,

Eroli

|||Depends on what the commands are. Post all the relevant code and that might help.|||

System.Data.SqlClient.SqlCommand SqlCommand = new System.Data.SqlClient.SqlCommand();
System.Data.SqlClient.SqlConnection SqlConnection = new System.Data.SqlClient.SqlConnection();
SqlConnection.ConnectionString = (string)System.Configuration.ConfigurationManager.ConnectionStrings["ConnectionString"].ConnectionString;
SqlCommand.Connection = SqlConnection;
SqlCommand.CommandText = "INSERT INTO UsersTable([User], [FirstStart], [Commercial], [Name], [MailAddresse], [Addresse], [Addresse2], [Location], [PostCode], [Country], [PhoneNumber], [PhoneNumber2], [Sex], [ShowLastBoughts], [StartPage], [Notifications], [RemainingTime], [HomepageUrl], [Employees], [Owner], [Evaluations]) VALUES (@.User,@.FirstStart,@.Commercial, @.Name,@.MailAddresse,@.Addresse,@.Addresse2,@.Location,@.PostCode,@.Country,@.PhoneNumber,@.PhoneNumber2,@.Sex,@.ShowLastBoughts,@.StartPage,@.Notifications,@.RemainingTime,@.HomepageUrl,@.Employees,@.Owner,@.Evaluations)";
SqlCommand.Parameters.AddWithValue("@.User", Context.User.Identity.Name);
SqlCommand.Parameters.AddWithValue("@.FirstStart", -1);
SqlCommand.Parameters.AddWithValue("@.Commercial", -1);
SqlCommand.Parameters.AddWithValue("@.Name", "");
SqlCommand.Parameters.AddWithValue("@.MailAddresse", "");
SqlCommand.Parameters.AddWithValue("@.Addresse", "");
SqlCommand.Parameters.AddWithValue("@.Addresse2", "");
SqlCommand.Parameters.AddWithValue("@.Location", "");
SqlCommand.Parameters.AddWithValue("@.PostCode", -1);
SqlCommand.Parameters.AddWithValue("@.Country", "");
SqlCommand.Parameters.AddWithValue("@.PhoneNumber", -1);
SqlCommand.Parameters.AddWithValue("@.PhoneNumber2", -1);
SqlCommand.Parameters.AddWithValue("@.Sex", "");
SqlCommand.Parameters.AddWithValue("@.ShowLastBoughts", "");
SqlCommand.Parameters.AddWithValue("@.StartPage", -1);
SqlCommand.Parameters.AddWithValue("@.Notifications", -1);
SqlCommand.Parameters.AddWithValue("@.RemainingTime", -1);
SqlCommand.Parameters.AddWithValue("@.HomepageUrl", "");
SqlCommand.Parameters.AddWithValue("@.Employees", -1);
SqlCommand.Parameters.AddWithValue("@.Owner", "");
SqlCommand.Parameters.AddWithValue("@.Evaluations", "");
SqlConnection.Open();
SqlCommand.ExecuteNonQuery();
SqlConnection.Close();
SqlConnection.Dispose();

I've got only one Row.

|||

(1) Do you have any constraints/triggers on the table?

(2) Are you changing the values of the parameters for each loop or are youe xpecting to insert 5 rows with same values?

|||

The User Column will be everytime the same, but maybe some other colums will change.

Is the UPDATE-Command better? When yes, so how can i use this?

Im confused, because i have now more rows when i tried my application again. Seems your are right.

|||You need to explain more clearly what you are trying to do and what you intend to do. INSERT and UPDATE are 2 different commands that accomplish 2 different things. so there's no question of one "better" over another. You need to use either one depending on what how application needs to behave. Simply, INSERT inserts data into the table (meaning rows will increase), UPDATE updates te existing data (and how many rows affected depends on the WHERE condition in the query).|||

First my Application should create one row for one user. This can be done by using the INSERT Command, or not?

Then, when the user changes his data, it have to be updated. Here the UPDATE-Command should be useful, should'nt it?

|||

Eroli:

First my Application should create one row for one user. This can be done by using the INSERT Command, or not?

Yes.

Eroli:

Then, when the user changes his data, it have to be updated. Here the UPDATE-Command should be useful, should'nt it?

Yes. You need to do put your logic accordingly.

|||Ok, thanks for your advice!|||

Ok, i changed my Commands.

This is my UPDATE Command:

System.Data.SqlClient.SqlCommand SqlCommand = new System.Data.SqlClient.SqlCommand();
System.Data.SqlClient.SqlConnection SqlConnection = new System.Data.SqlClient.SqlConnection();
SqlConnection.ConnectionString = (string)System.Configuration.ConfigurationManager.ConnectionStrings["ConnectionString"].ConnectionString;
SqlCommand.Connection = SqlConnection;
SqlCommand.CommandText = "UPDATE UsersTable SET FirstStart=@.FirstStart,Commercial=@.Commercial,Name=@.Name,MailAddress=@.MailAddress,Address=@.Address,Address2=@.Address2,Location=@.Location,PostCode=@.PostCode,Country=@.Country,PhoneNumber=@.PhoneNumber,PhoneNumber2=@.PhoneNumber2,Sex=@.Sex WHERE User=@.User;";
SqlCommand.Parameters.AddWithValue("@.User", Context.User.Identity.Name);
SqlCommand.Parameters.AddWithValue("@.FirstStart", 0);
if (AccountTypeDropDownList.SelectedIndex == 0)
SqlCommand.Parameters.AddWithValue("@.Commercial", 0);
else if (AccountTypeDropDownList.SelectedIndex == 1)
SqlCommand.Parameters.AddWithValue("@.Commercial", 1);
SqlCommand.Parameters.AddWithValue("@.Name", NameTextBox.Text);
SqlCommand.Parameters.AddWithValue("@.MailAddress", EmailTextBox.Text);
SqlCommand.Parameters.AddWithValue("@.Address", AddressTextBox1.Text);
SqlCommand.Parameters.AddWithValue("@.Address2", AddressTextBox2.Text);
SqlCommand.Parameters.AddWithValue("@.Location", LocationTextBox.Text);
SqlCommand.Parameters.AddWithValue("@.PostCode", Convert.ToInt32(PostCodeTextBox.Text));
SqlCommand.Parameters.AddWithValue("@.Country", CountryTextBox.Text);
SqlCommand.Parameters.AddWithValue("@.PhoneNumber", PhoneNumberTextBox1.Text);
SqlCommand.Parameters.AddWithValue("@.PhoneNumber2", PhoneNumberTextBox2.Text);
switch (SexDropDownList.SelectedIndex)
{
case 0:
SqlCommand.Parameters.AddWithValue("@.Sex", -1);
break;

case 1:
SqlCommand.Parameters.AddWithValue("@.Sex", 0);
break;

case 2:
SqlCommand.Parameters.AddWithValue("@.Sex", 1);
break;
}
SqlConnection.Open();
SqlCommand.ExecuteNonQuery();
SqlConnection.Close();
SqlConnection.Dispose();</p><p>

It is in an ASP.NET Webapplication in C#! I get no failure, but nothing gets updated...

The obversely Row is filled with Dummy-Values before starting this Command.(MS SQL Server 2005 Express or so)

Greetz,

Eroli

|||

I hope this looks better...

System.Data.SqlClient.SqlCommand SqlCommand = new System.Data.SqlClient.SqlCommand();
System.Data.SqlClient.SqlConnection SqlConnection = new System.Data.SqlClient.SqlConnection();
SqlConnection.ConnectionString = (string)System.Configuration.ConfigurationManager.ConnectionStrings["ConnectionString"].ConnectionString;
SqlCommand.Connection = SqlConnection;
SqlCommand.CommandText = "UPDATE UsersTable SET FirstStart=@.FirstStart,Commercial=@.Commercial,Name=@.Name,MailAddress=@.MailAddress,Address=@.Address,Address2=@.Address2,Location=@.Location,PostCode=@.PostCode,Country=@.Country,PhoneNumber=@.PhoneNumber,PhoneNumber2=@.PhoneNumber2,Sex=@.Sex WHERE User=@.User;";
SqlCommand.Parameters.AddWithValue("@.User", Context.User.Identity.Name);
SqlCommand.Parameters.AddWithValue("@.FirstStart", 0);
if (AccountTypeDropDownList.SelectedIndex == 0)
SqlCommand.Parameters.AddWithValue("@.Commercial", 0);
else if (AccountTypeDropDownList.SelectedIndex == 1)
SqlCommand.Parameters.AddWithValue("@.Commercial", 1);
SqlCommand.Parameters.AddWithValue("@.Name", NameTextBox.Text);
SqlCommand.Parameters.AddWithValue("@.MailAddress", EmailTextBox.Text);
SqlCommand.Parameters.AddWithValue("@.Address", AddressTextBox1.Text);
SqlCommand.Parameters.AddWithValue("@.Address2", AddressTextBox2.Text);
SqlCommand.Parameters.AddWithValue("@.Location", LocationTextBox.Text);
SqlCommand.Parameters.AddWithValue("@.PostCode", Convert.ToInt32(PostCodeTextBox.Text));
SqlCommand.Parameters.AddWithValue("@.Country", CountryTextBox.Text);
SqlCommand.Parameters.AddWithValue("@.PhoneNumber", PhoneNumberTextBox1.Text);
SqlCommand.Parameters.AddWithValue("@.PhoneNumber2", PhoneNumberTextBox2.Text);
switch (SexDropDownList.SelectedIndex)
{
case 0:
SqlCommand.Parameters.AddWithValue("@.Sex", -1);
break;

case 1:
SqlCommand.Parameters.AddWithValue("@.Sex", 0);
break;

case 2:
SqlCommand.Parameters.AddWithValue("@.Sex", 1);
break;
}
SqlConnection.Open();
SqlCommand.ExecuteNonQuery();
SqlConnection.Close();
SqlConnection.Dispose();

|||

Ok, i solved it: I have just forgotten to put the [ ] round my Columns.

But there is another Problem: THe Condition does not work, because the User Column is no Identify-Column. How to solve this?

|||I did not understand your question. Can you rephrase?

"hashed" password on alter login command

Hi,
I need to synchronise logins between 2 SQL2005 instances on a regular basis
- while you can copy the passwords to the destination using the "HASHED"
keyword on the CREATE LOGIN command, it appears that "HASHED" is missing fro
m
the ALTER LOGIN command. This means that I can't just update the password
when a user on the source instance changes the password on their SQL
authenticated account.
I also looked at using the transfer logins task in SSIS, but then read the
following in book online:
"At the destination, the transferred logins are disabled and assigned random
passwords. A member of the sysadmin role on the destination server must
change the passwords and enable the logins before the logins can be used. "
Apart from recording the login's roles, database access, and permissions,
dropping the login, creating with the hashed password, and re-applying the
roles/database access/permissions - has anybody found a way to just apply a
new hashed password to the login?
AndyHello Andy,
Thank you for posting in MSDN newsgroup!
I understand that you'd like to transfer logins and passwords between SQL
2005 instances. You just want to apply a new hashed password to the logins.
If I'm off-base, please let me know.
I think there is no simple method to apply a new hased password as you
want. You need to drop/recreate the logins by using script and grant it the
proper permission. You have to know the original password so that you could
change it to the new password by using "Alter login" statement.
You may want to refer to the following articles for more details:
How to transfer the logins and the passwords between instances of SQL
Server 2005
http://support.microsoft.com/kb/918992/
HOW TO: Transfer Logins and Passwords Between Instances of SQL Server
(246133)
http://support.microsoft.com/defaul...KB;EN-US;246133
Your feedback on this feature is routed to the proper channel. In the
meantime, I also encourage you submit via the link below
http://lab.msdn.microsoft.com/produ...ck/default.aspx
If anything is unclear or you have further questions on the issue, please
feel free to let's know.
Best Regards,
Peter Yang
MCSE2000/2003, MCSA, MCDBA
Microsoft Online Partner Support
========================================
=============
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscript...ault.aspx#notif
ications
<http://msdn.microsoft.com/subscript...ps/default.aspx>.
Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
<http://msdn.microsoft.com/subscript...rt/default.aspx>.
========================================
==========
This posting is provided "AS IS" with no warranties, and confers no rights.

Thursday, February 16, 2012

"GO" used in a stored procedure

I have a stored procedure in sql 2000 that requires steps to be fully
completed before moving to the next command in the procedure. I have
tried to place the word "GO" after each statement. When I create the
procedure then take a look at it through em, it only shows the code up
until the word "GO".

Example:
CREATE PROCEDURE mytest
as
create table mytable col1 varchar(5), col2 varchar(10)
GO
insert into mytable (col1, col2) values(abc, def)

All i see is:
CREATE PROCEDURE mytest
as
create table mytable col1 varchar(5), col2 varchar(10)
GO

I need to be 100% certain that the table has already been created
before trying to add records to it.

Is there any command that makes t-sql halt until the previous command
has finished?

Thanks,
DaveGO isn't a TSQL command. It marks the end of a batch in Query Analyzer and
therefore signals the end of a stored procedure definition in that batch, so
it cannot be part of an SP.

--
David Portas
SQL Server MVP
--|||Dave wrote:

> I have a stored procedure in sql 2000 that requires steps to be fully
> completed before moving to the next command in the procedure. I have
> tried to place the word "GO" after each statement. When I create the
> procedure then take a look at it through em, it only shows the code up
> until the word "GO".
> Example:
> CREATE PROCEDURE mytest
> as
> create table mytable col1 varchar(5), col2 varchar(10)
> GO
> insert into mytable (col1, col2) values(abc, def)
> All i see is:
> CREATE PROCEDURE mytest
> as
> create table mytable col1 varchar(5), col2 varchar(10)
> GO
>
> I need to be 100% certain that the table has already been created
> before trying to add records to it.
> Is there any command that makes t-sql halt until the previous command
> has finished?
> Thanks,
> Dave

You can be assured that the table will be created before the insert
statement is executed. Each command will be 100% finished and committed
before moving on to the next statement (unless you using transactions).

Zach|||
David,

Thanks for responding so quickly. I did read in several places that the
GO command does exactly what you have stated.

However, I still need to find a way to make sure that my code is
finished executing before moving to the next step within my stored
procedure.

The example I posted earlier was really dummied down from what I really
need to do. We have some procs here that are over 600 lines of code, and
most of them depend on the previous chunk of code to have completed
before they execute.

Any other ideas would be greatly appreciated.
Thanks,
Dave

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!|||Dave F wrote:

> David,
> Thanks for responding so quickly. I did read in several places that the
> GO command does exactly what you have stated.
> However, I still need to find a way to make sure that my code is
> finished executing before moving to the next step within my stored
> procedure.
> The example I posted earlier was really dummied down from what I really
> need to do. We have some procs here that are over 600 lines of code, and
> most of them depend on the previous chunk of code to have completed
> before they execute.
> Any other ideas would be greatly appreciated.
> Thanks,
> Dave
> *** Sent via Developersdex http://www.developersdex.com ***
> Don't just participate in USENET...get rewarded for it!

Like I said, SQL will ALWAYS complete a command before moving on to the
next one. What makes you think this doesn't already happen?

Zach|||[posted and mailed, please reply in news]

Dave (funkdm1@.yahoo.com) writes:
> Is there any command that makes t-sql halt until the previous command
> has finished?

To echo what Zach said: there is no command that causes T-SQL to continue
with the next command, before the previous has completed. So you
have no reason to worry.

--
Erland Sommarskog, SQL Server MVP, sommar@.algonet.se

Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techin.../2000/books.asp|||This is a catch 22 situation.

Do you really need to create a new table each time you execute the stored proc?
If so, use temporary tables.

Otherwise empty your existing table before you insert rows.

Friday, January 27, 2012

rebuild master

hi,
is there a way to rebuild the master database in sql server 2005 without
installing SQL Server again. I try from the command line, but it sends me to
add/remove program, and from here there are is no option to do that.
in advance i'll appreciatte all your help.
Edmundo J. Davila
Tibor,
That instruction send me to the add/remove programs, and as i said, there is
not option to rebuild master database from there.
Edmundo J. Davila
"Tibor Karaszi" <tibor_please.no.email_karaszi@.hotmail.nomail.com> escribi
en el mensaje de noticias
news:3DE016B4-97A4-4B50-B7F9-71DF21C8AAE5@.microsoft.com...
> You find instructions for how to rebuild in Books Online:
> ms-help://MS.SQLCC.v9/MS.SQLSVR.v9.en/instsql9/html/df40c888-691c-4962-a420-78a57852364d.htm
> More specifically:
> start /wait <CD or DVD Drive>\setup.exe /qn INSTANCENAME=<InstanceName>
> REINSTALL=SQL_Engine REBUILDDATABASE=1 SAPWD=<NewStrongPassword>
> Above it from the BOL topic...
> --
> Tibor Karaszi, SQL Server MVP
> http://www.karaszi.com/sqlserver/default.asp
> http://sqlblog.com/blogs/tibor_karaszi
>
> "Edmundo J. Davila" <edavila@.monisa.com> wrote in message
> news:10627F4D-46CA-4AD0-98E6-7958CA88A26D@.microsoft.com...
>
|||Are you running SQL Server Express? If so, why not just detach your user
databases, uninstall / reinstall, then re-attach your user databases?
"Edmundo J. Davila" <edavila@.monisa.com> wrote in message
news:10627F4D-46CA-4AD0-98E6-7958CA88A26D@.microsoft.com...
> hi,
> is there a way to rebuild the master database in sql server 2005 without
> installing SQL Server again. I try from the command line, but it sends me
> to add/remove program, and from here there are is no option to do that.
> in advance i'll appreciatte all your help.
> Edmundo J. Davila
|||How about this link?
How to: Install SQL Server 2005 from the Command Prompt:
http://msdn2.microsoft.com/en-us/library/ms144259.aspx
Ekrem nsoy
"Edmundo J. Davila" <edavila@.monisa.com> wrote in message
news:07571BB5-F191-4A27-BE90-D7C5CFFAD132@.microsoft.com...
> Tibor,
> That instruction send me to the add/remove programs, and as i said, there
> is not option to rebuild master database from there.
> Edmundo J. Davila
> "Tibor Karaszi" <tibor_please.no.email_karaszi@.hotmail.nomail.com>
> escribi en el mensaje de noticias
> news:3DE016B4-97A4-4B50-B7F9-71DF21C8AAE5@.microsoft.com...
>
|||Yes Tibor I know, I just thought this link could direct him to the mentioned
web site as the link you gave didn't work for him as far as I see.
Ekrem nsoy
"Tibor Karaszi" <tibor_please.no.email_karaszi@.hotmail.nomail.com> wrote in
message news:%23fm8pD3JIHA.2064@.TK2MSFTNGP06.phx.gbl...
> That is the same article as I posted, but I posted a local BOL URL...
> --
> Tibor Karaszi, SQL Server MVP
> http://www.karaszi.com/sqlserver/default.asp
> http://sqlblog.com/blogs/tibor_karaszi
>
> "Ekrem nsoy" <ekrem@.btegitim.com> wrote in message
> news:6F10DBDF-C18B-4C7F-9CC7-AC63878907D1@.microsoft.com...
>

rebuild master

hi,
is there a way to rebuild the master database in sql server 2005 without
installing SQL Server again. I try from the command line, but it sends me to
add/remove program, and from here there are is no option to do that.
in advance i'll appreciatte all your help.
Edmundo J. DavilaYou find instructions for how to rebuild in Books Online:
ms-help://MS.SQLCC.v9/MS.SQLSVR.v9.en/instsql9/html/df40c888-691c-4962-a420-78a57852364d.htm
More specifically:
start /wait <CD or DVD Drive>\setup.exe /qn INSTANCENAME=<InstanceName> REINSTALL=SQL_Engine
REBUILDDATABASE=1 SAPWD=<NewStrongPassword>
Above it from the BOL topic...
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://sqlblog.com/blogs/tibor_karaszi
"Edmundo J. Davila" <edavila@.monisa.com> wrote in message
news:10627F4D-46CA-4AD0-98E6-7958CA88A26D@.microsoft.com...
> hi,
> is there a way to rebuild the master database in sql server 2005 without installing SQL Server
> again. I try from the command line, but it sends me to add/remove program, and from here there are
> is no option to do that.
> in advance i'll appreciatte all your help.
> Edmundo J. Davila|||Tibor,
That instruction send me to the add/remove programs, and as i said, there is
not option to rebuild master database from there.
Edmundo J. Davila
"Tibor Karaszi" <tibor_please.no.email_karaszi@.hotmail.nomail.com> escribió
en el mensaje de noticias
news:3DE016B4-97A4-4B50-B7F9-71DF21C8AAE5@.microsoft.com...
> You find instructions for how to rebuild in Books Online:
> ms-help://MS.SQLCC.v9/MS.SQLSVR.v9.en/instsql9/html/df40c888-691c-4962-a420-78a57852364d.htm
> More specifically:
> start /wait <CD or DVD Drive>\setup.exe /qn INSTANCENAME=<InstanceName>
> REINSTALL=SQL_Engine REBUILDDATABASE=1 SAPWD=<NewStrongPassword>
> Above it from the BOL topic...
> --
> Tibor Karaszi, SQL Server MVP
> http://www.karaszi.com/sqlserver/default.asp
> http://sqlblog.com/blogs/tibor_karaszi
>
> "Edmundo J. Davila" <edavila@.monisa.com> wrote in message
> news:10627F4D-46CA-4AD0-98E6-7958CA88A26D@.microsoft.com...
>> hi,
>> is there a way to rebuild the master database in sql server 2005 without
>> installing SQL Server again. I try from the command line, but it sends me
>> to add/remove program, and from here there are is no option to do that.
>> in advance i'll appreciatte all your help.
>> Edmundo J. Davila
>|||Are you running SQL Server Express? If so, why not just detach your user
databases, uninstall / reinstall, then re-attach your user databases?
"Edmundo J. Davila" <edavila@.monisa.com> wrote in message
news:10627F4D-46CA-4AD0-98E6-7958CA88A26D@.microsoft.com...
> hi,
> is there a way to rebuild the master database in sql server 2005 without
> installing SQL Server again. I try from the command line, but it sends me
> to add/remove program, and from here there are is no option to do that.
> in advance i'll appreciatte all your help.
> Edmundo J. Davila|||Strange. I just tried the URL and it took me to the below topic:
How to: Install SQL Server 2005 from the Command Prompt
In there (towards the end) there's a sample on how to rebuild. Or are you saying that the START
command that I pasted (after adjustment) took you to add/Remove programs?
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://sqlblog.com/blogs/tibor_karaszi
"Edmundo J. Davila" <edavila@.monisa.com> wrote in message
news:07571BB5-F191-4A27-BE90-D7C5CFFAD132@.microsoft.com...
> Tibor,
> That instruction send me to the add/remove programs, and as i said, there is not option to rebuild
> master database from there.
> Edmundo J. Davila
> "Tibor Karaszi" <tibor_please.no.email_karaszi@.hotmail.nomail.com> escribió en el mensaje de
> noticias news:3DE016B4-97A4-4B50-B7F9-71DF21C8AAE5@.microsoft.com...
>> You find instructions for how to rebuild in Books Online:
>> ms-help://MS.SQLCC.v9/MS.SQLSVR.v9.en/instsql9/html/df40c888-691c-4962-a420-78a57852364d.htm
>> More specifically:
>> start /wait <CD or DVD Drive>\setup.exe /qn INSTANCENAME=<InstanceName> REINSTALL=SQL_Engine
>> REBUILDDATABASE=1 SAPWD=<NewStrongPassword>
>> Above it from the BOL topic...
>> --
>> Tibor Karaszi, SQL Server MVP
>> http://www.karaszi.com/sqlserver/default.asp
>> http://sqlblog.com/blogs/tibor_karaszi
>>
>> "Edmundo J. Davila" <edavila@.monisa.com> wrote in message
>> news:10627F4D-46CA-4AD0-98E6-7958CA88A26D@.microsoft.com...
>> hi,
>> is there a way to rebuild the master database in sql server 2005 without installing SQL Server
>> again. I try from the command line, but it sends me to add/remove program, and from here there
>> are is no option to do that.
>> in advance i'll appreciatte all your help.
>> Edmundo J. Davila
>|||How about this link?
How to: Install SQL Server 2005 from the Command Prompt:
http://msdn2.microsoft.com/en-us/library/ms144259.aspx
--
Ekrem Önsoy
"Edmundo J. Davila" <edavila@.monisa.com> wrote in message
news:07571BB5-F191-4A27-BE90-D7C5CFFAD132@.microsoft.com...
> Tibor,
> That instruction send me to the add/remove programs, and as i said, there
> is not option to rebuild master database from there.
> Edmundo J. Davila
> "Tibor Karaszi" <tibor_please.no.email_karaszi@.hotmail.nomail.com>
> escribió en el mensaje de noticias
> news:3DE016B4-97A4-4B50-B7F9-71DF21C8AAE5@.microsoft.com...
>> You find instructions for how to rebuild in Books Online:
>> ms-help://MS.SQLCC.v9/MS.SQLSVR.v9.en/instsql9/html/df40c888-691c-4962-a420-78a57852364d.htm
>> More specifically:
>> start /wait <CD or DVD Drive>\setup.exe /qn INSTANCENAME=<InstanceName>
>> REINSTALL=SQL_Engine REBUILDDATABASE=1 SAPWD=<NewStrongPassword>
>> Above it from the BOL topic...
>> --
>> Tibor Karaszi, SQL Server MVP
>> http://www.karaszi.com/sqlserver/default.asp
>> http://sqlblog.com/blogs/tibor_karaszi
>>
>> "Edmundo J. Davila" <edavila@.monisa.com> wrote in message
>> news:10627F4D-46CA-4AD0-98E6-7958CA88A26D@.microsoft.com...
>> hi,
>> is there a way to rebuild the master database in sql server 2005 without
>> installing SQL Server again. I try from the command line, but it sends
>> me to add/remove program, and from here there are is no option to do
>> that.
>> in advance i'll appreciatte all your help.
>> Edmundo J. Davila
>|||That is the same article as I posted, but I posted a local BOL URL...
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://sqlblog.com/blogs/tibor_karaszi
"Ekrem Önsoy" <ekrem@.btegitim.com> wrote in message
news:6F10DBDF-C18B-4C7F-9CC7-AC63878907D1@.microsoft.com...
> How about this link?
> How to: Install SQL Server 2005 from the Command Prompt:
> http://msdn2.microsoft.com/en-us/library/ms144259.aspx
> --
> Ekrem Önsoy
>
> "Edmundo J. Davila" <edavila@.monisa.com> wrote in message
> news:07571BB5-F191-4A27-BE90-D7C5CFFAD132@.microsoft.com...
>> Tibor,
>> That instruction send me to the add/remove programs, and as i said, there is not option to
>> rebuild master database from there.
>> Edmundo J. Davila
>> "Tibor Karaszi" <tibor_please.no.email_karaszi@.hotmail.nomail.com> escribió en el mensaje de
>> noticias news:3DE016B4-97A4-4B50-B7F9-71DF21C8AAE5@.microsoft.com...
>> You find instructions for how to rebuild in Books Online:
>> ms-help://MS.SQLCC.v9/MS.SQLSVR.v9.en/instsql9/html/df40c888-691c-4962-a420-78a57852364d.htm
>> More specifically:
>> start /wait <CD or DVD Drive>\setup.exe /qn INSTANCENAME=<InstanceName> REINSTALL=SQL_Engine
>> REBUILDDATABASE=1 SAPWD=<NewStrongPassword>
>> Above it from the BOL topic...
>> --
>> Tibor Karaszi, SQL Server MVP
>> http://www.karaszi.com/sqlserver/default.asp
>> http://sqlblog.com/blogs/tibor_karaszi
>>
>> "Edmundo J. Davila" <edavila@.monisa.com> wrote in message
>> news:10627F4D-46CA-4AD0-98E6-7958CA88A26D@.microsoft.com...
>> hi,
>> is there a way to rebuild the master database in sql server 2005 without installing SQL Server
>> again. I try from the command line, but it sends me to add/remove program, and from here there
>> are is no option to do that.
>> in advance i'll appreciatte all your help.
>> Edmundo J. Davila
>>
>|||Yes Tibor I know, I just thought this link could direct him to the mentioned
web site as the link you gave didn't work for him as far as I see.
--
Ekrem Önsoy
"Tibor Karaszi" <tibor_please.no.email_karaszi@.hotmail.nomail.com> wrote in
message news:%23fm8pD3JIHA.2064@.TK2MSFTNGP06.phx.gbl...
> That is the same article as I posted, but I posted a local BOL URL...
> --
> Tibor Karaszi, SQL Server MVP
> http://www.karaszi.com/sqlserver/default.asp
> http://sqlblog.com/blogs/tibor_karaszi
>
> "Ekrem Önsoy" <ekrem@.btegitim.com> wrote in message
> news:6F10DBDF-C18B-4C7F-9CC7-AC63878907D1@.microsoft.com...
>> How about this link?
>> How to: Install SQL Server 2005 from the Command Prompt:
>> http://msdn2.microsoft.com/en-us/library/ms144259.aspx
>> --
>> Ekrem Önsoy
>>
>> "Edmundo J. Davila" <edavila@.monisa.com> wrote in message
>> news:07571BB5-F191-4A27-BE90-D7C5CFFAD132@.microsoft.com...
>> Tibor,
>> That instruction send me to the add/remove programs, and as i said,
>> there is not option to rebuild master database from there.
>> Edmundo J. Davila
>> "Tibor Karaszi" <tibor_please.no.email_karaszi@.hotmail.nomail.com>
>> escribió en el mensaje de noticias
>> news:3DE016B4-97A4-4B50-B7F9-71DF21C8AAE5@.microsoft.com...
>> You find instructions for how to rebuild in Books Online:
>> ms-help://MS.SQLCC.v9/MS.SQLSVR.v9.en/instsql9/html/df40c888-691c-4962-a420-78a57852364d.htm
>> More specifically:
>> start /wait <CD or DVD Drive>\setup.exe /qn INSTANCENAME=<InstanceName>
>> REINSTALL=SQL_Engine REBUILDDATABASE=1 SAPWD=<NewStrongPassword>
>> Above it from the BOL topic...
>> --
>> Tibor Karaszi, SQL Server MVP
>> http://www.karaszi.com/sqlserver/default.asp
>> http://sqlblog.com/blogs/tibor_karaszi
>>
>> "Edmundo J. Davila" <edavila@.monisa.com> wrote in message
>> news:10627F4D-46CA-4AD0-98E6-7958CA88A26D@.microsoft.com...
>> hi,
>> is there a way to rebuild the master database in sql server 2005
>> without installing SQL Server again. I try from the command line, but
>> it sends me to add/remove program, and from here there are is no
>> option to do that.
>> in advance i'll appreciatte all your help.
>> Edmundo J. Davila
>>
>|||OK, got it. :-)
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://sqlblog.com/blogs/tibor_karaszi
"Ekrem Önsoy" <ekrem@.btegitim.com> wrote in message
news:5667FAAD-2499-41BF-AF08-6370F9453042@.microsoft.com...
> Yes Tibor I know, I just thought this link could direct him to the mentioned web site as the link
> you gave didn't work for him as far as I see.
> --
> Ekrem Önsoy
>
> "Tibor Karaszi" <tibor_please.no.email_karaszi@.hotmail.nomail.com> wrote in message
> news:%23fm8pD3JIHA.2064@.TK2MSFTNGP06.phx.gbl...
>> That is the same article as I posted, but I posted a local BOL URL...
>> --
>> Tibor Karaszi, SQL Server MVP
>> http://www.karaszi.com/sqlserver/default.asp
>> http://sqlblog.com/blogs/tibor_karaszi
>>
>> "Ekrem Önsoy" <ekrem@.btegitim.com> wrote in message
>> news:6F10DBDF-C18B-4C7F-9CC7-AC63878907D1@.microsoft.com...
>> How about this link?
>> How to: Install SQL Server 2005 from the Command Prompt:
>> http://msdn2.microsoft.com/en-us/library/ms144259.aspx
>> --
>> Ekrem Önsoy
>>
>> "Edmundo J. Davila" <edavila@.monisa.com> wrote in message
>> news:07571BB5-F191-4A27-BE90-D7C5CFFAD132@.microsoft.com...
>> Tibor,
>> That instruction send me to the add/remove programs, and as i said, there is not option to
>> rebuild master database from there.
>> Edmundo J. Davila
>> "Tibor Karaszi" <tibor_please.no.email_karaszi@.hotmail.nomail.com> escribió en el mensaje de
>> noticias news:3DE016B4-97A4-4B50-B7F9-71DF21C8AAE5@.microsoft.com...
>> You find instructions for how to rebuild in Books Online:
>> ms-help://MS.SQLCC.v9/MS.SQLSVR.v9.en/instsql9/html/df40c888-691c-4962-a420-78a57852364d.htm
>> More specifically:
>> start /wait <CD or DVD Drive>\setup.exe /qn INSTANCENAME=<InstanceName> REINSTALL=SQL_Engine
>> REBUILDDATABASE=1 SAPWD=<NewStrongPassword>
>> Above it from the BOL topic...
>> --
>> Tibor Karaszi, SQL Server MVP
>> http://www.karaszi.com/sqlserver/default.asp
>> http://sqlblog.com/blogs/tibor_karaszi
>>
>> "Edmundo J. Davila" <edavila@.monisa.com> wrote in message
>> news:10627F4D-46CA-4AD0-98E6-7958CA88A26D@.microsoft.com...
>> hi,
>> is there a way to rebuild the master database in sql server 2005 without installing SQL
>> Server again. I try from the command line, but it sends me to add/remove program, and from
>> here there are is no option to do that.
>> in advance i'll appreciatte all your help.
>> Edmundo J. Davila
>>
>>
>|||Unfortunatelly I had to remove and reinstall the instance from add/remove
programs from the control panel. It was impossible to do it with your
recommendations.
I appreciatte your help.
Regards,
Edmundo J. Davila
"Tibor Karaszi" <tibor_please.no.email_karaszi@.hotmail.nomail.com> escribió
en el mensaje de noticias news:eOZc3a3JIHA.2480@.TK2MSFTNGP05.phx.gbl...
> OK, got it. :-)
> --
> Tibor Karaszi, SQL Server MVP
> http://www.karaszi.com/sqlserver/default.asp
> http://sqlblog.com/blogs/tibor_karaszi
>
> "Ekrem Önsoy" <ekrem@.btegitim.com> wrote in message
> news:5667FAAD-2499-41BF-AF08-6370F9453042@.microsoft.com...
>> Yes Tibor I know, I just thought this link could direct him to the
>> mentioned web site as the link you gave didn't work for him as far as I
>> see.
>> --
>> Ekrem Önsoy
>>
>> "Tibor Karaszi" <tibor_please.no.email_karaszi@.hotmail.nomail.com> wrote
>> in message news:%23fm8pD3JIHA.2064@.TK2MSFTNGP06.phx.gbl...
>> That is the same article as I posted, but I posted a local BOL URL...
>> --
>> Tibor Karaszi, SQL Server MVP
>> http://www.karaszi.com/sqlserver/default.asp
>> http://sqlblog.com/blogs/tibor_karaszi
>>
>> "Ekrem Önsoy" <ekrem@.btegitim.com> wrote in message
>> news:6F10DBDF-C18B-4C7F-9CC7-AC63878907D1@.microsoft.com...
>> How about this link?
>> How to: Install SQL Server 2005 from the Command Prompt:
>> http://msdn2.microsoft.com/en-us/library/ms144259.aspx
>> --
>> Ekrem Önsoy
>>
>> "Edmundo J. Davila" <edavila@.monisa.com> wrote in message
>> news:07571BB5-F191-4A27-BE90-D7C5CFFAD132@.microsoft.com...
>> Tibor,
>> That instruction send me to the add/remove programs, and as i said,
>> there is not option to rebuild master database from there.
>> Edmundo J. Davila
>> "Tibor Karaszi" <tibor_please.no.email_karaszi@.hotmail.nomail.com>
>> escribió en el mensaje de noticias
>> news:3DE016B4-97A4-4B50-B7F9-71DF21C8AAE5@.microsoft.com...
>> You find instructions for how to rebuild in Books Online:
>> ms-help://MS.SQLCC.v9/MS.SQLSVR.v9.en/instsql9/html/df40c888-691c-4962-a420-78a57852364d.htm
>> More specifically:
>> start /wait <CD or DVD Drive>\setup.exe /qn
>> INSTANCENAME=<InstanceName> REINSTALL=SQL_Engine REBUILDDATABASE=1
>> SAPWD=<NewStrongPassword>
>> Above it from the BOL topic...
>> --
>> Tibor Karaszi, SQL Server MVP
>> http://www.karaszi.com/sqlserver/default.asp
>> http://sqlblog.com/blogs/tibor_karaszi
>>
>> "Edmundo J. Davila" <edavila@.monisa.com> wrote in message
>> news:10627F4D-46CA-4AD0-98E6-7958CA88A26D@.microsoft.com...
>>> hi,
>>> is there a way to rebuild the master database in sql server 2005
>>> without installing SQL Server again. I try from the command line,
>>> but it sends me to add/remove program, and from here there are is no
>>> option to do that.
>>>
>>> in advance i'll appreciatte all your help.
>>>
>>> Edmundo J. Davila
>>
>>
>>
>