Click here to Skip to main content
15,884,983 members
Home / Discussions / Database
   

Database

 
AnswerRe: SET NOCOUNT Pin
Luc Pattyn24-Jul-12 6:07
sitebuilderLuc Pattyn24-Jul-12 6:07 
GeneralRe: SET NOCOUNT Pin
Member 348763224-Jul-12 6:21
Member 348763224-Jul-12 6:21 
AnswerRe: SET NOCOUNT Pin
_Amy24-Jul-12 17:36
professional_Amy24-Jul-12 17:36 
AnswerRe: SET NOCOUNT Pin
jschell24-Jul-12 7:16
jschell24-Jul-12 7:16 
QuestionSET NOCOUNT Pin
Member 348763223-Jul-12 22:15
Member 348763223-Jul-12 22:15 
AnswerRe: SET NOCOUNT Pin
Wayne Gaylard23-Jul-12 23:06
professionalWayne Gaylard23-Jul-12 23:06 
GeneralRe: SET NOCOUNT Pin
Member 348763223-Jul-12 23:09
Member 348763223-Jul-12 23:09 
GeneralIncreasing the session existing time in sql server Pin
yousefshokati20-Jul-12 22:29
yousefshokati20-Jul-12 22:29 
Hi .
I want to know how can i increase the session existence time in SQL server. I have a software that uses a connection to SQL server . when it remains idle for some minutes then the new session will be created to SQL server from the application side . This produces me me a big problem . Because i use the connection_Id for auditing the user . in my login table i have applicationID that refers to connection_Id in sys.dm_exec_connections .
when the software authenticates the user , It updates the connection_ID in login table and through this column i can get my user's username in my triggers .
here is the problem
when my software becomes idle , then another connection_id is created and i can not trace my user because i can not reach my user in logins table
this is my login table
CREATE TABLE [dbo].[Logins](
	[LoginUser] [nvarchar](50) NOT NULL ,
	[Password] [nvarchar](50) NOT NULL,
	[IsDefaultPassword] [int] NULL,
	[AppID] [uniqueidentifier] NULL,
 CONSTRAINT [PK_Logins] PRIMARY KEY CLUSTERED 
(
	[LoginUser] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]

and this is my authenticate procedure
CREATE PROCEDURE [dbo].[Authenticate] (@username nvarchar(30) , @password nvarchar(30))
AS
   declare @Authenticated int 
    set @Authenticated = 0
 
   
   select  @Authenticated = 1  
   from Logins l
   where l.LoginUser =@username and l.Password =@password 
   
   if @Authenticated = 1 
     begin;
        declare @AppID uniqueidentifier 
        select @AppID=p.connection_id from sys.dm_exec_connections p 
        where p.session_id = @@SPID 
        update Logins 
        set AppID = @AppID 
        where Logins.LoginUser = @username and Logins.Password = @password
     end; 

   select @Authenticated ,@AppID

AnswerRe: Increasing the session existing time in sql server Pin
Eddy Vluggen21-Jul-12 7:57
professionalEddy Vluggen21-Jul-12 7:57 
GeneralRe: Increasing the session existing time in sql server Pin
jschell21-Jul-12 11:46
jschell21-Jul-12 11:46 
QuestionProblem saving file to MySQL Pin
Jassim Rahma20-Jul-12 21:27
Jassim Rahma20-Jul-12 21:27 
AnswerRe: Problem saving file to MySQL Pin
Eddy Vluggen20-Jul-12 23:22
professionalEddy Vluggen20-Jul-12 23:22 
GeneralRe: Problem saving file to MySQL Pin
Jassim Rahma21-Jul-12 2:33
Jassim Rahma21-Jul-12 2:33 
GeneralRe: Problem saving file to MySQL Pin
Eddy Vluggen21-Jul-12 7:54
professionalEddy Vluggen21-Jul-12 7:54 
GeneralRe: Problem saving file to MySQL Pin
Jassim Rahma21-Jul-12 8:40
Jassim Rahma21-Jul-12 8:40 
GeneralRe: Problem saving file to MySQL Pin
Eddy Vluggen21-Jul-12 9:21
professionalEddy Vluggen21-Jul-12 9:21 
GeneralRe: Problem saving file to MySQL Pin
Jassim Rahma21-Jul-12 9:42
Jassim Rahma21-Jul-12 9:42 
GeneralRe: Problem saving file to MySQL Pin
jschell21-Jul-12 11:48
jschell21-Jul-12 11:48 
GeneralRe: Problem saving file to MySQL Pin
Jassim Rahma21-Jul-12 11:57
Jassim Rahma21-Jul-12 11:57 
GeneralRe: Problem saving file to MySQL Pin
jschell22-Jul-12 6:56
jschell22-Jul-12 6:56 
AnswerRe: Problem saving file to MySQL Pin
Eddy Vluggen21-Jul-12 12:58
professionalEddy Vluggen21-Jul-12 12:58 
GeneralRe: Problem saving file to MySQL Pin
Jassim Rahma22-Jul-12 8:39
Jassim Rahma22-Jul-12 8:39 
GeneralRe: Problem saving file to MySQL Pin
Eddy Vluggen22-Jul-12 10:24
professionalEddy Vluggen22-Jul-12 10:24 
GeneralRe: Problem saving file to MySQL Pin
Jassim Rahma22-Jul-12 10:29
Jassim Rahma22-Jul-12 10:29 
GeneralRe: Problem saving file to MySQL Pin
Eddy Vluggen22-Jul-12 10:42
professionalEddy Vluggen22-Jul-12 10:42 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.