|
nibabug wrote: but it can not be reduced
I guess you tried through enterprise manager right ? Try through query analyzer, you can change it.
|
|
|
|
|
|
i have a problem, that i want to write a function like avg(),count().....
but the parameter i want to pass to the function is a row-name,
for exsample:
i have a table, which includes 1000 values of temperature, i want to calculate the variance of all the 1000 values.
wuhuaiji
|
|
|
|
|
I think this[^] should be helpful.
|
|
|
|
|
Hi everybody,
i save eMails into a table. Easy.
A BLOB Field saves the whole mail including attachments into MIME Format.
Now the problem ... a 5MB JPG-File
So i have a 5MB INSERT Query
I changed already the max_allowed_packet=10M but the connection breaks down each times.
Some programmers sayed me that's possible to add a such query...
Such a huge mail is an exception, normally all mails which should be added
have a size of some KB...
Is it possible to add a 5MB single INSERT query? If yes, how?
Big thanks
|
|
|
|
|
max_allowed_packet was not saved
I changed his value in MySQL Administrator, then via set max_allowed_packet = 10000000; in a SQL-Query
and in the .ini File.
After re-changing these values, it worked
Now i can add those huge inserts easily
|
|
|
|
|
Will you recommend the usage of temporary tables in a SQL server database ? AFAIK, it boosts the performance. But recently I read one article in SQL Server performance.com[^] which confused me. Any insights on this would be helpful ?
|
|
|
|
|
I have also read that temporary tables can slow performance.
In my experience however - if you do not go overboard in terms of how many rows you load into a temporary table you should not notice any performance issues.
IMHO from a programming side it is always more beautiful to use joins than lots of temporary tables - if you can manage without temporary tables.
You always pass failure on the way to success.
|
|
|
|
|
GuyThiebaut wrote: IMHO from a programming side it is always more beautiful to use joins than lots of temporary tables - if you can manage without temporary tables.
Thanks, But I heard if we have several joins, it can be splitted into temporary table which can boost the performance. And I think performance depends on the situation where we use temporary tables. I guess performance would be costly when it is used for indexing. Because it needs more effort for recompilation.
|
|
|
|
|
The key sentance from the article that you reference is:
While temporary table may sometimes be unavoidable, they can often be sidestepped by using derived tables instead.
The article doesn't mean that temporary tables should never be used - only that the author has noticed that some programmers over-use temporary tables when other methods would be more efficient.
|
|
|
|
|
hi
have u tried ny Query?
Regards
Joe
|
|
|
|
|
hi
i dint get your problem ..
are you looking for a qry which returns the names of the society with a specific society type.
fot that you can use the below qry
select society_name from test_society where society_type=1
Regards
Joe
|
|
|
|
|
declare @exp varchar(100)
set @exp = '12,13,14'
declare @start int
declare @pos int
declare @substring varchar(20)
set @pos = 1
set @start = 1
while(@pos <> 0)
begin
set @pos = charindex(',' , @exp , @start)
if(@pos = 0)
begin
print substring(@exp , @start , len(@exp))
return
end
print substring(@exp , @start , @pos -1)
set @start = @pos + 1
end
i want the following output
12
13
14
But the output is
12
13,14
14
please rectify it
Yesterday is a canceled check. Tomorrow is a promissory note. Today is the ready cash. USE IT.
|
|
|
|
|
Is there any way you can take your input as XML and use OpenXML instead of this nasty string mashing ?
'
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
this is the database side processigs.actually i don;t konw , how long the string can be , 12,13,14,15.......there in the database i am saving these numbers.problem is the code i am using at database end , shows ths following output
12
13,14
14
for the 12,13,14 expression.
i wanted
12
13
14
so far xml interaction is not taking place .
Yesterday is a canceled check. Tomorrow is a promissory note. Today is the ready cash. USE IT.
|
|
|
|
|
Can u try the following:
-- Code
declare @ExpList varchar (1000)
, @Delimiter char (1)
, @INTValue varchar (20)
, @Position int
begin
create table #Result
(
IntValue int
)
set @ExpList = '10, 11, 12, 13, 14'
set @Delimiter = ','
set @ExpList = ltrim (rtrim (@ExpList)) + @Delimiter
set @Position = charindex (@Delimiter, @ExpList, 1)
if replace (@ExpList, @Delimiter, '') <> ''
begin
while @Position > 0
begin
set @INTValue = ltrim (rtrim (left (@ExpList, @Position -1)))
if @INTValue <> ''
begin
insert into #Result (IntValue)
values (cast (@INTValue as int))
end
set @ExpList = right (@ExpList, len (@ExpList) - @Position)
set @Position = charindex (@Delimiter, @ExpList, 1)
end
end
select * from #Result
truncate table #Result
drop table #Result
end
go
Sample OUTPUT:
--------------
IntValue
--------
10
11
12
13
14
-- End of Code
Kishore.P
|
|
|
|
|
What's the problem in the following
declare @exp varchar(100)
set @exp = '12,13,14'
declare @start int
declare @pos int
declare @substring varchar(20)
set @pos = 1
set @start = 1
while(@pos <> 0)
begin
set @pos = charindex(',' , @exp , @start)
if(@pos = 0)
begin
print substring(@exp , @start , len(@exp))
return
end
print substring(@exp , @start , @pos -1)
set @start = @pos + 1
end
Yesterday is a canceled check. Tomorrow is a promissory note. Today is the ready cash. USE IT.
|
|
|
|
|
Modified your code, see the below code:
declare @exp varchar(100)
, @start int
, @pos int
, @substring varchar(20)
set @exp = '12,13,14'
--set @pos = 1
set @start = 1
set @pos = charindex(',' , @exp , @start) -- Added here
while(@pos <> 0)
begin
--set @pos = charindex(',' , @exp , @start)
if(@pos = 0)
begin
print substring(@exp , @start , len(@exp))
return
end
print substring(@exp , @start , @pos -1)
set @pos = charindex(',' , @exp , @start) -- Added here
set @start = @pos + 1
end
go
Kishore.P
|
|
|
|
|
Sonia Gupta wrote: print substring(@exp , @start , @pos -1)
while executing this statement
1st time, @start is 1 and @pos is 3. so 12 is printed
2nd time, @start is 4 and @pos is 6. so 13,14 is printed i.e. from 4th position 6 characters are printed
Regards
KP
|
|
|
|
|
yes.ThanQ
Yesterday is a canceled check. Tomorrow is a promissory note. Today is the ready cash. USE IT.
|
|
|
|
|
|
Hello
I want to store the date in the sql DataBase like "11/15/2006"
i can't use the char or varchar because i need to do a filter on it, and if i choose smalldatetime it will stored like "11/15/2006 12:00:00 PM"
how i can do ?
thanks in advance
Assaf
|
|
|
|
|
Assaf82 wrote: I want to store the date in the sql DataBase like "11/15/2006"
i can't use the char or varchar because i need to do a filter on it, and if i choose smalldatetime it will stored like "11/15/2006 12:00:00 PM"
No, it isn't stored like that. You are confusing storage formats with presentation formats. It is stored as a 32 or 64 bit number in a way that is efficient for querying. The presentation format should normally be done by the application using the database rather than the database itself.
Upcoming FREE developer events:
* Developer! Developer! Developer! 6
* Developer Day Scotland
My website
|
|
|
|
|
G'day folks,
I have been experiencing an extremely strange problem in my code, this has to be marked as a X-File episode.
I have a method in my class which executes two other methods. One method(Method A) inserts a row in table A and the other (Method B) inserts a row in table B. This is part of an asp.net application.
When I run the the asp.net application without debugging both methods (A and B) execute fine, however method B doesnt seem to be updating table B whereas Method A updates Table A just fine.
I ran my query through MS Access with test data and the table got updated. Then I decided to step through the code and again method B seems to be updating table B.
I run the application again without debugging and samething happens Table B doesnt get updated and Table A is getting updated.
For the life of me I cant seem to point my finger where the problem is residing. Can this be a connectivity issue with MS Access and my asp.net application ? Both the asp.net and access database are residing in my development environment.
Any pointers will be appreciated.
thanks
|
|
|
|
|
ekynox wrote: Any pointers will be appreciated.
Here ya go![^]
Seriously, you might want to also put in some tracing code so that you can see exactly what is being sent to the database (or if the method is being called)
Or perhaps there is something obvious in the method itself that is different from the other method.
Upcoming FREE developer events:
* Developer! Developer! Developer! 6
* Developer Day Scotland
My website
|
|
|
|