|
Hi Dave, thanks
I have the multiple result sets, but what i'm looking for is the ability to box up multiple DbCommand objects and send them off all in the same query, and return a DbReader with a result set for each of the supplied commands.
-------------------------------
Carrier Bags - 21st Century Tumbleweed.
|
|
|
|
|
Tristan Rhodes wrote: i'm looking for is the ability to box up multiple DbCommand objects and send them off all in the same query, and return a DbReader with a result set for each of the supplied commands.
There's no way to do that. You can only send off each one by itself and get a seperate dbreader for each result.
|
|
|
|
|
I suppose i have a bit of a brain block with databases.
I always get mixed up over what is physicaly fast / slow and what's worth using when, and in what situations. They are a complex beast and i'm trying to cram in as much experience with them as possible. But i still feel there is a fundamentaly different way of handling things depending on the situation, single site web app, distributed web app, client DT application etc. Then there is concurrency and caching, and the nature of the application.
I've only been using databases for about a year and a half, please tell me it gets easier with time / experience
Tris
-------------------------------
Carrier Bags - 21st Century Tumbleweed.
|
|
|
|
|
Tristan Rhodes wrote: please tell me it gets easier with time / experience
Yeah, right!
The point behind solving problems is not to know how to solve the same problem again later. It's learning how to research any problem you encounter. The more you do this, the easier it gets to find an answer to the next problem.
|
|
|
|
|
Hello,
SQL 2005
I have a stored procedure and I am not sure I wrote it correctly to except a parameter of ticketid.
In VS I can see the fields however no data gets passed.
When I select query builder from VS I get an error "unable to parse query text"
I then exceute query and the fields show up with no data.
If I set the Parameter @ticketid to a value it works in SQL Query Analyser.
In the command and editor window in VS-? under parameters I have ticketid value request.querystring ("@ticketid")
Query String Field = @ticketid
here is the stored procedure:
Declare @ticketid as varchar (20)
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))
Am I not passing the varible correctly or is the stored procedure incorrect?
Any help is greatly appreciated; I have been stuck on this for days.
Thanks
Regards,
Hulicat
|
|
|
|
|
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
|
|
|
|