Click here to Skip to main content
15,891,136 members
Home / Discussions / Database
   

Database

 
GeneralRe: Want to know DBMS i am using from Connection. Pin
SanketMistry17-May-07 22:15
SanketMistry17-May-07 22:15 
Questioncalling stored procedure inside a insert statement Pin
joemonvarghese17-May-07 19:29
joemonvarghese17-May-07 19:29 
AnswerRe: calling stored procedure inside a insert statement Pin
gauthee17-May-07 19:51
gauthee17-May-07 19:51 
AnswerRe: calling stored procedure inside a insert statement Pin
andyharman17-May-07 22:24
professionalandyharman17-May-07 22:24 
QuestionHow to retrieve value from query string using javascript Pin
DineshSharmain17-May-07 18:52
DineshSharmain17-May-07 18:52 
AnswerRe: How to retrieve value from query string using javascript Pin
gauthee17-May-07 19:52
gauthee17-May-07 19:52 
AnswerRe: How to retrieve value from query string using javascript Pin
koolprasad200317-May-07 20:00
professionalkoolprasad200317-May-07 20:00 
QuestionT-SQL Stored Pro Help [modified] Pin
Hulicat17-May-07 13:58
Hulicat17-May-07 13:58 
I have the following stored procedure that works except that the "print" does display on the page when the "IF" condition is met...it shows up as a message when run from Query analyzer but not when the stored procedure is called.

Can anyone tell me what is wrong with my print? I have tried a few things with no success just errors. the solutions I saw in books online did not work for me.


here is the stored procedure:







(
@ticketid as varchar(20)
)
AS


Declare @Technician as varchar (40)
declare @count int

set @count=(Select count(*) from job_ticket WHERE job_ticket.job_ticket_id =Cast
(@ticketid as varchar (20))
and status_type_id like '[1-2]')
if @count =0 print 'there are no open tickets'


set @Technician=(SELECT email


FROM dbo.tech INNER JOIN dbo.job_ticket ON tech.client_id =
job_ticket.assigned_tech_id WHERE job_ticket.job_ticket_id =Cast
(@ticketid as varchar (20)))


SELECT job_ticket.job_ticket_id, job_ticket.question_text 'Report', 'Ticket Number', @Technician
'Technician Assigned',job_ticket.subject 'Issue Description',
report_date 'Open Date'
FROM job_ticket WHERE job_ticket.job_ticket_id =Cast
(@ticketid as varchar (20)) and status_type_id like '[1-2]'


-- modified at 20:56 Thursday 17th May, 2007

Regards,
Hulicat

GeneralRe: T-SQL Stored Pro Help Pin
andyharman17-May-07 22:19
professionalandyharman17-May-07 22:19 
GeneralRe: T-SQL Stored Pro Help Pin
Hulicat18-May-07 3:21
Hulicat18-May-07 3:21 
QuestionStored Procedure Question Pin
Brent Lamborn17-May-07 11:06
Brent Lamborn17-May-07 11:06 
AnswerRe: Stored Procedure Question Pin
gauthee17-May-07 19:40
gauthee17-May-07 19:40 
GeneralRe: Stored Procedure Question Pin
Brent Lamborn18-May-07 3:14
Brent Lamborn18-May-07 3:14 
GeneralRe: Stored Procedure Question Pin
Brent Lamborn18-May-07 3:17
Brent Lamborn18-May-07 3:17 
QuestionAdding a new record to a DataSet Pin
Quecumber25617-May-07 10:21
Quecumber25617-May-07 10:21 
AnswerRe: Missing Code Pin
Quecumber25617-May-07 10:24
Quecumber25617-May-07 10:24 
GeneralRe: Missing Code Pin
gauthee17-May-07 20:11
gauthee17-May-07 20:11 
GeneralRe: Missing Code Pin
Quecumber25618-May-07 3:05
Quecumber25618-May-07 3:05 
QuestionHow to convert varchar to int on the view Pin
teddddddddddd17-May-07 9:35
teddddddddddd17-May-07 9:35 
AnswerRe: How to convert varchar to int on the view Pin
Hulicat17-May-07 14:31
Hulicat17-May-07 14:31 
Questionduplicate keys Pin
seemamltn17-May-07 9:23
seemamltn17-May-07 9:23 
AnswerRe: duplicate keys Pin
gauthee17-May-07 19:48
gauthee17-May-07 19:48 
QuestionCompound primary keys in access? Pin
Dan Neely17-May-07 4:20
Dan Neely17-May-07 4:20 
AnswerRe: Compound primary keys in access? Pin
andyharman17-May-07 5:06
professionalandyharman17-May-07 5:06 
Questiondelete query for deleting duplicate rows efficiently Pin
VaibhavTiparadi17-May-07 3:40
VaibhavTiparadi17-May-07 3:40 

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.