Showing posts with label verify. Show all posts
Showing posts with label verify. Show all posts

Tuesday, March 27, 2012

Check Roles assign to user

Hello,
Can you tell me how can i verify to what roles a user is assigned? Is there
any system table or stored procedure to check this information?
Best regards
sp_helplogins,sp_helpusers
"CC&JM" <CCJM@.discussions.microsoft.com> wrote in message
news:A1DF2C34-92DF-4525-871C-FBA160B0F705@.microsoft.com...
> Hello,
> Can you tell me how can i verify to what roles a user is assigned? Is
there
> any system table or stored procedure to check this information?
> Best regards
>

Check Roles assign to user

Hello,
Can you tell me how can i verify to what roles a user is assigned? Is there
any system table or stored procedure to check this information?
Best regardssp_helplogins,sp_helpusers
"CC&JM" <CCJM@.discussions.microsoft.com> wrote in message
news:A1DF2C34-92DF-4525-871C-FBA160B0F705@.microsoft.com...
> Hello,
> Can you tell me how can i verify to what roles a user is assigned? Is
there
> any system table or stored procedure to check this information?
> Best regards
>

Check Roles assign to user

Hello,
Can you tell me how can i verify to what roles a user is assigned? Is there
any system table or stored procedure to check this information?
Best regardssp_helplogins,sp_helpusers
"CC&JM" <CCJM@.discussions.microsoft.com> wrote in message
news:A1DF2C34-92DF-4525-871C-FBA160B0F705@.microsoft.com...
> Hello,
> Can you tell me how can i verify to what roles a user is assigned? Is
there
> any system table or stored procedure to check this information?
> Best regards
>sql

Thursday, March 22, 2012

Check if DB Constraints exist on a table

If we alter the table by disabling the constraints (use NOCHECK CONSTRAINT
ALL). Is there any command to verify that the constraints are disabled or
don't exist.Check out sp_helpconstraint in the BOL.
Tom
----
Thomas A. Moreau, BSc, PhD, MCSE, MCDBA
SQL Server MVP
Columnist, SQL Server Professional
Toronto, ON Canada
www.pinpub.com
.
"SQL_Learner" <SQL_Learner@.discussions.microsoft.com> wrote in message
news:E615AA31-2B87-4B85-BC6B-6CC01BF0D8C8@.microsoft.com...
If we alter the table by disabling the constraints (use NOCHECK CONSTRAINT
ALL). Is there any command to verify that the constraints are disabled or
don't exist.|||Thanks Tom, this command is what I am looking for.
In SQL server, without checking if we enable all constraints (irrespective
of they are enabled or disabled at that point) are the any issues? What are
your thoughts on this.
Thanks in Advance
"Tom Moreau" wrote:

> Check out sp_helpconstraint in the BOL.
> --
> Tom
> ----
> Thomas A. Moreau, BSc, PhD, MCSE, MCDBA
> SQL Server MVP
> Columnist, SQL Server Professional
> Toronto, ON Canada
> www.pinpub.com
> ..
> "SQL_Learner" <SQL_Learner@.discussions.microsoft.com> wrote in message
> news:E615AA31-2B87-4B85-BC6B-6CC01BF0D8C8@.microsoft.com...
> If we alter the table by disabling the constraints (use NOCHECK CONSTRAINT
> ALL). Is there any command to verify that the constraints are disabled or
> don't exist.
>|||That depends. If you attempt to enable the constraints WITH CHECK, and
there are existing violations of those constraints, then re-enabling will
fail. However, if you re-enable WITH NOCHECK, then it will succeed.
That said, if you have a partitioned view, then you'd want to use WITH
CHECK, so as to take advantage of the performance benefits that having such
constraints will give you.
Tom
----
Thomas A. Moreau, BSc, PhD, MCSE, MCDBA
SQL Server MVP
Columnist, SQL Server Professional
Toronto, ON Canada
www.pinpub.com
.
"SQL_Learner" <SQLLearner@.discussions.microsoft.com> wrote in message
news:62ABA723-4797-4C44-AE67-D0D9F853F6D6@.microsoft.com...
Thanks Tom, this command is what I am looking for.
In SQL server, without checking if we enable all constraints (irrespective
of they are enabled or disabled at that point) are the any issues? What are
your thoughts on this.
Thanks in Advance
"Tom Moreau" wrote:

> Check out sp_helpconstraint in the BOL.
> --
> Tom
> ----
> Thomas A. Moreau, BSc, PhD, MCSE, MCDBA
> SQL Server MVP
> Columnist, SQL Server Professional
> Toronto, ON Canada
> www.pinpub.com
> ..
> "SQL_Learner" <SQL_Learner@.discussions.microsoft.com> wrote in message
> news:E615AA31-2B87-4B85-BC6B-6CC01BF0D8C8@.microsoft.com...
> If we alter the table by disabling the constraints (use NOCHECK CONSTRAINT
> ALL). Is there any command to verify that the constraints are disabled or
> don't exist.
>|||I am enabling constraint in the following way:
STMT1: ALTER TABLE Customers CHECK CONSTRAINT ALL
Disabling as:
STMT2: ALTER TABLE Customers NOCHECK CONSTRAINT ALL
In disabled or enabled state, if I am running STMT1 again and again in the
Query Analyser, I am not getting any error. Does that mean in disabled state
the SQL server will enable the constraints and in enabled state it will
ignore to reenable the constraints?
What is the performance issue in this case where I don't have a partitioned
view.
Thanks!|||Yes, it will ignore things if they're already enabled.
In some cases, you could get a performance hit if you're doing a query like:
select
*
from
MyTable m
where exists
(
select
*
from
OtherTable o
where
o.FK = m.PK
)
... and you've disabled the foreign key from OtherTable to MyTable or
re-enabled it with NOCHECK. The optimizer can take advantage of the fact
that it knows something about the data in OtherTable, due to the constraint.
Tom
----
Thomas A. Moreau, BSc, PhD, MCSE, MCDBA
SQL Server MVP
Columnist, SQL Server Professional
Toronto, ON Canada
www.pinpub.com
.
"SQL_Learner" <SQLLearner@.discussions.microsoft.com> wrote in message
news:C227BE86-B58A-4739-B435-F737427C900B@.microsoft.com...
I am enabling constraint in the following way:
STMT1: ALTER TABLE Customers CHECK CONSTRAINT ALL
Disabling as:
STMT2: ALTER TABLE Customers NOCHECK CONSTRAINT ALL
In disabled or enabled state, if I am running STMT1 again and again in the
Query Analyser, I am not getting any error. Does that mean in disabled state
the SQL server will enable the constraints and in enabled state it will
ignore to reenable the constraints?
What is the performance issue in this case where I don't have a partitioned
view.
Thanks!|||Thanks Tom for your post!

Thursday, March 8, 2012

Check all existing collations in one database.

Hello,
Can you tell me, how can i get all collations that i have in one database. I
get the database collation but i need to verify if any table or field in the
current database have one different collation.
I've got one job that is returning the following error:
Server: Msg 457, Level 16, State 1, Procedure WsIBTLoadBatch, Line 20
Implicit conversion of char value to char cannot be performed because the
collation of the value is unresolved due to a collation conflict.
Thanks and best regars.
The following will list columns in tables and views that have a collation
other than the current database default:
SELECT
o.type,
USER_NAME(o.uid),
o.name,
c.name
FROM sysobjects o
JOIN syscolumns c ON c.id = o.id
WHERE
o.type IN('U', 'V') AND
c.collation <> DATABASEPROPERTYEX(DB_NAME(), 'COLLATION')
Hope this helps.
Dan Guzman
SQL Server MVP
"CC&JM" <CCJM@.discussions.microsoft.com> wrote in message
news:31B6222F-B334-4612-853E-D27298405704@.microsoft.com...
> Hello,
> Can you tell me, how can i get all collations that i have in one database.
> I
> get the database collation but i need to verify if any table or field in
> the
> current database have one different collation.
> I've got one job that is returning the following error:
> Server: Msg 457, Level 16, State 1, Procedure WsIBTLoadBatch, Line 20
> Implicit conversion of char value to char cannot be performed because the
> collation of the value is unresolved due to a collation conflict.
> Thanks and best regars.
|||Thanks Dan,
Best regards
"Dan Guzman" wrote:

> The following will list columns in tables and views that have a collation
> other than the current database default:
> SELECT
> o.type,
> USER_NAME(o.uid),
> o.name,
> c.name
> FROM sysobjects o
> JOIN syscolumns c ON c.id = o.id
> WHERE
> o.type IN('U', 'V') AND
> c.collation <> DATABASEPROPERTYEX(DB_NAME(), 'COLLATION')
>
> --
> Hope this helps.
> Dan Guzman
> SQL Server MVP
> "CC&JM" <CCJM@.discussions.microsoft.com> wrote in message
> news:31B6222F-B334-4612-853E-D27298405704@.microsoft.com...
>
>

Check all existing collations in one database.

Hello,
Can you tell me, how can i get all collations that i have in one database. I
get the database collation but i need to verify if any table or field in the
current database have one different collation.
I've got one job that is returning the following error:
Server: Msg 457, Level 16, State 1, Procedure WsIBTLoadBatch, Line 20
Implicit conversion of char value to char cannot be performed because the
collation of the value is unresolved due to a collation conflict.
Thanks and best regars.The following will list columns in tables and views that have a collation
other than the current database default:
SELECT
o.type,
USER_NAME(o.uid),
o.name,
c.name
FROM sysobjects o
JOIN syscolumns c ON c.id = o.id
WHERE
o.type IN('U', 'V') AND
c.collation <> DATABASEPROPERTYEX(DB_NAME(), 'COLLATION')
Hope this helps.
Dan Guzman
SQL Server MVP
"CC&JM" <CCJM@.discussions.microsoft.com> wrote in message
news:31B6222F-B334-4612-853E-D27298405704@.microsoft.com...
> Hello,
> Can you tell me, how can i get all collations that i have in one database.
> I
> get the database collation but i need to verify if any table or field in
> the
> current database have one different collation.
> I've got one job that is returning the following error:
> Server: Msg 457, Level 16, State 1, Procedure WsIBTLoadBatch, Line 20
> Implicit conversion of char value to char cannot be performed because the
> collation of the value is unresolved due to a collation conflict.
> Thanks and best regars.|||Thanks Dan,
Best regards
"Dan Guzman" wrote:
> The following will list columns in tables and views that have a collation
> other than the current database default:
> SELECT
> o.type,
> USER_NAME(o.uid),
> o.name,
> c.name
> FROM sysobjects o
> JOIN syscolumns c ON c.id = o.id
> WHERE
> o.type IN('U', 'V') AND
> c.collation <> DATABASEPROPERTYEX(DB_NAME(), 'COLLATION')
>
> --
> Hope this helps.
> Dan Guzman
> SQL Server MVP
> "CC&JM" <CCJM@.discussions.microsoft.com> wrote in message
> news:31B6222F-B334-4612-853E-D27298405704@.microsoft.com...
> > Hello,
> >
> > Can you tell me, how can i get all collations that i have in one database.
> > I
> > get the database collation but i need to verify if any table or field in
> > the
> > current database have one different collation.
> >
> > I've got one job that is returning the following error:
> > Server: Msg 457, Level 16, State 1, Procedure WsIBTLoadBatch, Line 20
> > Implicit conversion of char value to char cannot be performed because the
> > collation of the value is unresolved due to a collation conflict.
> >
> > Thanks and best regars.
>
>

Check all existing collations in one database.

Hello,
Can you tell me, how can i get all collations that i have in one database. I
get the database collation but i need to verify if any table or field in the
current database have one different collation.
I've got one job that is returning the following error:
Server: Msg 457, Level 16, State 1, Procedure WsIBTLoadBatch, Line 20
Implicit conversion of char value to char cannot be performed because the
collation of the value is unresolved due to a collation conflict.
Thanks and best regars.The following will list columns in tables and views that have a collation
other than the current database default:
SELECT
o.type,
USER_NAME(o.uid),
o.name,
c.name
FROM sysobjects o
JOIN syscolumns c ON c.id = o.id
WHERE
o.type IN('U', 'V') AND
c.collation <> DATABASEPROPERTYEX(DB_NAME(), 'COLLATION')
Hope this helps.
Dan Guzman
SQL Server MVP
"CC&JM" <CCJM@.discussions.microsoft.com> wrote in message
news:31B6222F-B334-4612-853E-D27298405704@.microsoft.com...
> Hello,
> Can you tell me, how can i get all collations that i have in one database.
> I
> get the database collation but i need to verify if any table or field in
> the
> current database have one different collation.
> I've got one job that is returning the following error:
> Server: Msg 457, Level 16, State 1, Procedure WsIBTLoadBatch, Line 20
> Implicit conversion of char value to char cannot be performed because the
> collation of the value is unresolved due to a collation conflict.
> Thanks and best regars.|||Thanks Dan,
Best regards
"Dan Guzman" wrote:

> The following will list columns in tables and views that have a collation
> other than the current database default:
> SELECT
> o.type,
> USER_NAME(o.uid),
> o.name,
> c.name
> FROM sysobjects o
> JOIN syscolumns c ON c.id = o.id
> WHERE
> o.type IN('U', 'V') AND
> c.collation <> DATABASEPROPERTYEX(DB_NAME(), 'COLLATION')
>
> --
> Hope this helps.
> Dan Guzman
> SQL Server MVP
> "CC&JM" <CCJM@.discussions.microsoft.com> wrote in message
> news:31B6222F-B334-4612-853E-D27298405704@.microsoft.com...
>
>