|
Yes, inserting or updating a lot of records will take a lot of time, particularly if running other queries concurrently against the same records (which may temporarily block your updates due to locks). ADO.NET stops your application from being blocked forever by imposing a configurable command timeout, which you set in the SqlCommand's CommandTimeout property. It defaults to 30 seconds, so if your command takes more than 30 seconds to execute you get a SqlException.
Management Studio assumes you're more interested in the results than in a speedy response and doesn't time out.
DoEvents : Generating unexpected recursion since 1991
|
|
|
|
|
Mike Dimmick wrote: Yes, inserting or updating a lot of records will take a lot of time, particularly if running other queries concurrently against the same records
Thanks on your views Mike. I will now need to figure out a way to fine tune my proc.
Mike Dimmick wrote: Management Studio assumes you're more interested in the results than in a speedy response and doesn't time out
Do we have any settings / system procs that will take care of the time-out issue in Sql Server 2000?
|
|
|
|
|
Hi All
Background
----------
I have a database table namely tblSection that stores sections that have parent child relationships e.g.
Section 1
|
|--Section 2
|
|--Section 3
| |
| |--Section 4
|
|--Section 5
|
Section 6
The column structure for this table is:
SectionGUID uniqueidentifier PK
ParentGUID uniqueidentifier ALLOW NULL
Title nvarchar(100)
So my root level records are anything where ParentGUID IS NULL and the remaining records can have variable levels of nested children.
My Problem
----------
So what would people suggest with regards handling this structure within SQL for example a typical request is to return all sections below a specific node within the hierarchy? Currently I deal with the scenarios I have by extracting all folders into a single System.Data.DataTable object and then traverse the tree within my code which is OK for certain types of process but now I am looking at more number crunching type processes that approach is slow and cumbersome
Thanks in advance
Andy
|
|
|
|
|
In SQL Server 2005, you can use Common Table Expressions[^] to perform recursive operations.
Paul Marfleet
"No, his mind is not for rent
To any God or government"
Tom Sawyer - Rush
|
|
|
|
|
|
hi,
in my database i have the two tables...
1)programs 2)reserved
in the programs...two fields 1)program id 2)maxseats................these details wil be entered by admin
in the reserved table two fileds ..1)PRogramid 2)status
my requirement is .. i need the available seats..means
if any body is intersted in any program...they wil select the program...then status becomes approved(1)..
then i need the o/p as available seats ..means if any body selects the program...then the maxseats should be decremented by 1...o/p should be the remaing seats..
|
|
|
|
|
I sincerely hope that you are not asking for code. Let us know what you've tried and where is that you got stuck with.
beklo.com/rameshgoudd wrote: Subject:Re: sql,query very urgent
I am afraid that you are going to be taken in for a chance.
|
|
|
|
|
hi,
'
i need to count how many seats are filled up ..and how many seats are there at to be filled..
i am unable to write the query for this yyar
|
|
|
|
|
What prevents you from using a simple count(*) on the table with the where clause querying an appropriate approved status value?
Have you tried it first?
Vasudevan Deepak Kumar
Personal Homepage Tech Gossips
A pessimist sees only the dark side of the clouds, and mopes; a philosopher sees both sides, and shrugs; an optimist doesn't see the clouds at all - he's walking on them. --Leonard Louis Levinson
|
|
|
|
|
beklo.com/rameshgoudd wrote: very urgent
Please desist from using such words like 'Urgent' or 'Please help'. Read this first:
http://www.codeproject.com/scrapbook/forumguidelines.asp[^]
Vasudevan Deepak Kumar
Personal Homepage Tech Gossips
A pessimist sees only the dark side of the clouds, and mopes; a philosopher sees both sides, and shrugs; an optimist doesn't see the clouds at all - he's walking on them. --Leonard Louis Levinson
|
|
|
|
|
I took a screenshot of my select statement source code via mysql, I need to know how to exit this prompt and get back to the regular ( mysql> ) prompt. For some reason the sql statement did not run, and i am stuck in some secondary type prompt.
I posted this question a week ago, and the suggestions were to use a semicolon, well that is quite obvious and one of the first things i did, no-go.
or the following link will take you to screenshot.
SS
|
|
|
|
|
Did you try "go" without the quotes?
Take care,
Tom
-----------------------------------------------
Check out my blog at http://tjoe.wordpress.com
|
|
|
|
|
One of your quotes is the wrong way round ("` " should be "' ").
|
|
|
|
|
Im trying to load a Crystal Report I've made in Visual Studio to a Crystal Report Viewer on my form. I used the "database expert" to add the connection (ODBC RDO) to my Access 2007 database. The database has no password on it. The Visual Studio field explorer detects all the fields correctly from my command ( SELECT * FROM Table1; ) so I know it can connect to the databse.
The problem is when I run the program I get prompted for the Logon ID and Password with "Logon Failed. Please Try Again." every time I type something in (or dont type anything in). Again there is no password on this DB. There is no reason this prompt to appear since there is no need for logon info to make this connection.
All of my code VB (this is a test project)
Imports CrystalDecisions.CrystalReports.Engine
Form Load:
Dim crpt As New ReportDocument()
Dim rPath As String = "C:\CrystalReport1.rpt"
crpt.Load(rPath)
CrystalReportViewer1.ReportSource = crpt
Does anyone know how to prevent the Login ID and password prompt from being displayed for the connection?
All suggerstions are greatly appreciated
-- modified at 18:07 Thursday 29th November, 2007
|
|
|
|
|
Is there something buried in the CrystalReport1.rpt file that is wanting you to log in?
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
|
|
|
|
|
This is a simple test program I made becuase I was having the same issue with a project Im working on. I decided to make this test program to rule out some causes of this connection failure. The only thing this report does is display the two columns from my Access 07 databse.
|
|
|
|
|
I wish I could help you out further, but only thing I can think of is that it must be something on the Crystal Reports end. It's been a fair while since I've tackled CR, so my apologies
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
|
|
|
|
|
|
Read it into a stream and go from there.
|
|
|
|
|
I need to be able to do this within a stored procedure though. Sorry, I forgot to mention that before.
|
|
|
|
|
I've been given the task of fixing potential (and exploited) SQL-injection errors in an existing ASP (not ASP.NET) project.
I can get the following code to execute (no parameters, no concatenation):
<br />
connString = "Driver={SQL Native Client};Server=server;Database=ACCT;Trusted_Connection=yes;"<br />
Set objConn = Server.CreateObject("ADODB.Connection")<br />
objConn.Open connString<br />
<br />
query = "SELECT SystemCode, SystemName FROM tblSystem WHERE Year = 5"<br />
Set cmd = Server.CreateObject("ADODB.Command")<br />
cmd.CommandText = query<br />
cmd.ActiveConnection = objConn<br />
Set rs = cmd.Execute<br />
However, when I try to convert it to use a parameter, I get an error on the cmd.CreateParameter line of
"ADODB.Command (0x800A0BB9) Arguments are of the wrong type, are out of acceptable range, or are in conflict with one another."
<br />
query = "SELECT SystemCode, SystemName FROM tblSystem WHERE Year = @YEAR"<br />
Set cmd = Server.CreateObject("ADODB.Command")<br />
cmd.CommandText = query<br />
<br />
cmd.Parameters.Append cmd.CreateParameter("@YEAR", adInteger, adParamInput, ,5)<br />
cmd.ActiveConnection = objConn<br />
Set rs = cmd.Execute<br />
Any idea how I can make this work, preferably quickly and easily?
Thanks.
--G
|
|
|
|
|
Hi Glen
What data-type is the Year column? If it is "smallint" then you should use adSmallint.
Regards
Andy
|
|
|
|
|
I think the type is wrong on your parameter, you should be using dbtype.int or SQLdbType.int32
|
|
|
|
|
I am using SQL server 2k, can any one please tell me the length param of data type binary. I have checked it from MSDN http://msdn2.microsoft.com/en-us/library/ms188362.aspx[^]
binary [ ( n ) ]
Fixed-length binary data with a length of n bytes, where n is a value from 1 through 8,000. The storage size is n bytes.
Does that mean that SQL server doesn't store data/image larger than 8 kb.
Best Regards,
Mushq
Mushtaque Ahmed Nizamani
Software Engineer
Ultimus Pakistan
|
|
|
|
|