Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
rajkblr79
Starting Member
1 Post |
Posted - 2011-02-10 : 16:24:28
|
I need to know is there anyway we can create a user id, which will be accessbile only through my application siting in iis, not through any other way. Even through SQL Management studio the user id should not able to login.only through application the user id should allow to login |
|
Lumbago
Norsk Yak Master
3271 Posts |
Posted - 2011-02-11 : 04:19:02
|
Well...you can do it with a DDL trigger, there is an event for logons:http://msdn.microsoft.com/en-us/library/ms189799.aspx#CodeSpippet7- LumbagoMy blog-> http://thefirstsql.com/2011/02/07/regular-expressions-advanced-string-matching-and-new-split-function-sql-server-2008-r2/ |
 |
|
Lumbago
Norsk Yak Master
3271 Posts |
Posted - 2011-02-11 : 04:26:02
|
This would probably work (untested):CREATE TRIGGER dropDisallowedLoginsON DATABASEFOR LOGONASBEGINIF ORIGINAL_LOGIN()= 'myIISlogin' AND CHARINDEX('IIS', APP_NAME()) = 0 --> You need to change "IIS" to the actual APP_NAME ROLLBACK;END - LumbagoMy blog-> http://thefirstsql.com/2011/02/07/regular-expressions-advanced-string-matching-and-new-split-function-sql-server-2008-r2/ |
 |
|
|
|
|