Showing posts with label login. Show all posts
Showing posts with label login. Show all posts

Thursday, March 29, 2012

attach detach db

Is it possible detaching one db coping under/ different names /master and lof
files and reattaching db again to cause login problems later. if yes why?
Not sure I understand the question but the answer is most likely in one of
these:
http://vyaskn.tripod.com/moving_sql_server.htm Moving DBs
http://www.databasejournal.com/featu...le.php/3379901 Moving
system DB's
http://www.support.microsoft.com/?id=314546 Moving DB's between Servers
http://www.support.microsoft.com/?id=224071 Moving SQL Server Databases
to a New Location with Detach/Attach
http://support.microsoft.com/?id=221465 Using WITH MOVE in a
Restore
http://www.support.microsoft.com/?id=246133 How To Transfer Logins and
Passwords Between SQL Servers
http://www.support.microsoft.com/?id=298897 Mapping Logins & SIDs after a
Restore
http://www.dbmaint.com/SyncSqlLogins.asp Utility to map logins to
users
http://www.support.microsoft.com/?id=168001 User Logon and/or Permission
Errors After Restoring Dump
http://www.support.microsoft.com/?id=240872 How to Resolve Permission
Issues When a Database Is Moved Between SQL Servers
http://www.sqlservercentral.com/scri...p?scriptid=599
Restoring a .mdf
Andrew J. Kelly SQL MVP
"Eli Milkova" <EliMilkova@.discussions.microsoft.com> wrote in message
news:8BD9FBF7-6420-49C7-8B3F-25E0774BA43B@.microsoft.com...
> Is it possible detaching one db coping under/ different names /master and
> lof
> files and reattaching db again to cause login problems later. if yes why?
>
|||Hi,
If you are attaching the database with different name in same server, you
will never get any Login issue. If you are attaching into
a different server then you have syncronize the Logins and users using the
system procedure SP_CHANGE_USERS_LOGIN (see Books online)
Thanks
Hari
SQL Server MVP
"Eli Milkova" <EliMilkova@.discussions.microsoft.com> wrote in message
news:8BD9FBF7-6420-49C7-8B3F-25E0774BA43B@.microsoft.com...
> Is it possible detaching one db coping under/ different names /master and
> lof
> files and reattaching db again to cause login problems later. if yes why?
>
|||Hi Hary,
thanks for your reply. Let me try to explain the situation I am in. I had to
make copy for training purposes of a production db. I detached prod db and
copied mdf and ldf in the same data directory but with names test.mdf and
test.ldf. Then I attached our prod db and new test db. During attaching I had
to choose dbowner (domain admin). It seemed to me that i saved time using
this teqniche. But later users reported that they couldnt log in prod and
test db via the application (its in citrix). After short phone talk with
vendors they explained that detaching and attaching caused dbo alias
deleting. They have app login that use dbo alias. I ran sp_addalias 'app,
'dbo' and everithing looks fine with prod db. But its impossible to use test
db. Users that are in sys admin group dont have problem but ordinary users
that connect to applications db via app user cannot login at all. I wonder
whats the problem? all ordinary users are stored in users table in prod db
and have encrypted passwords. app user password is encrypted and stored in
different db.
i will be dismissed : )
"Hari Prasad" wrote:

> Hi,
> If you are attaching the database with different name in same server, you
> will never get any Login issue. If you are attaching into
> a different server then you have syncronize the Logins and users using the
> system procedure SP_CHANGE_USERS_LOGIN (see Books online)
> Thanks
> Hari
> SQL Server MVP
>
> "Eli Milkova" <EliMilkova@.discussions.microsoft.com> wrote in message
> news:8BD9FBF7-6420-49C7-8B3F-25E0774BA43B@.microsoft.com...
>
>
|||Hi Hary,
thanks for your reply. Let me try to explain the situation I am in. I had to
make copy for training purposes of a production db. I detached prod db and
copied mdf and ldf in the same data directory but with names test.mdf and
test.ldf. Then I attached our prod db and new test db. During attaching I had
to choose dbowner (domain admin). It seemed to me that i saved time using
this teqniche. But later users reported that they couldnt log in prod and
test db via the application (its in citrix). After short phone talk with
vendors they explained that detaching and attaching caused dbo alias
deleting. They have app login that use dbo alias. I ran sp_addalias 'app,
'dbo' and everithing looks fine with prod db. But its impossible to use test
db. Users that are in sys admin group dont have problem but ordinary users
that connect to applications db via app user cannot login at all. I wonder
whats the problem? all ordinary users are stored in users table in prod db
and have encrypted passwords. app user password is encrypted and stored in
different db.
i will be dismissed : )
"Andrew J. Kelly" wrote:

> Not sure I understand the question but the answer is most likely in one of
> these:
>
> http://vyaskn.tripod.com/moving_sql_server.htm Moving DBs
> http://www.databasejournal.com/featu...le.php/3379901 Moving
> system DB's
> http://www.support.microsoft.com/?id=314546 Moving DB's between Servers
> http://www.support.microsoft.com/?id=224071 Moving SQL Server Databases
> to a New Location with Detach/Attach
> http://support.microsoft.com/?id=221465 Using WITH MOVE in a
> Restore
> http://www.support.microsoft.com/?id=246133 How To Transfer Logins and
> Passwords Between SQL Servers
> http://www.support.microsoft.com/?id=298897 Mapping Logins & SIDs after a
> Restore
> http://www.dbmaint.com/SyncSqlLogins.asp Utility to map logins to
> users
> http://www.support.microsoft.com/?id=168001 User Logon and/or Permission
> Errors After Restoring Dump
> http://www.support.microsoft.com/?id=240872 How to Resolve Permission
> Issues When a Database Is Moved Between SQL Servers
> http://www.sqlservercentral.com/scri...p?scriptid=599
> Restoring a .mdf
> --
> Andrew J. Kelly SQL MVP
>
> "Eli Milkova" <EliMilkova@.discussions.microsoft.com> wrote in message
> news:8BD9FBF7-6420-49C7-8B3F-25E0774BA43B@.microsoft.com...
>
>
|||Then you should look at the links I posted. In particular this first one
should be most helpful:
http://www.support.microsoft.com/?id=298897 Mapping Logins & SIDs after a
Restore
http://www.support.microsoft.com/?id=168001 User Logon and/or Permission
Errors After Restoring Dump
http://www.support.microsoft.com/?id=240872 How to Resolve Permission
Issues When a Database Is Moved Between SQL Servers
Andrew J. Kelly SQL MVP
"Eli Milkova" <EliMilkova@.discussions.microsoft.com> wrote in message
news:62CB085D-5980-4776-8A35-DEAC178F2AEB@.microsoft.com...[vbcol=seagreen]
> Hi Hary,
> thanks for your reply. Let me try to explain the situation I am in. I had
> to
> make copy for training purposes of a production db. I detached prod db and
> copied mdf and ldf in the same data directory but with names test.mdf and
> test.ldf. Then I attached our prod db and new test db. During attaching I
> had
> to choose dbowner (domain admin). It seemed to me that i saved time using
> this teqniche. But later users reported that they couldnt log in prod and
> test db via the application (its in citrix). After short phone talk with
> vendors they explained that detaching and attaching caused dbo alias
> deleting. They have app login that use dbo alias. I ran sp_addalias 'app,
> 'dbo' and everithing looks fine with prod db. But its impossible to use
> test
> db. Users that are in sys admin group dont have problem but ordinary users
> that connect to applications db via app user cannot login at all. I wonder
> whats the problem? all ordinary users are stored in users table in prod db
> and have encrypted passwords. app user password is encrypted and stored in
> different db.
> i will be dismissed : )
>
> "Andrew J. Kelly" wrote:
|||Thanx : ) I hope this will help. Just curios if EE could have the same login
problems. May be will be better to upgrade to EE
"Andrew J. Kelly" wrote:

> Then you should look at the links I posted. In particular this first one
> should be most helpful:
> http://www.support.microsoft.com/?id=298897 Mapping Logins & SIDs after a
> Restore
> http://www.support.microsoft.com/?id=168001 User Logon and/or Permission
> Errors After Restoring Dump
> http://www.support.microsoft.com/?id=240872 How to Resolve Permission
> Issues When a Database Is Moved Between SQL Servers
> --
> Andrew J. Kelly SQL MVP
>
> "Eli Milkova" <EliMilkova@.discussions.microsoft.com> wrote in message
> news:62CB085D-5980-4776-8A35-DEAC178F2AEB@.microsoft.com...
>
>
|||It would be the same for any edition.
Andrew J. Kelly SQL MVP
"Eli Milkova" <EliMilkova@.discussions.microsoft.com> wrote in message
news:B7FD797D-F1DB-41E4-B6D4-0BDA27B27153@.microsoft.com...[vbcol=seagreen]
> Thanx : ) I hope this will help. Just curios if EE could have the same
> login
> problems. May be will be better to upgrade to EE
> "Andrew J. Kelly" wrote:

attach detach db

Is it possible detaching one db coping under/ different names /master and lo
f
files and reattaching db again to cause login problems later. if yes why?Not sure I understand the question but the answer is most likely in one of
these:
http://vyaskn.tripod.com/moving_sql_server.htm Moving DBs
http://www.databasejournal.com/feat...cle.php/3379901 Moving
system DB's
http://www.support.microsoft.com/?id=314546 Moving DB's between Servers
http://www.support.microsoft.com/?id=224071 Moving SQL Server Databases
to a New Location with Detach/Attach
http://support.microsoft.com/?id=221465 Using WITH MOVE in a
Restore
http://www.support.microsoft.com/?id=246133 How To Transfer Logins and
Passwords Between SQL Servers
http://www.support.microsoft.com/?id=298897 Mapping Logins & SIDs after a
Restore
http://www.dbmaint.com/SyncSqlLogins.asp Utility to map logins to
users
http://www.support.microsoft.com/?id=168001 User Logon and/or Permission
Errors After Restoring Dump
http://www.support.microsoft.com/?id=240872 How to Resolve Permission
Issues When a Database Is Moved Between SQL Servers
http://www.sqlservercentral.com/scr...sp?scriptid=599
Restoring a .mdf
Andrew J. Kelly SQL MVP
"Eli Milkova" <EliMilkova@.discussions.microsoft.com> wrote in message
news:8BD9FBF7-6420-49C7-8B3F-25E0774BA43B@.microsoft.com...
> Is it possible detaching one db coping under/ different names /master and
> lof
> files and reattaching db again to cause login problems later. if yes why?
>|||Hi,
If you are attaching the database with different name in same server, you
will never get any Login issue. If you are attaching into
a different server then you have syncronize the Logins and users using the
system procedure SP_CHANGE_USERS_LOGIN (see Books online)
Thanks
Hari
SQL Server MVP
"Eli Milkova" <EliMilkova@.discussions.microsoft.com> wrote in message
news:8BD9FBF7-6420-49C7-8B3F-25E0774BA43B@.microsoft.com...
> Is it possible detaching one db coping under/ different names /master and
> lof
> files and reattaching db again to cause login problems later. if yes why?
>|||Hi Hary,
thanks for your reply. Let me try to explain the situation I am in. I had to
make copy for training purposes of a production db. I detached prod db and
copied mdf and ldf in the same data directory but with names test.mdf and
test.ldf. Then I attached our prod db and new test db. During attaching I ha
d
to choose dbowner (domain admin). It seemed to me that i saved time using
this teqniche. But later users reported that they couldnt log in prod and
test db via the application (its in citrix). After short phone talk with
vendors they explained that detaching and attaching caused dbo alias
deleting. They have app login that use dbo alias. I ran sp_addalias 'app,
'dbo' and everithing looks fine with prod db. But its impossible to use test
db. Users that are in sys admin group dont have problem but ordinary users
that connect to applications db via app user cannot login at all. I wonder
whats the problem? all ordinary users are stored in users table in prod db
and have encrypted passwords. app user password is encrypted and stored in
different db.
i will be dismissed : )
"Hari Prasad" wrote:

> Hi,
> If you are attaching the database with different name in same server, you
> will never get any Login issue. If you are attaching into
> a different server then you have syncronize the Logins and users using the
> system procedure SP_CHANGE_USERS_LOGIN (see Books online)
> Thanks
> Hari
> SQL Server MVP
>
> "Eli Milkova" <EliMilkova@.discussions.microsoft.com> wrote in message
> news:8BD9FBF7-6420-49C7-8B3F-25E0774BA43B@.microsoft.com...
>
>|||Hi Hary,
thanks for your reply. Let me try to explain the situation I am in. I had to
make copy for training purposes of a production db. I detached prod db and
copied mdf and ldf in the same data directory but with names test.mdf and
test.ldf. Then I attached our prod db and new test db. During attaching I ha
d
to choose dbowner (domain admin). It seemed to me that i saved time using
this teqniche. But later users reported that they couldnt log in prod and
test db via the application (its in citrix). After short phone talk with
vendors they explained that detaching and attaching caused dbo alias
deleting. They have app login that use dbo alias. I ran sp_addalias 'app,
'dbo' and everithing looks fine with prod db. But its impossible to use test
db. Users that are in sys admin group dont have problem but ordinary users
that connect to applications db via app user cannot login at all. I wonder
whats the problem? all ordinary users are stored in users table in prod db
and have encrypted passwords. app user password is encrypted and stored in
different db.
i will be dismissed : )
"Andrew J. Kelly" wrote:

> Not sure I understand the question but the answer is most likely in one of
> these:
>
> http://vyaskn.tripod.com/moving_sql_server.htm Moving DBs
> http://www.databasejournal.com/feat...cle.php/3379901 Movin
g
> system DB's
> http://www.support.microsoft.com/?id=314546 Moving DB's between Server
s
> http://www.support.microsoft.com/?id=224071 Moving SQL Server Database
s
> to a New Location with Detach/Attach
> http://support.microsoft.com/?id=221465 Using WITH MOVE in a
> Restore
> http://www.support.microsoft.com/?id=246133 How To Transfer Logins and
> Passwords Between SQL Servers
> http://www.support.microsoft.com/?id=298897 Mapping Logins & SIDs after
a
> Restore
> http://www.dbmaint.com/SyncSqlLogins.asp Utility to map logins to
> users
> http://www.support.microsoft.com/?id=168001 User Logon and/or Permissi
on
> Errors After Restoring Dump
> http://www.support.microsoft.com/?id=240872 How to Resolve Permission
> Issues When a Database Is Moved Between SQL Servers
> http://www.sqlservercentral.com/scr...sp?scriptid=599
> Restoring a .mdf
> --
> Andrew J. Kelly SQL MVP
>
> "Eli Milkova" <EliMilkova@.discussions.microsoft.com> wrote in message
> news:8BD9FBF7-6420-49C7-8B3F-25E0774BA43B@.microsoft.com...
>
>|||Then you should look at the links I posted. In particular this first one
should be most helpful:
http://www.support.microsoft.com/?id=298897 Mapping Logins & SIDs after a
Restore
http://www.support.microsoft.com/?id=168001 User Logon and/or Permission
Errors After Restoring Dump
http://www.support.microsoft.com/?id=240872 How to Resolve Permission
Issues When a Database Is Moved Between SQL Servers
Andrew J. Kelly SQL MVP
"Eli Milkova" <EliMilkova@.discussions.microsoft.com> wrote in message
news:62CB085D-5980-4776-8A35-DEAC178F2AEB@.microsoft.com...[vbcol=seagreen]
> Hi Hary,
> thanks for your reply. Let me try to explain the situation I am in. I had
> to
> make copy for training purposes of a production db. I detached prod db and
> copied mdf and ldf in the same data directory but with names test.mdf and
> test.ldf. Then I attached our prod db and new test db. During attaching I
> had
> to choose dbowner (domain admin). It seemed to me that i saved time using
> this teqniche. But later users reported that they couldnt log in prod and
> test db via the application (its in citrix). After short phone talk with
> vendors they explained that detaching and attaching caused dbo alias
> deleting. They have app login that use dbo alias. I ran sp_addalias 'app,
> 'dbo' and everithing looks fine with prod db. But its impossible to use
> test
> db. Users that are in sys admin group dont have problem but ordinary users
> that connect to applications db via app user cannot login at all. I wonder
> whats the problem? all ordinary users are stored in users table in prod db
> and have encrypted passwords. app user password is encrypted and stored in
> different db.
> i will be dismissed : )
>
> "Andrew J. Kelly" wrote:
>|||Thanx : ) I hope this will help. Just curios if EE could have the same login
problems. May be will be better to upgrade to EE
"Andrew J. Kelly" wrote:

> Then you should look at the links I posted. In particular this first one
> should be most helpful:
> http://www.support.microsoft.com/?id=298897 Mapping Logins & SIDs after
a
> Restore
> http://www.support.microsoft.com/?id=168001 User Logon and/or Permissi
on
> Errors After Restoring Dump
> http://www.support.microsoft.com/?id=240872 How to Resolve Permission
> Issues When a Database Is Moved Between SQL Servers
> --
> Andrew J. Kelly SQL MVP
>
> "Eli Milkova" <EliMilkova@.discussions.microsoft.com> wrote in message
> news:62CB085D-5980-4776-8A35-DEAC178F2AEB@.microsoft.com...
>
>|||It would be the same for any edition.
Andrew J. Kelly SQL MVP
"Eli Milkova" <EliMilkova@.discussions.microsoft.com> wrote in message
news:B7FD797D-F1DB-41E4-B6D4-0BDA27B27153@.microsoft.com...[vbcol=seagreen]
> Thanx : ) I hope this will help. Just curios if EE could have the same
> login
> problems. May be will be better to upgrade to EE
> "Andrew J. Kelly" wrote:
>

attach detach db

Is it possible detaching one db coping under/ different names /master and lof
files and reattaching db again to cause login problems later. if yes why?Not sure I understand the question but the answer is most likely in one of
these:
http://vyaskn.tripod.com/moving_sql_server.htm Moving DBs
http://www.databasejournal.com/features/mssql/article.php/3379901 Moving
system DB's
http://www.support.microsoft.com/?id=314546 Moving DB's between Servers
http://www.support.microsoft.com/?id=224071 Moving SQL Server Databases
to a New Location with Detach/Attach
http://support.microsoft.com/?id=221465 Using WITH MOVE in a
Restore
http://www.support.microsoft.com/?id=246133 How To Transfer Logins and
Passwords Between SQL Servers
http://www.support.microsoft.com/?id=298897 Mapping Logins & SIDs after a
Restore
http://www.dbmaint.com/SyncSqlLogins.asp Utility to map logins to
users
http://www.support.microsoft.com/?id=168001 User Logon and/or Permission
Errors After Restoring Dump
http://www.support.microsoft.com/?id=240872 How to Resolve Permission
Issues When a Database Is Moved Between SQL Servers
http://www.sqlservercentral.com/scripts/scriptdetails.asp?scriptid=599
Restoring a .mdf
--
Andrew J. Kelly SQL MVP
"Eli Milkova" <EliMilkova@.discussions.microsoft.com> wrote in message
news:8BD9FBF7-6420-49C7-8B3F-25E0774BA43B@.microsoft.com...
> Is it possible detaching one db coping under/ different names /master and
> lof
> files and reattaching db again to cause login problems later. if yes why?
>|||Hi,
If you are attaching the database with different name in same server, you
will never get any Login issue. If you are attaching into
a different server then you have syncronize the Logins and users using the
system procedure SP_CHANGE_USERS_LOGIN (see Books online)
Thanks
Hari
SQL Server MVP
"Eli Milkova" <EliMilkova@.discussions.microsoft.com> wrote in message
news:8BD9FBF7-6420-49C7-8B3F-25E0774BA43B@.microsoft.com...
> Is it possible detaching one db coping under/ different names /master and
> lof
> files and reattaching db again to cause login problems later. if yes why?
>|||Hi Hary,
thanks for your reply. Let me try to explain the situation I am in. I had to
make copy for training purposes of a production db. I detached prod db and
copied mdf and ldf in the same data directory but with names test.mdf and
test.ldf. Then I attached our prod db and new test db. During attaching I had
to choose dbowner (domain admin). It seemed to me that i saved time using
this teqniche. But later users reported that they couldnt log in prod and
test db via the application (its in citrix). After short phone talk with
vendors they explained that detaching and attaching caused dbo alias
deleting. They have app login that use dbo alias. I ran sp_addalias 'app,
'dbo' and everithing looks fine with prod db. But its impossible to use test
db. Users that are in sys admin group dont have problem but ordinary users
that connect to applications db via app user cannot login at all. I wonder
whats the problem? all ordinary users are stored in users table in prod db
and have encrypted passwords. app user password is encrypted and stored in
different db.
i will be dismissed : )
"Hari Prasad" wrote:
> Hi,
> If you are attaching the database with different name in same server, you
> will never get any Login issue. If you are attaching into
> a different server then you have syncronize the Logins and users using the
> system procedure SP_CHANGE_USERS_LOGIN (see Books online)
> Thanks
> Hari
> SQL Server MVP
>
> "Eli Milkova" <EliMilkova@.discussions.microsoft.com> wrote in message
> news:8BD9FBF7-6420-49C7-8B3F-25E0774BA43B@.microsoft.com...
> > Is it possible detaching one db coping under/ different names /master and
> > lof
> > files and reattaching db again to cause login problems later. if yes why?
> >
>
>|||Hi Hary,
thanks for your reply. Let me try to explain the situation I am in. I had to
make copy for training purposes of a production db. I detached prod db and
copied mdf and ldf in the same data directory but with names test.mdf and
test.ldf. Then I attached our prod db and new test db. During attaching I had
to choose dbowner (domain admin). It seemed to me that i saved time using
this teqniche. But later users reported that they couldnt log in prod and
test db via the application (its in citrix). After short phone talk with
vendors they explained that detaching and attaching caused dbo alias
deleting. They have app login that use dbo alias. I ran sp_addalias 'app,
'dbo' and everithing looks fine with prod db. But its impossible to use test
db. Users that are in sys admin group dont have problem but ordinary users
that connect to applications db via app user cannot login at all. I wonder
whats the problem? all ordinary users are stored in users table in prod db
and have encrypted passwords. app user password is encrypted and stored in
different db.
i will be dismissed : )
"Andrew J. Kelly" wrote:
> Not sure I understand the question but the answer is most likely in one of
> these:
>
> http://vyaskn.tripod.com/moving_sql_server.htm Moving DBs
> http://www.databasejournal.com/features/mssql/article.php/3379901 Moving
> system DB's
> http://www.support.microsoft.com/?id=314546 Moving DB's between Servers
> http://www.support.microsoft.com/?id=224071 Moving SQL Server Databases
> to a New Location with Detach/Attach
> http://support.microsoft.com/?id=221465 Using WITH MOVE in a
> Restore
> http://www.support.microsoft.com/?id=246133 How To Transfer Logins and
> Passwords Between SQL Servers
> http://www.support.microsoft.com/?id=298897 Mapping Logins & SIDs after a
> Restore
> http://www.dbmaint.com/SyncSqlLogins.asp Utility to map logins to
> users
> http://www.support.microsoft.com/?id=168001 User Logon and/or Permission
> Errors After Restoring Dump
> http://www.support.microsoft.com/?id=240872 How to Resolve Permission
> Issues When a Database Is Moved Between SQL Servers
> http://www.sqlservercentral.com/scripts/scriptdetails.asp?scriptid=599
> Restoring a .mdf
> --
> Andrew J. Kelly SQL MVP
>
> "Eli Milkova" <EliMilkova@.discussions.microsoft.com> wrote in message
> news:8BD9FBF7-6420-49C7-8B3F-25E0774BA43B@.microsoft.com...
> > Is it possible detaching one db coping under/ different names /master and
> > lof
> > files and reattaching db again to cause login problems later. if yes why?
> >
>
>|||Then you should look at the links I posted. In particular this first one
should be most helpful:
http://www.support.microsoft.com/?id=298897 Mapping Logins & SIDs after a
Restore
http://www.support.microsoft.com/?id=168001 User Logon and/or Permission
Errors After Restoring Dump
http://www.support.microsoft.com/?id=240872 How to Resolve Permission
Issues When a Database Is Moved Between SQL Servers
--
Andrew J. Kelly SQL MVP
"Eli Milkova" <EliMilkova@.discussions.microsoft.com> wrote in message
news:62CB085D-5980-4776-8A35-DEAC178F2AEB@.microsoft.com...
> Hi Hary,
> thanks for your reply. Let me try to explain the situation I am in. I had
> to
> make copy for training purposes of a production db. I detached prod db and
> copied mdf and ldf in the same data directory but with names test.mdf and
> test.ldf. Then I attached our prod db and new test db. During attaching I
> had
> to choose dbowner (domain admin). It seemed to me that i saved time using
> this teqniche. But later users reported that they couldnt log in prod and
> test db via the application (its in citrix). After short phone talk with
> vendors they explained that detaching and attaching caused dbo alias
> deleting. They have app login that use dbo alias. I ran sp_addalias 'app,
> 'dbo' and everithing looks fine with prod db. But its impossible to use
> test
> db. Users that are in sys admin group dont have problem but ordinary users
> that connect to applications db via app user cannot login at all. I wonder
> whats the problem? all ordinary users are stored in users table in prod db
> and have encrypted passwords. app user password is encrypted and stored in
> different db.
> i will be dismissed : )
>
> "Andrew J. Kelly" wrote:
>> Not sure I understand the question but the answer is most likely in one
>> of
>> these:
>>
>> http://vyaskn.tripod.com/moving_sql_server.htm Moving DBs
>> http://www.databasejournal.com/features/mssql/article.php/3379901
>> Moving
>> system DB's
>> http://www.support.microsoft.com/?id=314546 Moving DB's between
>> Servers
>> http://www.support.microsoft.com/?id=224071 Moving SQL Server
>> Databases
>> to a New Location with Detach/Attach
>> http://support.microsoft.com/?id=221465 Using WITH MOVE in a
>> Restore
>> http://www.support.microsoft.com/?id=246133 How To Transfer Logins
>> and
>> Passwords Between SQL Servers
>> http://www.support.microsoft.com/?id=298897 Mapping Logins & SIDs
>> after a
>> Restore
>> http://www.dbmaint.com/SyncSqlLogins.asp Utility to map logins to
>> users
>> http://www.support.microsoft.com/?id=168001 User Logon and/or
>> Permission
>> Errors After Restoring Dump
>> http://www.support.microsoft.com/?id=240872 How to Resolve Permission
>> Issues When a Database Is Moved Between SQL Servers
>> http://www.sqlservercentral.com/scripts/scriptdetails.asp?scriptid=599
>> Restoring a .mdf
>> --
>> Andrew J. Kelly SQL MVP
>>
>> "Eli Milkova" <EliMilkova@.discussions.microsoft.com> wrote in message
>> news:8BD9FBF7-6420-49C7-8B3F-25E0774BA43B@.microsoft.com...
>> > Is it possible detaching one db coping under/ different names /master
>> > and
>> > lof
>> > files and reattaching db again to cause login problems later. if yes
>> > why?
>> >
>>|||Thanx : ) I hope this will help. Just curios if EE could have the same login
problems. May be will be better to upgrade to EE
"Andrew J. Kelly" wrote:
> Then you should look at the links I posted. In particular this first one
> should be most helpful:
> http://www.support.microsoft.com/?id=298897 Mapping Logins & SIDs after a
> Restore
> http://www.support.microsoft.com/?id=168001 User Logon and/or Permission
> Errors After Restoring Dump
> http://www.support.microsoft.com/?id=240872 How to Resolve Permission
> Issues When a Database Is Moved Between SQL Servers
> --
> Andrew J. Kelly SQL MVP
>
> "Eli Milkova" <EliMilkova@.discussions.microsoft.com> wrote in message
> news:62CB085D-5980-4776-8A35-DEAC178F2AEB@.microsoft.com...
> > Hi Hary,
> > thanks for your reply. Let me try to explain the situation I am in. I had
> > to
> > make copy for training purposes of a production db. I detached prod db and
> > copied mdf and ldf in the same data directory but with names test.mdf and
> > test.ldf. Then I attached our prod db and new test db. During attaching I
> > had
> > to choose dbowner (domain admin). It seemed to me that i saved time using
> > this teqniche. But later users reported that they couldnt log in prod and
> > test db via the application (its in citrix). After short phone talk with
> > vendors they explained that detaching and attaching caused dbo alias
> > deleting. They have app login that use dbo alias. I ran sp_addalias 'app,
> > 'dbo' and everithing looks fine with prod db. But its impossible to use
> > test
> > db. Users that are in sys admin group dont have problem but ordinary users
> > that connect to applications db via app user cannot login at all. I wonder
> > whats the problem? all ordinary users are stored in users table in prod db
> > and have encrypted passwords. app user password is encrypted and stored in
> > different db.
> >
> > i will be dismissed : )
> >
> >
> >
> > "Andrew J. Kelly" wrote:
> >
> >> Not sure I understand the question but the answer is most likely in one
> >> of
> >> these:
> >>
> >>
> >> http://vyaskn.tripod.com/moving_sql_server.htm Moving DBs
> >> http://www.databasejournal.com/features/mssql/article.php/3379901
> >> Moving
> >> system DB's
> >> http://www.support.microsoft.com/?id=314546 Moving DB's between
> >> Servers
> >> http://www.support.microsoft.com/?id=224071 Moving SQL Server
> >> Databases
> >> to a New Location with Detach/Attach
> >> http://support.microsoft.com/?id=221465 Using WITH MOVE in a
> >> Restore
> >> http://www.support.microsoft.com/?id=246133 How To Transfer Logins
> >> and
> >> Passwords Between SQL Servers
> >> http://www.support.microsoft.com/?id=298897 Mapping Logins & SIDs
> >> after a
> >> Restore
> >> http://www.dbmaint.com/SyncSqlLogins.asp Utility to map logins to
> >> users
> >> http://www.support.microsoft.com/?id=168001 User Logon and/or
> >> Permission
> >> Errors After Restoring Dump
> >> http://www.support.microsoft.com/?id=240872 How to Resolve Permission
> >> Issues When a Database Is Moved Between SQL Servers
> >> http://www.sqlservercentral.com/scripts/scriptdetails.asp?scriptid=599
> >> Restoring a .mdf
> >>
> >> --
> >> Andrew J. Kelly SQL MVP
> >>
> >>
> >> "Eli Milkova" <EliMilkova@.discussions.microsoft.com> wrote in message
> >> news:8BD9FBF7-6420-49C7-8B3F-25E0774BA43B@.microsoft.com...
> >> > Is it possible detaching one db coping under/ different names /master
> >> > and
> >> > lof
> >> > files and reattaching db again to cause login problems later. if yes
> >> > why?
> >> >
> >>
> >>
> >>
>
>|||It would be the same for any edition.
--
Andrew J. Kelly SQL MVP
"Eli Milkova" <EliMilkova@.discussions.microsoft.com> wrote in message
news:B7FD797D-F1DB-41E4-B6D4-0BDA27B27153@.microsoft.com...
> Thanx : ) I hope this will help. Just curios if EE could have the same
> login
> problems. May be will be better to upgrade to EE
> "Andrew J. Kelly" wrote:
>> Then you should look at the links I posted. In particular this first one
>> should be most helpful:
>> http://www.support.microsoft.com/?id=298897 Mapping Logins & SIDs
>> after a
>> Restore
>> http://www.support.microsoft.com/?id=168001 User Logon and/or
>> Permission
>> Errors After Restoring Dump
>> http://www.support.microsoft.com/?id=240872 How to Resolve Permission
>> Issues When a Database Is Moved Between SQL Servers
>> --
>> Andrew J. Kelly SQL MVP
>>
>> "Eli Milkova" <EliMilkova@.discussions.microsoft.com> wrote in message
>> news:62CB085D-5980-4776-8A35-DEAC178F2AEB@.microsoft.com...
>> > Hi Hary,
>> > thanks for your reply. Let me try to explain the situation I am in. I
>> > had
>> > to
>> > make copy for training purposes of a production db. I detached prod db
>> > and
>> > copied mdf and ldf in the same data directory but with names test.mdf
>> > and
>> > test.ldf. Then I attached our prod db and new test db. During attaching
>> > I
>> > had
>> > to choose dbowner (domain admin). It seemed to me that i saved time
>> > using
>> > this teqniche. But later users reported that they couldnt log in prod
>> > and
>> > test db via the application (its in citrix). After short phone talk
>> > with
>> > vendors they explained that detaching and attaching caused dbo alias
>> > deleting. They have app login that use dbo alias. I ran sp_addalias
>> > 'app,
>> > 'dbo' and everithing looks fine with prod db. But its impossible to use
>> > test
>> > db. Users that are in sys admin group dont have problem but ordinary
>> > users
>> > that connect to applications db via app user cannot login at all. I
>> > wonder
>> > whats the problem? all ordinary users are stored in users table in prod
>> > db
>> > and have encrypted passwords. app user password is encrypted and stored
>> > in
>> > different db.
>> >
>> > i will be dismissed : )
>> >
>> >
>> >
>> > "Andrew J. Kelly" wrote:
>> >
>> >> Not sure I understand the question but the answer is most likely in
>> >> one
>> >> of
>> >> these:
>> >>
>> >>
>> >> http://vyaskn.tripod.com/moving_sql_server.htm Moving DBs
>> >> http://www.databasejournal.com/features/mssql/article.php/3379901
>> >> Moving
>> >> system DB's
>> >> http://www.support.microsoft.com/?id=314546 Moving DB's between
>> >> Servers
>> >> http://www.support.microsoft.com/?id=224071 Moving SQL Server
>> >> Databases
>> >> to a New Location with Detach/Attach
>> >> http://support.microsoft.com/?id=221465 Using WITH MOVE in
>> >> a
>> >> Restore
>> >> http://www.support.microsoft.com/?id=246133 How To Transfer Logins
>> >> and
>> >> Passwords Between SQL Servers
>> >> http://www.support.microsoft.com/?id=298897 Mapping Logins & SIDs
>> >> after a
>> >> Restore
>> >> http://www.dbmaint.com/SyncSqlLogins.asp Utility to map logins
>> >> to
>> >> users
>> >> http://www.support.microsoft.com/?id=168001 User Logon and/or
>> >> Permission
>> >> Errors After Restoring Dump
>> >> http://www.support.microsoft.com/?id=240872 How to Resolve
>> >> Permission
>> >> Issues When a Database Is Moved Between SQL Servers
>> >> http://www.sqlservercentral.com/scripts/scriptdetails.asp?scriptid=599
>> >> Restoring a .mdf
>> >>
>> >> --
>> >> Andrew J. Kelly SQL MVP
>> >>
>> >>
>> >> "Eli Milkova" <EliMilkova@.discussions.microsoft.com> wrote in message
>> >> news:8BD9FBF7-6420-49C7-8B3F-25E0774BA43B@.microsoft.com...
>> >> > Is it possible detaching one db coping under/ different names
>> >> > /master
>> >> > and
>> >> > lof
>> >> > files and reattaching db again to cause login problems later. if yes
>> >> > why?
>> >> >
>> >>
>> >>
>> >>
>>sql

Sunday, March 25, 2012

Attach an aspnet or sql2005 database on a sql2000 server

Hello

I want to attach an ASPNETDB database (generated by the asp.net login wizard system), which is a sql2005 .mdf database I think, to our SQL2000 server.

I tried to attach the file directly ; then to attach it to a sql2005 express server, "turning it" into a sql2000 database via the properties, then make a backup, then restore the backup on the 2000 server ; nothing worked out !
One of the method I tried (I don't remember which one) told me it could'nt read the sysindexes table ; of course, because there isn't such table on sql2005 databases.

So, is there a way to attach a SQL2005 database (so with no or few system tables) to a SQL2000 server (which requires those tables), or to re-generate the ASPNETDB in the SQL2000 format ?
If I re-create the syssomething tables on the SQL2005 database, will it work that simply ?

At the very last, I may have to install SQL express on the server. If there is already a SQL2000 server on the machine, will it cohabit with no problem ? Is the SQL express server ready for a production server with light or medium load ?

Thanks a lot, and sorry for so many questions ! :)

Hi,

"I want to attach an ASPNETDB database (generated by the asp.net login wizard system), which is a sql2005 .mdf database I think, to our SQL2000 server."

-That′s not working, the format is different to SQL Server 2k5, there is no backward compatibility.

""turning it" into a sql2000 database"

-Making the compatibility level to 2000 doesn't mean that the database is 2000 ready, it just behaves on a SQL2k5 machine like a SQL 2k database.

You will either have to script the object and the data out or bcp the data out or use any wizard to transfer the objects to the other SQL 2000 Server machine.

HTH, Jens Suessmeyer.

http://www.sqlserver2005.de

|||Ok, and if I export the database structure as a SQL script, will it just work ?

And for the SQL2005 Express server, is it usable along with the SQL2000 server, and does it fits for a ligt-load production server ?

thanks !
|||

Hi,

sure as long as you don′t use any new features of SQL Server 2005 and you take care of the difference of schema and owner you should be fine.

SQL 2k and SQL2k5X is working together. It can be also used as a light load production server (whatever that means in your case :-) ), it is only limited by the limitations of SQL Server Express, no query governor or anything else.

HTH, jens Suessmeyer.

http://www.sqlserver2005.de

Monday, March 19, 2012

Associate User to Login

Is there a way to associate an existing user in a database to an existing
SQL Server login?
This is SQL Server 2000.
I've restored a database from a backup and when I look at the users, the
users which were there before don't have a Login Name associated with them.
The only way I found to associate it is to delete the user and go to the
login to give that user database access (which automatically creates the
user in the database). If I try to give the user database access with the
old user still in the database, it will give me an error indicating that the
user already exists.
The reason for this is I didn't create the database and the users and was
hoping to associate the user's to the obvious logins to avoid changing any
permissions or roles by accident or omission. Using the existing user would
keep the same configuration for that user.
Thank you,
Gary
This is what sp_change_users_login is for.
Or transfer the logins properly in the first place using sp_help_revlogin (search KB for this).
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
Blog: http://solidqualitylearning.com/blogs/tibor/
"Gary" <tuffboystl@.hotmail.com> wrote in message news:OdGnkRJsFHA.912@.TK2MSFTNGP11.phx.gbl...
> Is there a way to associate an existing user in a database to an existing
> SQL Server login?
> This is SQL Server 2000.
> I've restored a database from a backup and when I look at the users, the
> users which were there before don't have a Login Name associated with them.
> The only way I found to associate it is to delete the user and go to the
> login to give that user database access (which automatically creates the
> user in the database). If I try to give the user database access with the
> old user still in the database, it will give me an error indicating that the
> user already exists.
> The reason for this is I didn't create the database and the users and was
> hoping to associate the user's to the obvious logins to avoid changing any
> permissions or roles by accident or omission. Using the existing user would
> keep the same configuration for that user.
> Thank you,
> Gary
>
|||You can use sp_change_users_login to change the login/user mapping. See the
Books Online for usage details.
Hope this helps.
Dan Guzman
SQL Server MVP
"Gary" <tuffboystl@.hotmail.com> wrote in message
news:OdGnkRJsFHA.912@.TK2MSFTNGP11.phx.gbl...
> Is there a way to associate an existing user in a database to an existing
> SQL Server login?
> This is SQL Server 2000.
> I've restored a database from a backup and when I look at the users, the
> users which were there before don't have a Login Name associated with
> them. The only way I found to associate it is to delete the user and go to
> the login to give that user database access (which automatically creates
> the user in the database). If I try to give the user database access with
> the old user still in the database, it will give me an error indicating
> that the user already exists.
> The reason for this is I didn't create the database and the users and was
> hoping to associate the user's to the obvious logins to avoid changing any
> permissions or roles by accident or omission. Using the existing user
> would keep the same configuration for that user.
> Thank you,
> Gary
>
|||HI,
Execute the below command:-
Use dbname
go
sp_change_users_login 'update_one','login_name','User_name'
Thanks
Hari
SQL Server MVP
"Gary" <tuffboystl@.hotmail.com> wrote in message
news:OdGnkRJsFHA.912@.TK2MSFTNGP11.phx.gbl...
> Is there a way to associate an existing user in a database to an existing
> SQL Server login?
> This is SQL Server 2000.
> I've restored a database from a backup and when I look at the users, the
> users which were there before don't have a Login Name associated with
> them. The only way I found to associate it is to delete the user and go to
> the login to give that user database access (which automatically creates
> the user in the database). If I try to give the user database access with
> the old user still in the database, it will give me an error indicating
> that the user already exists.
> The reason for this is I didn't create the database and the users and was
> hoping to associate the user's to the obvious logins to avoid changing any
> permissions or roles by accident or omission. Using the existing user
> would keep the same configuration for that user.
> Thank you,
> Gary
>

Associate User to Login

Is there a way to associate an existing user in a database to an existing
SQL Server login?
This is SQL Server 2000.
I've restored a database from a backup and when I look at the users, the
users which were there before don't have a Login Name associated with them.
The only way I found to associate it is to delete the user and go to the
login to give that user database access (which automatically creates the
user in the database). If I try to give the user database access with the
old user still in the database, it will give me an error indicating that the
user already exists.
The reason for this is I didn't create the database and the users and was
hoping to associate the user's to the obvious logins to avoid changing any
permissions or roles by accident or omission. Using the existing user would
keep the same configuration for that user.
Thank you,
GaryThis is what sp_change_users_login is for.
Or transfer the logins properly in the first place using sp_help_revlogin (search KB for this).
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
Blog: http://solidqualitylearning.com/blogs/tibor/
"Gary" <tuffboystl@.hotmail.com> wrote in message news:OdGnkRJsFHA.912@.TK2MSFTNGP11.phx.gbl...
> Is there a way to associate an existing user in a database to an existing
> SQL Server login?
> This is SQL Server 2000.
> I've restored a database from a backup and when I look at the users, the
> users which were there before don't have a Login Name associated with them.
> The only way I found to associate it is to delete the user and go to the
> login to give that user database access (which automatically creates the
> user in the database). If I try to give the user database access with the
> old user still in the database, it will give me an error indicating that the
> user already exists.
> The reason for this is I didn't create the database and the users and was
> hoping to associate the user's to the obvious logins to avoid changing any
> permissions or roles by accident or omission. Using the existing user would
> keep the same configuration for that user.
> Thank you,
> Gary
>|||You can use sp_change_users_login to change the login/user mapping. See the
Books Online for usage details.
--
Hope this helps.
Dan Guzman
SQL Server MVP
"Gary" <tuffboystl@.hotmail.com> wrote in message
news:OdGnkRJsFHA.912@.TK2MSFTNGP11.phx.gbl...
> Is there a way to associate an existing user in a database to an existing
> SQL Server login?
> This is SQL Server 2000.
> I've restored a database from a backup and when I look at the users, the
> users which were there before don't have a Login Name associated with
> them. The only way I found to associate it is to delete the user and go to
> the login to give that user database access (which automatically creates
> the user in the database). If I try to give the user database access with
> the old user still in the database, it will give me an error indicating
> that the user already exists.
> The reason for this is I didn't create the database and the users and was
> hoping to associate the user's to the obvious logins to avoid changing any
> permissions or roles by accident or omission. Using the existing user
> would keep the same configuration for that user.
> Thank you,
> Gary
>|||HI,
Execute the below command:-
Use dbname
go
sp_change_users_login 'update_one','login_name','User_name'
Thanks
Hari
SQL Server MVP
"Gary" <tuffboystl@.hotmail.com> wrote in message
news:OdGnkRJsFHA.912@.TK2MSFTNGP11.phx.gbl...
> Is there a way to associate an existing user in a database to an existing
> SQL Server login?
> This is SQL Server 2000.
> I've restored a database from a backup and when I look at the users, the
> users which were there before don't have a Login Name associated with
> them. The only way I found to associate it is to delete the user and go to
> the login to give that user database access (which automatically creates
> the user in the database). If I try to give the user database access with
> the old user still in the database, it will give me an error indicating
> that the user already exists.
> The reason for this is I didn't create the database and the users and was
> hoping to associate the user's to the obvious logins to avoid changing any
> permissions or roles by accident or omission. Using the existing user
> would keep the same configuration for that user.
> Thank you,
> Gary
>

Associate User to Login

Is there a way to associate an existing user in a database to an existing
SQL Server login?
This is SQL Server 2000.
I've restored a database from a backup and when I look at the users, the
users which were there before don't have a Login Name associated with them.
The only way I found to associate it is to delete the user and go to the
login to give that user database access (which automatically creates the
user in the database). If I try to give the user database access with the
old user still in the database, it will give me an error indicating that the
user already exists.
The reason for this is I didn't create the database and the users and was
hoping to associate the user's to the obvious logins to avoid changing any
permissions or roles by accident or omission. Using the existing user would
keep the same configuration for that user.
Thank you,
GaryThis is what sp_change_users_login is for.
Or transfer the logins properly in the first place using sp_help_revlogin (s
earch KB for this).
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
Blog: http://solidqualitylearning.com/blogs/tibor/
"Gary" <tuffboystl@.hotmail.com> wrote in message news:OdGnkRJsFHA.912@.TK2MSFTNGP11.phx.gbl..
.
> Is there a way to associate an existing user in a database to an existing
> SQL Server login?
> This is SQL Server 2000.
> I've restored a database from a backup and when I look at the users, the
> users which were there before don't have a Login Name associated with them
.
> The only way I found to associate it is to delete the user and go to the
> login to give that user database access (which automatically creates the
> user in the database). If I try to give the user database access with the
> old user still in the database, it will give me an error indicating that t
he
> user already exists.
> The reason for this is I didn't create the database and the users and was
> hoping to associate the user's to the obvious logins to avoid changing any
> permissions or roles by accident or omission. Using the existing user wou
ld
> keep the same configuration for that user.
> Thank you,
> Gary
>|||You can use sp_change_users_login to change the login/user mapping. See the
Books Online for usage details.
Hope this helps.
Dan Guzman
SQL Server MVP
"Gary" <tuffboystl@.hotmail.com> wrote in message
news:OdGnkRJsFHA.912@.TK2MSFTNGP11.phx.gbl...
> Is there a way to associate an existing user in a database to an existing
> SQL Server login?
> This is SQL Server 2000.
> I've restored a database from a backup and when I look at the users, the
> users which were there before don't have a Login Name associated with
> them. The only way I found to associate it is to delete the user and go to
> the login to give that user database access (which automatically creates
> the user in the database). If I try to give the user database access with
> the old user still in the database, it will give me an error indicating
> that the user already exists.
> The reason for this is I didn't create the database and the users and was
> hoping to associate the user's to the obvious logins to avoid changing any
> permissions or roles by accident or omission. Using the existing user
> would keep the same configuration for that user.
> Thank you,
> Gary
>|||HI,
Execute the below command:-
Use dbname
go
sp_change_users_login 'update_one','login_name','User_name'
Thanks
Hari
SQL Server MVP
"Gary" <tuffboystl@.hotmail.com> wrote in message
news:OdGnkRJsFHA.912@.TK2MSFTNGP11.phx.gbl...
> Is there a way to associate an existing user in a database to an existing
> SQL Server login?
> This is SQL Server 2000.
> I've restored a database from a backup and when I look at the users, the
> users which were there before don't have a Login Name associated with
> them. The only way I found to associate it is to delete the user and go to
> the login to give that user database access (which automatically creates
> the user in the database). If I try to give the user database access with
> the old user still in the database, it will give me an error indicating
> that the user already exists.
> The reason for this is I didn't create the database and the users and was
> hoping to associate the user's to the obvious logins to avoid changing any
> permissions or roles by accident or omission. Using the existing user
> would keep the same configuration for that user.
> Thank you,
> Gary
>

Sunday, March 11, 2012

assigning sysadmin rights to login through O-SQL

Hi,
I'm currently using MSDE 2000 & i want to create a server login with
SYSADMIN Rights.
please suggest.If you use a sql server login, you can use:
sp_addlogin 'NewUser','NewSecretPassword'
GO
sp_addsrvrolemember 'NewUser','symin'
HTH, jens Suessmeyer.

Thursday, March 8, 2012

Assigning database level db_owner permission to a SQL Server Login

Hi friends,
I was hoping that somebody out there would be able to help me out
with this one. I am trying to assign a database level db_owner role
permission to a SQL server level login that I have created. I can
easily do this from enterpise manager but I need to be able to script
this process.
The way I do this from enterprise manager in SQL server 2000 is by
going inside the SECURITY FOLDER in the SQL server, then inside
SECURITY I click on LOGINS and within LOGINS I double click on the
login that I created. I get the SQL Server Login Properties which
contains three tabs - GENERAL, SERVER ROLES and DATABASE ACCESS. I
click on the DATABASE ACCESS tab and then select the appropriate
database and then check the db_owner role in the "Permit in Database
Role" window for the selected database.
I need to be able to do this via a script. Any help would be greatly
appreciated.
Thanks!!!(deepchopra1981@.gmail.com) writes:
> I was hoping that somebody out there would be able to help me out
> with this one. I am trying to assign a database level db_owner role
> permission to a SQL server level login that I have created. I can
> easily do this from enterpise manager but I need to be able to script
> this process.
> The way I do this from enterprise manager in SQL server 2000 is by
> going inside the SECURITY FOLDER in the SQL server, then inside
> SECURITY I click on LOGINS and within LOGINS I double click on the
> login that I created. I get the SQL Server Login Properties which
> contains three tabs - GENERAL, SERVER ROLES and DATABASE ACCESS. I
> click on the DATABASE ACCESS tab and then select the appropriate
> database and then check the db_owner role in the "Permit in Database
> Role" window for the selected database.
> I need to be able to do this via a script. Any help would be greatly
> appreciated.
Why not simply use Profiler to spy on Enterprise Manager?
Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se
Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/pr...oads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodin...ions/books.mspx|||On Apr 21, 1:30 pm, Erland Sommarskog <esq...@.sommarskog.se> wrote:
> (deepchopra1...@.gmail.com) writes:
> Why not simply use Profiler to spy on Enterprise Manager?
> --
> Erland Sommarskog,SQLServerMVP, esq...@.sommarskog.se
> Books Online forSQLServer2005 athttp://www.microsoft.com/technet/prodtechn
ol/sql/2005/downloads/books...
> Books Online forSQLServer2000 athttp://www.microsoft.com/sql/prodinfo/prev
iousversions/books.mspx- Hide quoted text -
> - Show quoted text -
Thats a brilliant idea. It helped. Thanks a ton.

Saturday, February 25, 2012

ASPState DB Permissions

I need to find out what the 'Required' permissions on on the ASPState database? We have been granting dbo to the login. Thanks.

I finaly figured out how to do this, I created a database role. and assigned implicit permissions to the stored procedures for the ASPState database. The assigned the owner to be dbo. Then I assigned the custom role to the login that needed access. This way I avoided applying db_owner permissions to the ASPState database for my login.

Friday, February 24, 2012

ASPNETDB relation with my databas

HI!
I have a ASPNETDB as my login databas. but now i want to connect this databas or the aspnet_user table to my table, how do i?
I want to check the username in aspnet_user table and select the same username in my table?

I want to write all sql code in a sql file. so i want to know how i can connect to the sql file from my c# code?

I hope somebody understand me...

Hi sallad88,

I want to write all sql code in a sql file. so i want to know how i can connect to the sql file from my c# code?

Not 100% sure what you mean by this, but if i understand you correct, you can write a stored procedure for this. Since what you want is to "check the username in aspnet_user table and select the same username in my table", you can write your stored procedure like this:

create procedure sp_check_name

as

select * from My_own_table
where Firstnamein

(select username from [asp.net db].dbo.aspnet_users ) // you can access asp.net db this way (specify the database name, schema name, table nameexplicitly)

And in your application, you can bind your sqlcommand to this stored procedure and call executereader function. This will return you desired result set.

Hope my suggestion helps

|||

Yes that was one thing...

And its work fine, I will come back when i can explain the other things better and when iam there in my application...

Thanks for know

ASPNETDB migration

I created a website using Visual web developer express edition (including SQL Express). No the user management section of the site (the login/logout database) was created automatically and SQL Server express was installed at my computer under the instance name of SQLExpress. I uploaded it to my web host and he hooked up the ASPNETDB for me. Now the problem is that ASPNETDB has an id password and I was given theMSSQL Server IP. How do I configure my website to accommodate that? Any help will be extremely useful!!!

you need to modify the connection string in web.config

<connectionStrings>
<remove name="LocalSqlServer"/>
<add name="LocalSqlServer" connectionString="server=server ip;database=ASPNETDB;uid=youUsername;pwd=yourpassword"
providerName="System.Data.SqlClient"/>

</connectionStrings>

|||

WOW! Thats it! Thanks a bunch. One more thing. I am also using the same database to display some data(have added some tables into it manually). What should I put in the connection string to make the connection to the database? Also, can I use a MySQL database instead? If yes, what will be the connection string?

Thanks for your help.

|||

if you don't want to use the same name "LocalSqlServer", then you can add another connection with the same connectionString
like:

<add name="yourConnName" connectionString="server=server ip;database=ASPNETDB;uid=youUsername;pwd=yourpassword"
providerName="System.Data.SqlClient"/>

I am not sure if you can use MySQL as a configuration Database, but you can use it for application database.

Honestly, I didn't use it before. to get the exact connection string for MySQL, try to add a coonection from the wizard and see how vs2005 creates it in web.config

aspnetdb connection string

Hello,
I'm getting up to speed with VS2005 and use SQL Server 2005. I'm using the login control in a test web app.

When I run the app I get this error:

Cannot open database "aspnetdb" requested by the login. The login failed.
Login failed for user 'UserID\ASPNET'.

The connection string I'm using is:

data source=localhost;Integrated Security=SSPI;Initial Catalog=aspnetdb;

The AspNetSqlProvider in the web administration tool connects to the database.

My question is, Is this a connection string issue, and user ID issue, a rights issue or is it something else?

Thanks,

Gaikhe

This is a permission issue on SQL, which indicates theUserID\ASPNETlogin dose not have sufficient permission to perform specific task(access in this case) on theaspnetdb database. You should add database mapping for this account to theaspnetdb database: open ManagementStudio->Explore the SQL instance->Security->Logins->view the properties of theUserID\ASPNETlogin->switch toUser Mapping tab-> add proper mapping and permission to the login.

ASPNET worker process account can't login to Database

Hi,
I'm using .Net Remoting and IIS (5.1) to pull data from a (local for now)
SQL Server 2005 database. My application is failing at the point at which a
connection to the database is being opened.
Using cn as New SqlConnection(ConnectString)
cn.Open()
Causes an SQLException to be thrown. The message is...
Cannot open database "AppData" requested by the login. The login failed.
"Login failed for user '<MachineName>\ASPNET'
This is the ASP.Net worker process user. I have had some problems with this
User Id on this machine - it was originally absent from the machine. I got
it back by re-installing ASP.Net (ver 2.0). Now all my remoting stuff is
working, but I cannot get to the data.
So my question is, what configuration items / permissions in SQL Server
should I set up to give the ASPNet worker process access to my data?.
For now the application, SQL Server Instance, and IIS are all on the same
machine. Everything seems to work except for the login call to the Database
.
Thanks for your help.
BBMHello BBM,
You could add the <Machine Name>\ASPNET user in the SQL Login. After that,
you could grant the proper permission for the account to access the sql
database.
Here is an article you could refer:
Building Secure ASP.NET Applications: Authentication, Authorization, and
Secure Communication
http://msdn2.microsoft.com/en-us/library/aa302387.aspx
Sincerely,
Wei Lu
Microsoft Online Community Support
========================================
==========
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscript...ault.aspx#notif
ications.
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...t/default.aspx.
========================================
==========
(This posting is provided "AS IS", with no warranties, and confers no
rights.)|||Hi Wei Lu,
Thanks for your help. I knew this had to be covered someplace.
BTW, Searching Help in SQL Server, or in Visual Studio on this topic, the
ASP "worker process" account, returns nothing remotely useful.
Thanks again.
BBM
"Wei Lu [MSFT]" wrote:

> Hello BBM,
> You could add the <Machine Name>\ASPNET user in the SQL Login. After that,
> you could grant the proper permission for the account to access the sql
> database.
> Here is an article you could refer:
> Building Secure ASP.NET Applications: Authentication, Authorization, and
> Secure Communication
> http://msdn2.microsoft.com/en-us/library/aa302387.aspx
> Sincerely,
> Wei Lu
> Microsoft Online Community Support
> ========================================
==========
> Get notification to my posts through email? Please refer to
> l]
> ications.
> 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
> [url]http://msdn.microsoft.com/subscriptions/support/default.aspx." target="_blank">http://msdn.microsoft.com/subscript...t/default.aspx.
> ========================================
==========
> (This posting is provided "AS IS", with no warranties, and confers no
> rights.)
>|||Hello BBM,
You could use the MSDN search in the web directly. And you could search for
ASPNET and SQL Server as the key words.
Thanks!
Sincerely,
Wei Lu
Microsoft Online Community Support
========================================
==========
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscript...ault.aspx#notif
ications.
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...t/default.aspx.
========================================
==========
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

ASPNET User

My application attempts to connect to an SQL Server database as name ASPNET
and Login Name SERVERNAME/ASPNET in response to these commands:
SqlConnection myConnection = new SqlConnection("Data Source=(local);Initial
Catalog=MCSCRE;Integrated Security=SSPI");
myConnection.Open();
However, the user of this database is ASPNET. I can't create a user ASPNET
with a login name SERVERNAME/ASPNET, SQL Enterprise Manager always keeps the
name ASPNET but eliminates the login name. How do I create the correct user
so that my application can log in?
Many thanks.
re:
> I can't create a user ASPNET with a login name SERVERNAME/ASPNET
You should be able to.
Are you sure that's not SERVERNAME\ASPNET ?
Notice the difference in the slash's direction.
Other than that, which is probably a typo, you could change
the SQL Server's security to "SQL Server and Windows",
instead of "Windows", create a SQL Server login for your database,
and assign it the permissions you want it to have.
You'd have to change the connection string to use either
the loginname/password you created, or a Trusted Connection.
You'll find this to be helpful :
http://support.microsoft.com/default.aspx?kbid=316989
If the SQL Server is in a different machine that the web server, make sure you read this:
http://weblogs.asp.net/AChang/archiv...15/113866.aspx
(In fact, read that even if your SQL Server is in the same machine as your web server)
Juan T. Llibre, ASP.NET MVP
ASP.NET FAQ : http://asp.net.do/faq/
ASPNETFAQ.COM : http://www.aspnetfaq.com/
Foros de ASP.NET en Espaol : http://asp.net.do/foros/
======================================
"Andrew Chalk" <achalk@.magnacartasoftware.com> wrote in message
news:e0JBuOp6FHA.2608@.tk2msftngp13.phx.gbl...
> My application attempts to connect to an SQL Server database as name ASPNET and Login
> Name SERVERNAME/ASPNET in response to these commands:
> SqlConnection myConnection = new SqlConnection("Data Source=(local);Initial
> Catalog=MCSCRE;Integrated Security=SSPI");
> myConnection.Open();
> However, the user of this database is ASPNET. I can't create a user ASPNET with a login
> name SERVERNAME/ASPNET, SQL Enterprise Manager always keeps the name ASPNET but
> eliminates the login name. How do I create the correct user so that my application can
> log in?
> Many thanks.
>
>
|||You are right that the '/' is a typo. The basic problem is exactly the one
discussed in the Q316989 that you reference below. Following that article I
changed SQL Server's security to "SQL Server and Windows". I created a new
user of my database and modified my application connection string as
follows:
SqlConnection myConnection = new SqlConnection("Data Source=(local);Initial
Catalog=MCSCRE;User ID=Logger;password=admin");
It still fails with the same error. Even the three line test program in
Q316989 fails in the same way. It is as though I need a user for SQL Server,
and then a second one for the database.
Any idea what is going on here?
Many thanks,
Andrew
"Juan T. Llibre" <nomailreplies@.nowhere.com> wrote in message
news:%23Mp1p0q6FHA.2364@.TK2MSFTNGP12.phx.gbl...
> re:
> You should be able to.
> Are you sure that's not SERVERNAME\ASPNET ?
> Notice the difference in the slash's direction.
> Other than that, which is probably a typo, you could change
> the SQL Server's security to "SQL Server and Windows",
> instead of "Windows", create a SQL Server login for your database,
> and assign it the permissions you want it to have.
> You'd have to change the connection string to use either
> the loginname/password you created, or a Trusted Connection.
> You'll find this to be helpful :
> http://support.microsoft.com/default.aspx?kbid=316989
> If the SQL Server is in a different machine that the web server, make sure
> you read this:
> http://weblogs.asp.net/AChang/archiv...15/113866.aspx
> (In fact, read that even if your SQL Server is in the same machine as your
> web server)
>
> Juan T. Llibre, ASP.NET MVP
> ASP.NET FAQ : http://asp.net.do/faq/
> ASPNETFAQ.COM : http://www.aspnetfaq.com/
> Foros de ASP.NET en Espaol : http://asp.net.do/foros/
> ======================================
> "Andrew Chalk" <achalk@.magnacartasoftware.com> wrote in message
> news:e0JBuOp6FHA.2608@.tk2msftngp13.phx.gbl...
>
|||re:
> SqlConnection myConnection = new SqlConnection("Data Source=(local);
> Initial Catalog=MCSCRE;User ID=Logger;password=admin");
I've had problems connecting when I use (local) for the SQL Server's name.
Check and see what the real name of your SQL Server instance is,
and use *that* name in your connection.
To check the instance name of your SQL Server, double-click the
SQL Server Service Manager icon in your taskbar, or open the
"Service Manager" app in the "Start Menu", "Programs",
"Microsoft SQL Server" start menu menu group.
The "Server" textbox will tell you the real name for your SQL Server instance.
Try using *that name* in your connection string, instead of (local).
Juan T. Llibre, ASP.NET MVP
ASP.NET FAQ : http://asp.net.do/faq/
ASPNETFAQ.COM : http://www.aspnetfaq.com/
Foros de ASP.NET en Espaol : http://asp.net.do/foros/
======================================
"Andrew Chalk" <achalk@.magnacartasoftware.com> wrote in message
news:%23pmINWv6FHA.2524@.TK2MSFTNGP10.phx.gbl...
> You are right that the '/' is a typo. The basic problem is exactly the one discussed in
> the Q316989 that you reference below. Following that article I changed SQL Server's
> security to "SQL Server and Windows". I created a new user of my database and modified
> my application connection string as follows:
> SqlConnection myConnection = new SqlConnection("Data Source=(local);Initial
> Catalog=MCSCRE;User ID=Logger;password=admin");
> It still fails with the same error. Even the three line test program in Q316989 fails in
> the same way. It is as though I need a user for SQL Server, and then a second one for
> the database.
> Any idea what is going on here?
> Many thanks,
> Andrew
>
> "Juan T. Llibre" <nomailreplies@.nowhere.com> wrote in message
> news:%23Mp1p0q6FHA.2364@.TK2MSFTNGP12.phx.gbl...
>
|||The latest saga..
Instead of a new user for my database and loging in as him I logged in as
'sa' (the deafult SQL user) from my app. That works!
Is it the case that my ap. was failing to log in to SQL server, rather than
inot my database? Obviously, I am new to SQL Server authentication and it is
proving counter intuitive to me.
Thanks,
Andrew
"Juan T. Llibre" <nomailreplies@.nowhere.com> wrote in message
news:ebqeMev6FHA.476@.TK2MSFTNGP15.phx.gbl...
> re:
> I've had problems connecting when I use (local) for the SQL Server's name.
> Check and see what the real name of your SQL Server instance is,
> and use *that* name in your connection.
> To check the instance name of your SQL Server, double-click the
> SQL Server Service Manager icon in your taskbar, or open the
> "Service Manager" app in the "Start Menu", "Programs",
> "Microsoft SQL Server" start menu menu group.
> The "Server" textbox will tell you the real name for your SQL Server
> instance.
> Try using *that name* in your connection string, instead of (local).
>
>
> Juan T. Llibre, ASP.NET MVP
> ASP.NET FAQ : http://asp.net.do/faq/
> ASPNETFAQ.COM : http://www.aspnetfaq.com/
> Foros de ASP.NET en Espaol : http://asp.net.do/foros/
> ======================================
> "Andrew Chalk" <achalk@.magnacartasoftware.com> wrote in message
> news:%23pmINWv6FHA.2524@.TK2MSFTNGP10.phx.gbl...
>
|||re:
> Instead of a new user for my database and loging in as him I logged in as 'sa' (the
> default SQL user) from my app. That works!
That explains a lot.
The "sa" user has read/write permissions to *all* SQL Server's databases.
Your problem is *not* the login, but that the user your connection is trying
to *login as* doesn't have permissions to the objects for the database you're
trying to use.
Add the login you want to use to SQL Server and then add that user to your
database's users, and then assign permissions for that database's objects to
your new user.
This is an object-by-object assignment.
Make sure that all the relevant permissions to all needed objects are assigned.
Then, you should have no problem with that new user accessing your db.
Juan T. Llibre, ASP.NET MVP
ASP.NET FAQ : http://asp.net.do/faq/
ASPNETFAQ.COM : http://www.aspnetfaq.com/
Foros de ASP.NET en Espaol : http://asp.net.do/foros/
======================================
"Andrew Chalk" <achalk@.magnacartasoftware.com> wrote in message
news:OGEi5rv6FHA.3876@.TK2MSFTNGP09.phx.gbl...
> The latest saga..
> Instead of a new user for my database and loging in as him I logged in as 'sa' (the
> deafult SQL user) from my app. That works!
> Is it the case that my ap. was failing to log in to SQL server, rather than inot my
> database? Obviously, I am new to SQL Server authentication and it is proving counter
> intuitive to me.
> Thanks,
> Andrew
> "Juan T. Llibre" <nomailreplies@.nowhere.com> wrote in message
> news:ebqeMev6FHA.476@.TK2MSFTNGP15.phx.gbl...
>
|||That is exactly right. The ASP.NET runs at a lower privilege level.
I followed your steps and the new user, with restricted rights, is accessing
the database fine.
Now, if only I could find out how the ASP.NET user's rights could be
upgraded so that I can use integrated security.
Many thanks for your help!
Andrew
"Juan T. Llibre" <nomailreplies@.nowhere.com> wrote in message
news:e9I6izv6FHA.2600@.tk2msftngp13.phx.gbl...
> re:
> That explains a lot.
> The "sa" user has read/write permissions to *all* SQL Server's databases.
> Your problem is *not* the login, but that the user your connection is
> trying
> to *login as* doesn't have permissions to the objects for the database
> you're
> trying to use.
> Add the login you want to use to SQL Server and then add that user to your
> database's users, and then assign permissions for that database's objects
> to
> your new user.
> This is an object-by-object assignment.
> Make sure that all the relevant permissions to all needed objects are
> assigned.
> Then, you should have no problem with that new user accessing your db.
>
> Juan T. Llibre, ASP.NET MVP
> ASP.NET FAQ : http://asp.net.do/faq/
> ASPNETFAQ.COM : http://www.aspnetfaq.com/
> Foros de ASP.NET en Espaol : http://asp.net.do/foros/
> ======================================
> "Andrew Chalk" <achalk@.magnacartasoftware.com> wrote in message
> news:OGEi5rv6FHA.3876@.TK2MSFTNGP09.phx.gbl...
>

ASPNET User

My application attempts to connect to an SQL Server database as name ASPNET
and Login Name SERVERNAME/ASPNET in response to these commands:
SqlConnection myConnection = new SqlConnection("Data Source=(local);Initial
Catalog=MCSCRE;Integrated Security=SSPI");
myConnection.Open();
However, the user of this database is ASPNET. I can't create a user ASPNET
with a login name SERVERNAME/ASPNET, SQL Enterprise Manager always keeps the
name ASPNET but eliminates the login name. How do I create the correct user
so that my application can log in?
Many thanks.re:
> I can't create a user ASPNET with a login name SERVERNAME/ASPNET
You should be able to.
Are you sure that's not SERVERNAME\ASPNET ?
Notice the difference in the slash's direction.
Other than that, which is probably a typo, you could change
the SQL Server's security to "SQL Server and Windows",
instead of "Windows", create a SQL Server login for your database,
and assign it the permissions you want it to have.
You'd have to change the connection string to use either
the loginname/password you created, or a Trusted Connection.
You'll find this to be helpful :
http://support.microsoft.com/default.aspx?kbid=316989
If the SQL Server is in a different machine that the web server, make sure y
ou read this:
http://weblogs.asp.net/AChang/archi.../15/113866.aspx
(In fact, read that even if your SQL Server is in the same machine as your w
eb server)
Juan T. Llibre, ASP.NET MVP
ASP.NET FAQ : http://asp.net.do/faq/
ASPNETFAQ.COM : http://www.aspnetfaq.com/
Foros de ASP.NET en Espaol : http://asp.net.do/foros/
======================================
"Andrew Chalk" <achalk@.magnacartasoftware.com> wrote in message
news:e0JBuOp6FHA.2608@.tk2msftngp13.phx.gbl...
> My application attempts to connect to an SQL Server database as name ASPNE
T and Login
> Name SERVERNAME/ASPNET in response to these commands:
> SqlConnection myConnection = new SqlConnection("Data Source=(local);Initia
l
> Catalog=MCSCRE;Integrated Security=SSPI");
> myConnection.Open();
> However, the user of this database is ASPNET. I can't create a user ASPNET
with a login
> name SERVERNAME/ASPNET, SQL Enterprise Manager always keeps the name ASPNE
T but
> eliminates the login name. How do I create the correct user so that my app
lication can
> log in?
> Many thanks.
>
>|||You are right that the '/' is a typo. The basic problem is exactly the one
discussed in the Q316989 that you reference below. Following that article I
changed SQL Server's security to "SQL Server and Windows". I created a new
user of my database and modified my application connection string as
follows:
SqlConnection myConnection = new SqlConnection("Data Source=(local);Initial
Catalog=MCSCRE;User ID=Logger;password=admin");
It still fails with the same error. Even the three line test program in
Q316989 fails in the same way. It is as though I need a user for SQL Server,
and then a second one for the database.
Any idea what is going on here?
Many thanks,
Andrew
"Juan T. Llibre" <nomailreplies@.nowhere.com> wrote in message
news:%23Mp1p0q6FHA.2364@.TK2MSFTNGP12.phx.gbl...
> re:
> You should be able to.
> Are you sure that's not SERVERNAME\ASPNET ?
> Notice the difference in the slash's direction.
> Other than that, which is probably a typo, you could change
> the SQL Server's security to "SQL Server and Windows",
> instead of "Windows", create a SQL Server login for your database,
> and assign it the permissions you want it to have.
> You'd have to change the connection string to use either
> the loginname/password you created, or a Trusted Connection.
> You'll find this to be helpful :
> http://support.microsoft.com/default.aspx?kbid=316989
> If the SQL Server is in a different machine that the web server, make sure
> you read this:
> http://weblogs.asp.net/AChang/archi.../15/113866.aspx
> (In fact, read that even if your SQL Server is in the same machine as your
> web server)
>
> Juan T. Llibre, ASP.NET MVP
> ASP.NET FAQ : http://asp.net.do/faq/
> ASPNETFAQ.COM : http://www.aspnetfaq.com/
> Foros de ASP.NET en Espaol : http://asp.net.do/foros/
> ======================================
> "Andrew Chalk" <achalk@.magnacartasoftware.com> wrote in message
> news:e0JBuOp6FHA.2608@.tk2msftngp13.phx.gbl...
>|||re:
> SqlConnection myConnection = new SqlConnection("Data Source=(local);
> Initial Catalog=MCSCRE;User ID=Logger;password=admin");
I've had problems connecting when I use (local) for the SQL Server's name.
Check and see what the real name of your SQL Server instance is,
and use *that* name in your connection.
To check the instance name of your SQL Server, double-click the
SQL Server Service Manager icon in your taskbar, or open the
"Service Manager" app in the "Start Menu", "Programs",
"Microsoft SQL Server" start menu menu group.
The "Server" textbox will tell you the real name for your SQL Server instanc
e.
Try using *that name* in your connection string, instead of (local).
Juan T. Llibre, ASP.NET MVP
ASP.NET FAQ : http://asp.net.do/faq/
ASPNETFAQ.COM : http://www.aspnetfaq.com/
Foros de ASP.NET en Espaol : http://asp.net.do/foros/
======================================
"Andrew Chalk" <achalk@.magnacartasoftware.com> wrote in message
news:%23pmINWv6FHA.2524@.TK2MSFTNGP10.phx.gbl...
> You are right that the '/' is a typo. The basic problem is exactly the one
discussed in
> the Q316989 that you reference below. Following that article I changed SQL
Server's
> security to "SQL Server and Windows". I created a new user of my database
and modified
> my application connection string as follows:
> SqlConnection myConnection = new SqlConnection("Data Source=(local);Initia
l
> Catalog=MCSCRE;User ID=Logger;password=admin");
> It still fails with the same error. Even the three line test program in Q3
16989 fails in
> the same way. It is as though I need a user for SQL Server, and then a sec
ond one for
> the database.
> Any idea what is going on here?
> Many thanks,
> Andrew
>
> "Juan T. Llibre" <nomailreplies@.nowhere.com> wrote in message
> news:%23Mp1p0q6FHA.2364@.TK2MSFTNGP12.phx.gbl...
>|||The latest saga..
Instead of a new user for my database and loging in as him I logged in as
'sa' (the deafult SQL user) from my app. That works!
Is it the case that my ap. was failing to log in to SQL server, rather than
inot my database? Obviously, I am new to SQL Server authentication and it is
proving counter intuitive to me.
Thanks,
Andrew
"Juan T. Llibre" <nomailreplies@.nowhere.com> wrote in message
news:ebqeMev6FHA.476@.TK2MSFTNGP15.phx.gbl...
> re:
> I've had problems connecting when I use (local) for the SQL Server's name.
> Check and see what the real name of your SQL Server instance is,
> and use *that* name in your connection.
> To check the instance name of your SQL Server, double-click the
> SQL Server Service Manager icon in your taskbar, or open the
> "Service Manager" app in the "Start Menu", "Programs",
> "Microsoft SQL Server" start menu menu group.
> The "Server" textbox will tell you the real name for your SQL Server
> instance.
> Try using *that name* in your connection string, instead of (local).
>
>
> Juan T. Llibre, ASP.NET MVP
> ASP.NET FAQ : http://asp.net.do/faq/
> ASPNETFAQ.COM : http://www.aspnetfaq.com/
> Foros de ASP.NET en Espaol : http://asp.net.do/foros/
> ======================================
> "Andrew Chalk" <achalk@.magnacartasoftware.com> wrote in message
> news:%23pmINWv6FHA.2524@.TK2MSFTNGP10.phx.gbl...
>|||re:
> Instead of a new user for my database and loging in as him I logged in as
'sa' (the
> default SQL user) from my app. That works!
That explains a lot.
The "sa" user has read/write permissions to *all* SQL Server's databases.
Your problem is *not* the login, but that the user your connection is trying
to *login as* doesn't have permissions to the objects for the database you'r
e
trying to use.
Add the login you want to use to SQL Server and then add that user to your
database's users, and then assign permissions for that database's objects to
your new user.
This is an object-by-object assignment.
Make sure that all the relevant permissions to all needed objects are assign
ed.
Then, you should have no problem with that new user accessing your db.
Juan T. Llibre, ASP.NET MVP
ASP.NET FAQ : http://asp.net.do/faq/
ASPNETFAQ.COM : http://www.aspnetfaq.com/
Foros de ASP.NET en Espaol : http://asp.net.do/foros/
======================================
"Andrew Chalk" <achalk@.magnacartasoftware.com> wrote in message
news:OGEi5rv6FHA.3876@.TK2MSFTNGP09.phx.gbl...
> The latest saga..
> Instead of a new user for my database and loging in as him I logged in as
'sa' (the
> deafult SQL user) from my app. That works!
> Is it the case that my ap. was failing to log in to SQL server, rather tha
n inot my
> database? Obviously, I am new to SQL Server authentication and it is provi
ng counter
> intuitive to me.
> Thanks,
> Andrew
> "Juan T. Llibre" <nomailreplies@.nowhere.com> wrote in message
> news:ebqeMev6FHA.476@.TK2MSFTNGP15.phx.gbl...
>|||That is exactly right. The ASP.NET runs at a lower privilege level.
I followed your steps and the new user, with restricted rights, is accessing
the database fine.
Now, if only I could find out how the ASP.NET user's rights could be
upgraded so that I can use integrated security.
Many thanks for your help!
Andrew
"Juan T. Llibre" <nomailreplies@.nowhere.com> wrote in message
news:e9I6izv6FHA.2600@.tk2msftngp13.phx.gbl...
> re:
> That explains a lot.
> The "sa" user has read/write permissions to *all* SQL Server's databases.
> Your problem is *not* the login, but that the user your connection is
> trying
> to *login as* doesn't have permissions to the objects for the database
> you're
> trying to use.
> Add the login you want to use to SQL Server and then add that user to your
> database's users, and then assign permissions for that database's objects
> to
> your new user.
> This is an object-by-object assignment.
> Make sure that all the relevant permissions to all needed objects are
> assigned.
> Then, you should have no problem with that new user accessing your db.
>
> Juan T. Llibre, ASP.NET MVP
> ASP.NET FAQ : http://asp.net.do/faq/
> ASPNETFAQ.COM : http://www.aspnetfaq.com/
> Foros de ASP.NET en Espaol : http://asp.net.do/foros/
> ======================================
> "Andrew Chalk" <achalk@.magnacartasoftware.com> wrote in message
> news:OGEi5rv6FHA.3876@.TK2MSFTNGP09.phx.gbl...
>

Sunday, February 19, 2012

asp:login / ASP.NET Configuration menu / & login DB

All,

I may have bitten off a bit much here, but here goes. I'm trying to learn ASP.NET while at the same time learning SQL 2005. I have two machines. One is running Visual Studio 2005 and SQL 2005 Express. The other is my "production" box which is running VWD 2005 and SQL 2005 Standard. I picked up some WROX books and began learning. So far so good until about half way through the book on ASP (keep in mind I haven't learned SQL yet). I learned that I can use the ASP.NET configuration menu to automagically create a database, populate it with users, add them to profiles (groups), and grant them rights to pages. This was kind of neat and it worked fine on my dev box. So I looked up in my SQL book how to detach a DB, copy it over to the other machine and re-attach it. So I copied the whole web site (DB and all, under APP DATA) to the other machine and reattached it. This seemed to go well, however when I tried to log in I recieved an error.

***error

An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified)

After doing some hunting around I discovered that I'm supposed to have a connection string. I checked my web.config file and the only thing I find there is

<

appSettings/>

<

connectionStrings/>

<

system.web>

As you can see this doesn't point to a database which the docs I found say is how you connect to them. Apparently one error someone can run into is between expree and SQL where you have to change the connection string. Well, it's not in the web.config. So I checked the default and login page (and code behind files), but found nothing. So, I'm at a loss. I have no idea where the problem is or where to go from here. Any assistance will be appreciated. While I'm enjoying the journey of learning this, the road seems to be kind of bumpy.

Thanks in advance - Stephen

Hi Stephen,

to change default connection string in web.config you can remove and add new one it's name LocalSqlServer like..

<connectionStrings>
<removename="LocalSqlServer"/>
<addname="LocalSqlServer"connectionString="your connection string..."/>
</connectionStrings>

and give look at this article aboutMembership you will find also how to config Membership

I hope this help

Sunday, February 12, 2012

ASP.NET Authentication for SQL Reporting

Anyone have any good examples on how to have an ASP.NET page login to the ReportingServer to view a report without passing the authentication onto the user?

I've been attempting to use the LogonUser method in the reporting web service but I'm not having any luck. I keep getting "Unauthorized" errors... Doh!

Thanks,my app had its own set of users and my requirement was that once the user logs into the app he shouldnt have to login to report server again to view a report..so I just copied the code from login.aspx in the Pages folder and in a sep aspx page and do both the authentications in the same page and after the authentication redirect to my app instead of folder.aspx...so when the user requests a report he is not prompted for the user name..dont know what you are trying to do is similar to what I did.|||Yea, that's what I'm talking about. However, the reports are protected via IIS, so I've been trying to use the LogonUser method of the ReportingService webservice but I haven't had any luck.|||

Can you share your code?

The code to log in the web service in vb is below

rs.Credentials =New NetworkCredential("user name", "password", "domain")

Additional info can be found athttp://devx.icpconline.com/Default.aspx?PageContentID=19&tabid=147