|
okay so it needed to be created as......
question what does this do as oppsoed to how I had it:
CREATE PROCEDURE dbo.sp_dticket
(
@ticketid as varchar(20)
)
AS
CREATE PROCEDURE dbo.sp_dticket
(
@ticketid as varchar(20)
)
AS
Declare @Technician as varchar (20)
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 'Ticket Number', @Technician
'Technician Assigned',job_ticket.subject 'Issue Description',
report_date 'Open Date',tech_note.note_text 'Work Notes'
FROM job_ticket INNER JOIN dbo.tech_note ON tech_note.job_ticket_Id =
job_ticket.job_ticket_id WHERE job_ticket.job_ticket_id =Cast
(@ticketid as varchar (20))
GO
Regards,
Hulicat
|
|
|
|
|
Dear i it is not necassry to CAST the value if u have int type Value. Query gives the result. if u send me Table structure thean i will solve you clearliry.
Thanks and Have a Nice day
|
|
|
|
|
It kept throwing an error unable to convert varchar to int...even when it was declared as int....so I dropped in the cast and it worked.
I was just wonding what is different about putting the varible in brackets before the "AS"?
It's working correctly; I would just like to better undersrand how
Thanks,
Regards,
Hulicat
|
|
|
|
|
I want to allow users to create filters by typing in a textbox the filter they wish to apply to any particular column. I want to apply the filter as the user types it, and I want to apply it as if the displayed value were a string. For example, if I have data with numbers 0-23 associated with it, and a user types the number 1, all data with numbers 1 or 10-19 should still be displayed. So essentially, I want to apply the filter expression "[ID] LIKE '1%'", but when I do this I get the error "Cannot perform 'Like' operation on System.Int64 and System.String". How can I prevent this error without making the filter string something like "[ID] = 1 OR ([ID] >= 10 AND [ID] < 20) OR ([ID] >= 100 AND [ID] < 200) OR ..." (because that would get out of hand)? Thanks.
-Jeff
|
|
|
|
|
Do not post in multiple forums
|
|
|
|
|
Dear Just Convert the Value Into string in Presentation or coding. and if you used a stored procedure then parameter data type set is nvarchar.
then it is working
|
|
|
|
|
hi all
could i insert an evaluated expression in the isnull function ??
example:
select pag_id ,exp,
temp_col = case when isnull(exp, 0)=1 then 0 else 5+3 end
from page_loc
/*
@ the above query is what i want to do, but the expression inside the
isnull function give a syntax error.
@ exp1 = (select sum(sub_pages_count) from vw_page_loc where pag_lang='en')
@ please ignor the logic
*/
When you get mad...THINK twice that the only advice
Tamimi - Code
|
|
|
|
|
Yes you can! Check out your expression!
If failed again try out the coalesce function.
Gautham
|
|
|
|
|
what is the Difference between this two using datagrid in vb6
Dim rs As New ADODB.Recordset
dim rs new recordset
thanks
Vuyiswa
|
|
|
|
|
No difference.
in first case u give the exact refernce when u dont import ADODB namespace/Class
in other case u import the ADODB and now used recordset
|
|
|
|
|
Thank you man,sory i did not reply earlier, i was in a meeting
Vuyiswa
|
|
|
|
|
hey guys...
is there any way to speed up(force) the database restoring..plz tell me the syntax...
|
|
|
|
|
|
Hi all,
i want to know that "how to write triggers in stored procedures" is it possible? and can we write cursors in stored procedures? if yes then pls send me solution.
Thanks
|
|
|
|
|
declare <cursor_name> cursor for
open cursor_name
while @@fetch_status=0
begin
fetch next from cursor_name into variable_name1,var2......varn
end
If U Get Errors U Will Learn
If U Don't Get Errors U Have Learnt
|
|
|
|
|
Sophia Rekhi wrote: i want to know that "how to write triggers in stored procedures" is it possible?
A trigger is a stored procedure of sorts that is run automatically on an event, such as data being inserted into a table.
I don't understand the benefit of writing one in a stored procedure? I also doubt if it is possible. You could write some dynamic SQL and execute that in order to create a trigger from within a stored procedure, but wouldn't it be better just to write the trigger and be done with it?
|
|
|
|
|
i have 3com router and i have Puplic IP address
Nat is Enabled and i configer it like 81.10.29.106:Defule sqlserver port
how to configer sql clint to creat connection Between sql server and sql clint
and thnx
Ahmed El-Badry
|
|
|
|
|
The Server (or Data Source) component of the connection string should contain the IP address and instance name if applicable and Port number
e.g.
81.10.29.106/MyInstance:1433
If you are running the default instance then just the IP and Port.
NOTE: You must also configure SQL Server to accept TCP/IP connection. And you must ensure that all firewalls between the client and server will allow the traffic through. As exposing a SQL Server directly to the internet is a dangerous thing to do it is not normal practice. Some ISPs may automatically block the ports SQL Server uses.
|
|
|
|
|
Enter the IP Address where u Write the Server name.
and give the some information .
|
|
|
|
|
I am inserting Data from one form into two linked tables but i don't know the sql syntax for such a query, plz send me an example.
yasso
|
|
|
|
|
|
Hi Arun thnx for being interested.
As i told u i want the SQL insert query syntax to insert data into two linked tables.
lets say this is the syntax to insert data into one table
INSERT INTO TABLE1(column1, column2)
VAlUES (x, y)
whats is the syntax to insert data into two linked tables or more.
thanx for ur help
yasso
|
|
|
|
|
Why can't you use 2 separate insert statements?
Regards,
Arun Kumar.A
|
|
|
|
|
i used them but its gave a syntax error. Look this is what am going to do:
I am inserting data from one form into two linked tables "Student" and "Grade" linked together by the Grade_ID column which is a primary key in the Grade table and a forgien key in the Student table. After i insert the data i go to the database to see that the primary key
in the Grade table is inserted and its ok but the forgien key in the student table is still null. How can i link them together so that the forgien key in the Student table can take the same value as that in the grade table.
yasso
|
|
|
|
|
How can you say that the foreign key column will be updated automatically
when the primary key column is updated?
I think you have to use two insert statements like:
insert into Student(GradeID,OthercolumnName) values(GradeValue,OthercolumnValue)
insert into Grade(GradeID,OthercolumnName) values(GradeValue,OthercolumnValue).
Regards,
Arun Kumar.A
|
|
|
|