Showing posts with label properties. Show all posts
Showing posts with label properties. Show all posts

Friday, March 30, 2012

Long text in "Default value or Binding"

Hey guys, how can I use a long text as default value in my database (column properties)?
I tried to paste my 10 row text into the field but it will only paste the first row as default value.

any ideas??What's the data type and data length of the column to which you paste text? And where did you paste your 10 row text into database?|||data type: text

It's obviosuly working fine if I create an update command updating the database with the same text. All I want is to have this text as default value for the column. But only the first row will be pasted...

SQL Server Mgmt-studio - Column Properties - default value or binding. Just a lil frustrating :)|||

OK now I understand youSmile Unfortunately this seems to be a flaw of Management Studio GUI, while you can add multiple lines as default in Enterprise Manager in SQL2000Surprise However we can define multiple-line default value by using T-SQL. New a query and use such statement:

ALTER TABLE dbo.test2 ADD CONSTRAINT
DF_Table1_description DEFAULT'The general steps are:

Back up the source database, which can reside on an instance of SQL Server 7.0, SQL Server 2000, or SQL Server 2005. The computer on which this instance of SQL Server is running is the source computer.

.'FOR description

sql

Friday, February 24, 2012

Login Properties: Deny, Disable, Lock Out? Which do I use?

Hey again!

I have a SQL login, and I want to prevent the login from logging into SQL Server.

From SSMS, I connect to the Database Engine, expand Security, Logins.
I right-click the login in question and select Properties. I select the Status page.

So I see I can deny, disable and lock out this login.
What is the difference between these three options?

Also, shouldn't the checkbox "Login is locked out" be checkable?
Currently, it's unchecked/disabled and I cannot alter this value.

I performed a cross-reference of the possible combinations:

SQL Logins:

FQ Login ID Password Status Enabled? Lock? @.@.ERROR
-- -- --
UserName (valid) Grant Enabled No 0
UserName (valid) Grant Enabled Yes 18486
UserName (valid) Grant Disabled No 18470
UserName (valid) Grant Disabled Yes 18470
UserName (valid) Deny Enabled No 18456
UserName (valid) Deny Enabled Yes 18486
UserName (valid) Deny Disabled No 18470
UserName (valid) Deny Disabled Yes 18470
UserName (garbage) Grant Enabled No 18456
UserName (garbage) Grant Enabled Yes 18456
UserName (garbage) Grant Disabled No 18456
UserName (garbage) Grant Disabled Yes 18456
UserName (garbage) Deny Enabled No 18456
UserName (garbage) Deny Enabled Yes 18456
UserName (garbage) Deny Disabled No 18456
UserName (garbage) Deny Disabled Yes 18456
(garbage) (garbage) Either Either No 18456

NT-Logins:

FQ Login ID Password Status Enabled? Lock? @.@.ERROR
-- -- --
DOMAIN\UserName N/A Grant Enabled N/A 0
DOMAIN\UserName N/A Deny Enabled N/A 18456
DOMAIN\UserName N/A Grant Disabled N/A 18470
DOMAIN\UserName N/A Deny Disabled N/A 18470

where @.@.ERROR
0 = Connects
18456 = Login failed for user 'UserName'.
18470 = Login failed for user 'UserName'. Reason: The account is disabled.
18486 = Login failed for user 'UserName' because the account is currently locked out. The system administrator can unlock it.

(Upon third garbage-password, the SQL-account is locked.)

|||

A plain 18456 "login failed" message could mean
- the user is using an incorrect username
- the user is using an incorrect password
- the user isn't defined to the datasource
- the user is denied access.

Based on these findings, I like the "disabled" setting over "denied." If a user calls me with an 18470 message, I have some confidence in that the user connecting with a valid username and password.

Monday, February 20, 2012

Login name does not show?

Hello,

When I create new Database User the login name input does not show on the list and in the "login name " when checking the Properties of the name. Why this behavior?
the previous user created a while ago are showing name and login name .
permissions and rights are the same for between different users having the two different behaviors.

When I created the new database user I input e.g.:
Login Name: AD\<<User Name>>
Name : "First Name"

Thanks,
DomRight-click on "Login" in the folders window and select "Refresh". Enterprise Manager is a GUI, and is not always aware of changes to the underlying database.|||Thanks for the info It helped me discover that the user present in the "Users" container displayed their Login only if they are present in the "Logins" container.

Does it mean I need to create all Logins before adding Database users?

Thanks,
DOm|||That is the general order of things...

You should really create your ROLEs first, and grant them appropriate permissions. Then create the logins, grant them access to the database, and assign them to the roles.