Click here to Skip to main content
15,885,027 members
Home / Discussions / Database
   

Database

 
Questionbegin tran... commit and stored procedures/functions Pin
blakey4043-Jul-08 0:21
blakey4043-Jul-08 0:21 
AnswerRe: begin tran... commit and stored procedures/functions Pin
DerekFL3-Jul-08 4:52
DerekFL3-Jul-08 4:52 
GeneralRe: begin tran... commit and stored procedures/functions Pin
blakey4043-Jul-08 5:11
blakey4043-Jul-08 5:11 
QuestionUnable to view SQL Report with normal login Pin
Ankur.Bakliwal3-Jul-08 0:09
Ankur.Bakliwal3-Jul-08 0:09 
Questioninstallation Pin
Kissy162-Jul-08 23:50
Kissy162-Jul-08 23:50 
AnswerRe: installation Pin
John_Adams3-Jul-08 5:35
John_Adams3-Jul-08 5:35 
QuestionStored Procedure or Trigger for Autogenerate Colunm Pin
rrrriiizz2-Jul-08 20:45
rrrriiizz2-Jul-08 20:45 
AnswerRe: Stored Procedure or Trigger for Autogenerate Colunm Pin
Mycroft Holmes2-Jul-08 20:56
professionalMycroft Holmes2-Jul-08 20:56 
I am going to assume you are trying to create a key field for your employee, if so then:
DO NOT ADD INTELLIGENCE TO A PRIMARY ID/KEY FIELD, you are doing this by adding the first character of the surname. This is wrong, it should simply be the record identifier, use the surname field for search/sorting NOT the ID field.

Generating an employee number for human consumption (timecards or something) is a different matter. I would put it in the inserting stored procedure (I never use triggers)

Before the insert get the count of existing surnames with the 1st char
Select @N = (count(*) + 1) From Employee where Surname like 'A%' (this fails when the employee changes surnames - gets married and is the reason for the initial comment)
or
Select top 1 employee where ENO like 'A%'
order by ENO desc

Add the text to the ENO field


Never underestimate the power of human stupidity
RAH

GeneralRe: Stored Procedure or Trigger for Autogenerate Colunm Pin
rrrriiizz2-Jul-08 21:34
rrrriiizz2-Jul-08 21:34 
GeneralRe: Stored Procedure or Trigger for Autogenerate Colunm Pin
rrrriiizz3-Jul-08 1:09
rrrriiizz3-Jul-08 1:09 
GeneralRe: Stored Procedure or Trigger for Autogenerate Colunm Pin
Mycroft Holmes4-Jul-08 0:26
professionalMycroft Holmes4-Jul-08 0:26 
GeneralRe: Stored Procedure or Trigger for Autogenerate Colunm Pin
rrrriiizz5-Jul-08 1:35
rrrriiizz5-Jul-08 1:35 
QuestionTrigger with Time Pin
obarahmeh2-Jul-08 20:08
obarahmeh2-Jul-08 20:08 
AnswerRe: Trigger with Time Pin
Mycroft Holmes2-Jul-08 21:00
professionalMycroft Holmes2-Jul-08 21:00 
GeneralRe: Trigger with Time Pin
obarahmeh2-Jul-08 22:50
obarahmeh2-Jul-08 22:50 
QuestionsqlDataReader Execution in a Function Pin
IlseBrase2-Jul-08 18:29
IlseBrase2-Jul-08 18:29 
AnswerRe: sqlDataReader Execution in a Function Pin
Vimalsoft(Pty) Ltd3-Jul-08 4:03
professionalVimalsoft(Pty) Ltd3-Jul-08 4:03 
QuestionSQL image data Pin
nelsonpaixao2-Jul-08 14:02
nelsonpaixao2-Jul-08 14:02 
AnswerRe: SQL image data Pin
Giorgi Dalakishvili2-Jul-08 21:58
mentorGiorgi Dalakishvili2-Jul-08 21:58 
AnswerRe: SQL image data Pin
Hesham Amin2-Jul-08 22:08
Hesham Amin2-Jul-08 22:08 
QuestionConnection-string [modified] Pin
nelsonpaixao2-Jul-08 13:59
nelsonpaixao2-Jul-08 13:59 
AnswerRe: Connection-string Pin
rrrriiizz2-Jul-08 19:31
rrrriiizz2-Jul-08 19:31 
GeneralRe: Connection-string Pin
Mycroft Holmes2-Jul-08 21:12
professionalMycroft Holmes2-Jul-08 21:12 
QuestionOracle instant client Pin
Muammar©2-Jul-08 1:00
Muammar©2-Jul-08 1:00 
QuestionFinaly I Found it. Compare and synchronize SQL Server database structures and data. Pin
dingoishere2-Jul-08 0:12
dingoishere2-Jul-08 0:12 

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.