Click here to Skip to main content
15,897,371 members
Home / Discussions / Database
   

Database

 
GeneralRe: table normalization Pin
Mycroft Holmes26-Nov-09 12:17
professionalMycroft Holmes26-Nov-09 12:17 
GeneralRe: table normalization [modified] Pin
netJP12L26-Nov-09 5:18
netJP12L26-Nov-09 5:18 
GeneralRe: table normalization Pin
The Man from U.N.C.L.E.26-Nov-09 11:24
The Man from U.N.C.L.E.26-Nov-09 11:24 
GeneralRe: table normalization Pin
Mycroft Holmes26-Nov-09 12:13
professionalMycroft Holmes26-Nov-09 12:13 
QuestionBuilding an SQL Statement in a stored procedure Pin
Paul McGann25-Nov-09 6:32
professionalPaul McGann25-Nov-09 6:32 
AnswerRe: Building an SQL Statement in a stored procedure Pin
Shameel25-Nov-09 7:59
professionalShameel25-Nov-09 7:59 
AnswerRe: Building an SQL Statement in a stored procedure Pin
Shameel25-Nov-09 8:01
professionalShameel25-Nov-09 8:01 
AnswerRe: Building an SQL Statement in a stored procedure Pin
Mycroft Holmes25-Nov-09 13:21
professionalMycroft Holmes25-Nov-09 13:21 
I presume there is a good reason why you are using dynamic SQL, the select statement does not require it!

This will work without dynamic SQL

Set @Surname = @Surname + '%'

SELECT *
FROM tbl_Employee
WHERE tbl_Employee.Department_ID = @Department_ID 
	AND tbl_Employee.Surname LIKE @Surname


As Shameel suggested print the @SQL, copy the result back and try to run it, then fix it so it runs and make the changes to your dynamic sql construct.





GeneralRe: Building an SQL Statement in a stored procedure Pin
Paul McGann25-Nov-09 21:43
professionalPaul McGann25-Nov-09 21:43 
QuestionStart records from Specific Number Pin
Gandalf_TheWhite25-Nov-09 4:04
professionalGandalf_TheWhite25-Nov-09 4:04 
AnswerRe: Start records from Specific Number Pin
Abhijit Jana25-Nov-09 4:36
professionalAbhijit Jana25-Nov-09 4:36 
GeneralRe: Start records from Specific Number Pin
Gandalf_TheWhite25-Nov-09 21:53
professionalGandalf_TheWhite25-Nov-09 21:53 
GeneralRe: Start records from Specific Number Pin
Abhijit Jana25-Nov-09 22:03
professionalAbhijit Jana25-Nov-09 22:03 
AnswerRe: Start records from Specific Number Pin
Shameel25-Nov-09 4:55
professionalShameel25-Nov-09 4:55 
GeneralRe: Start records from Specific Number Pin
Gandalf_TheWhite25-Nov-09 21:56
professionalGandalf_TheWhite25-Nov-09 21:56 
GeneralRe: Start records from Specific Number Pin
Shameel26-Nov-09 4:58
professionalShameel26-Nov-09 4:58 
QuestionSSIS Script Task Pin
David Muir24-Nov-09 23:34
David Muir24-Nov-09 23:34 
AnswerRe: SSIS Script Task Pin
Vimalsoft(Pty) Ltd25-Nov-09 2:28
professionalVimalsoft(Pty) Ltd25-Nov-09 2:28 
Question[Message Deleted] Pin
mobius11100124-Nov-09 5:24
mobius11100124-Nov-09 5:24 
AnswerRe: INSERTING Data From SELECT Pin
Shameel24-Nov-09 7:54
professionalShameel24-Nov-09 7:54 
AnswerRe: [Message Deleted] Pin
dan!sh 24-Nov-09 17:01
professional dan!sh 24-Nov-09 17:01 
QuestionIs it possible to get create/alter/drop scripts from within a SP in SQL server 2005? Pin
Jon_Boy24-Nov-09 4:59
Jon_Boy24-Nov-09 4:59 
AnswerRe: Is it possible to get create/alter/drop scripts from within a SP in SQL server 2005? Pin
David Mujica24-Nov-09 5:31
David Mujica24-Nov-09 5:31 
GeneralRe: Is it possible to get create/alter/drop scripts from within a SP in SQL server 2005? Pin
Jon_Boy24-Nov-09 6:53
Jon_Boy24-Nov-09 6:53 
GeneralRe: Is it possible to get create/alter/drop scripts from within a SP in SQL server 2005? Pin
Mycroft Holmes24-Nov-09 18:15
professionalMycroft Holmes24-Nov-09 18:15 

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.