Sunday, March 25, 2012
Delete a user. Please help
I hve been tring to delete a Login User form SQL 2000 and cant do it
I go to Security, Logins, find the user, right click and delete.
I then get a option that says "Removing this login will remove all
associated database users (if any)".
I say yes to that and then...
Error 15174: Login 'XXXXXXX' is aliased or mapped to a user in one or
more databases- Drop the user or alisas before dropping the login.
Database name :DB1, DB2, DB, etc.
How can I get past this!
Thanks.
George.
Do what the error message say: Remove the users or aliases from the database as listed in the error
message.
If these are users, use sp_dropuser for if it is a SQL Server Login or sp_revokedbaccess if it is a
Windows Login.
If these are aliases (which i think it is, as EM doesn't remove them for you), use sp_dropalias.
The stored procedures I mentioned above are documented in Books Online.
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"George D. Lake" <NoSpam@.bla.com> wrote in message news:eJuY4$JJFHA.3340@.TK2MSFTNGP14.phx.gbl...
> Hi,
> I hve been tring to delete a Login User form SQL 2000 and cant do it
> I go to Security, Logins, find the user, right click and delete.
> I then get a option that says "Removing this login will remove all associated database users
> (if any)".
> I say yes to that and then...
> Error 15174: Login 'XXXXXXX' is aliased or mapped to a user in one or more databases- Drop the
> user or alisas before dropping the login.
> Database name :DB1, DB2, DB, etc.
>
> How can I get past this!
>
> Thanks.
> George.
>
Delete a user. Please help
I hve been tring to delete a Login User form SQL 2000 and cant do it
I go to Security, Logins, find the user, right click and delete.
I then get a option that says "Removing this login will remove all
associated database users (if any)".
I say yes to that and then...
Error 15174: Login 'XXXXXXX' is aliased or mapped to a user in one or
more databases- Drop the user or alisas before dropping the login.
Database name :DB1, DB2, DB·, etc.
How can I get past this!
Thanks.
George.Do what the error message say: Remove the users or aliases from the database as listed in the error
message.
If these are users, use sp_dropuser for if it is a SQL Server Login or sp_revokedbaccess if it is a
Windows Login.
If these are aliases (which i think it is, as EM doesn't remove them for you), use sp_dropalias.
The stored procedures I mentioned above are documented in Books Online.
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"George D. Lake" <NoSpam@.bla.com> wrote in message news:eJuY4$JJFHA.3340@.TK2MSFTNGP14.phx.gbl...
> Hi,
> I hve been tring to delete a Login User form SQL 2000 and cant do it
> I go to Security, Logins, find the user, right click and delete.
> I then get a option that says "Removing this login will remove all associated database users
> (if any)".
> I say yes to that and then...
> Error 15174: Login 'XXXXXXX' is aliased or mapped to a user in one or more databases- Drop the
> user or alisas before dropping the login.
> Database name :DB1, DB2, DB·, etc.
>
> How can I get past this!
>
> Thanks.
> George.
>sql
Delete a user. Please help
I hve been tring to delete a Login User form SQL 2000 and cant do it
I go to Security, Logins, find the user, right click and delete.
I then get a option that says "Removing this login will remove all
associated database users (if any)".
I say yes to that and then...
Error 15174: Login 'XXXXXXX' is aliased or mapped to a user in one or
more databases- Drop the user or alisas before dropping the login.
Database name :DB1, DB2, DB, etc.
How can I get past this!
Thanks.
George.Do what the error message say: Remove the users or aliases from the database
as listed in the error
message.
If these are users, use sp_dropuser for if it is a SQL Server Login or sp_re
vokedbaccess if it is a
Windows Login.
If these are aliases (which i think it is, as EM doesn't remove them for you
), use sp_dropalias.
The stored procedures I mentioned above are documented in Books Online.
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"George D. Lake" <NoSpam@.bla.com> wrote in message news:eJuY4$JJFHA.3340@.TK2MSFTNGP14.phx.gb
l...
> Hi,
> I hve been tring to delete a Login User form SQL 2000 and cant do it
> I go to Security, Logins, find the user, right click and delete.
> I then get a option that says "Removing this login will remove all asso
ciated database users
> (if any)".
> I say yes to that and then...
> Error 15174: Login 'XXXXXXX' is aliased or mapped to a user in one or m
ore databases- Drop the
> user or alisas before dropping the login.
> Database name :DB1, DB2, DB, etc.
>
> How can I get past this!
>
> Thanks.
> George.
>
Delete a row and all other rows thats linked to it
i want to delete a row in my database but the problem is, i cant delete it as other table rows is linked to it. I have to delete all the rows thats linked to the row i wanna delete first.
Is there a easier way to delete the row and all the rows thats linked to it? i wanna code it to do it.
an suggestions?That's what cascading deletes are for, but that's in the database design. Do searches on Declaritive Referential Integrity or DRI.sql
Monday, March 19, 2012
Defualt number of copies
Hi all - must be a simple one but can't find where to set this - I need to set the number of copies to a default of '3' for my despatch team.
Could anyone point me in the right direction?
Thanks in advaice!
Stephen.
Hi - can anyone help with this? The despatch team are going crazy :( I can't find info on this anywhere!
Thanks!
||| It is not possible to change the Number of copies in the reporting services client print control
Maybe you can avoid printing by making each of the team members subscribers to the report? They can receive an email with up-to-the minute data at the time of their chosing, and if desired, can print the report then.
|||Unfortunately I can't do that - the despatch team pick and then despatch an order - many times a day so need to do it on an ad-hoc basis. Really disapointed that the reporting add-in doesn't have this feature. Would have thought that this would have been a standard option :(
Any posibility of Crystal doing this does anyone know?
Thanks!
Sunday, March 11, 2012
Defrag Indexes
Is there a command in SQL 2000 to Defrag all Indexes?
Thanks
Yes! - Look at the DBCC INDEXDEFRAG command in BOL.
Immy
"M Swancott" <swancott@.metrocast.net> wrote in message
news:OSP6VeHtFHA.2912@.TK2MSFTNGP09.phx.gbl...
> Sorry for the newbie question but can't seem to find a clear anwser...
> Is there a command in SQL 2000 to Defrag all Indexes?
> Thanks
>
|||You probably don't need to defrag all your indexes. Read the MS whitepaper
below for more details about fragmentation and when/how to remove it.
http://www.microsoft.com/technet/pro.../ss2kidbp.mspx
Thanks
Paul Randal
Dev Lead, Microsoft SQL Server Storage Engine
This posting is provided "AS IS" with no warranties, and confers no rights.
"Imtiaz Ullah" <imtiaz_ullah@.hotmail.com> wrote in message
news:uf5Z7gHtFHA.3604@.tk2msftngp13.phx.gbl...
> Yes! - Look at the DBCC INDEXDEFRAG command in BOL.
> Immy
> "M Swancott" <swancott@.metrocast.net> wrote in message
> news:OSP6VeHtFHA.2912@.TK2MSFTNGP09.phx.gbl...
>
Saturday, February 25, 2012
defaults
defaults in sql server 2000? I cant figure it outSee following exmaple:
(while creating table)
CREATE TABLE multinulls (
a int NULL,
b char(5) default 'hello'
)
you can also create default as an object and bind it to table's column
Ex:
CREATE DEFAULT abc_const AS 'abc'
GO
sp_bindefault abc_const, 'test_defaults.char1'
GO
-Vishal
"bill" <bkelleman@.pcdata1.com> wrote in message
news:02a901c377be$aada4a30$a101280a@.phx.gbl...
> Can someone give me a simple example of how you use the
> defaults in sql server 2000? I cant figure it out|||What exactly do you mean? How to insert default values or How to set it up?
Setup.
For example Open EM, Create a table two columns
Column 1 name it Log_Date datetime with a default of getdate()
Column 2 name it test_data varchar(20)
Open the table and insert something on the test_data column click on the
exclamation point to execute
or simply use query analyzer
BEGIN TRANSACTION
CREATE TABLE dbo.test0001
(
log_date datetime NULL,
test_data varchar(20) NULL
) ON [PRIMARY]
GO
ALTER TABLE dbo.TEST001 ADD CONSTRAINT
DF_Table1_log_date DEFAULT getdate() FOR log_date
GO
COMMIT
INSERT INTO TEST0001(TEST_DATA)
SELECT 'TEST1'
SELECT * FROM TEST0001
If you create a new default on a column to an existing table with data then
you need to do something like
insert into test0001 default values
select * from test0001
Hope this helps
Yovan Fernandez
"bill" <bkelleman@.pcdata1.com> wrote in message
news:02a901c377be$aada4a30$a101280a@.phx.gbl...
> Can someone give me a simple example of how you use the
> defaults in sql server 2000? I cant figure it out
Friday, February 24, 2012
Default Value Prorperty
it anywhere, so I am hoping someone out here can assist.
Is there any way to programmatically change the Default
Value Property value ?
I have several tables with a default value of 1 setup, and
I would like to change them all to a different value.
Possible ?
Thanks in advance for your assistance !
Michael.
Hi,
You have to drop the default constraint and add the new default constraint.
See the below steps with code.
See SP_HELP <table_name> to get the constarint name
Create a table with default constraint
create table x_df(i int, j int default (100))
After that drop the constraint.
alter table x_df drop constraint <constraint_name>
Add the constraint
ALTER TABLE x_df ADD CONSTRAINT defaul1_cons DEFAULT (200) for j
Thanks
Hari
MCDBA
"Michael" <MYKLIV@.hotmail.com> wrote in message
news:479201c48007$985043e0$a501280a@.phx.gbl...
> I have a question, and I can't seem to find a reference to
> it anywhere, so I am hoping someone out here can assist.
> Is there any way to programmatically change the Default
> Value Property value ?
> I have several tables with a default value of 1 setup, and
> I would like to change them all to a different value.
> Possible ?
> Thanks in advance for your assistance !
> Michael.
|||Thanks, worked like a charm !
>--Original Message--
>Hi,
>You have to drop the default constraint and add the new
default constraint.
>See the below steps with code.
>See SP_HELP <table_name> to get the constarint name
>Create a table with default constraint
>create table x_df(i int, j int default (100))
>After that drop the constraint.
>alter table x_df drop constraint <constraint_name>
>Add the constraint
>ALTER TABLE x_df ADD CONSTRAINT defaul1_cons DEFAULT
(200) for j[vbcol=seagreen]
>Thanks
>Hari
>MCDBA
>
>
>"Michael" <MYKLIV@.hotmail.com> wrote in message
>news:479201c48007$985043e0$a501280a@.phx.gbl...
to[vbcol=seagreen]
and
>
>.
>
|||Ok, that does work fine, but now I would like to scroll
through several tables. I cant seem to get the Alter
Table<table_name> to respond to a declared variable.
This is what I am using to test it...
************************************************** ********
Declare @.TableName varchar(30), @.ConstName varchar(30)
set @.TableName = 'tblS01Test'
set @.ConstName = 'DF_' + @.TableName + '_ExerciseID'
Print @.TableName
Print @.ConstName
Alter Table @.TableName add constraint @.ConstName default
(1) for ExerciseID
************************************************** ******
Ultimately I am trying to use this to alter several tables
ExerciseID ('s), and figure that I can use a cursor to do
so.
Thanks for any and all advice !!
Michael.
>--Original Message--
>Hi,
>You have to drop the default constraint and add the new
default constraint.
>See the below steps with code.
>See SP_HELP <table_name> to get the constarint name
>Create a table with default constraint
>create table x_df(i int, j int default (100))
>After that drop the constraint.
>alter table x_df drop constraint <constraint_name>
>Add the constraint
>ALTER TABLE x_df ADD CONSTRAINT defaul1_cons DEFAULT
(200) for j[vbcol=seagreen]
>Thanks
>Hari
>MCDBA
>
>
>"Michael" <MYKLIV@.hotmail.com> wrote in message
>news:479201c48007$985043e0$a501280a@.phx.gbl...
to[vbcol=seagreen]
and
>
>.
>