|
Thanks Michael this just might be what I'm looking for. I'll let you know how it turns out. My original query returns 318 records and takes about 1 min to run. I'm hopeing to knock it down to a few seconds.
|
|
|
|
|
Thanks for everyones help, I got my query down to 3 seconds from 1 min. I used a combination of a temp table and removed some user defined funtions that were absolutly useless and slowing my SP down. I normally hate working with SP's but I enjoyed learning about how to optomize a SP.
|
|
|
|
|
Hi, I am creating a dataset, by adding up to 10000 rows at a time. At present, I add each of these rows using a stored procedure. Is there anyway I can add the entire dataset instead of doing this row by row?
Thanks
|
|
|
|
|
Hi all,
How to make "ERD diagram" in SQL Server 2000.
plz discuss in detail
Thanx in advance
Sajjad
|
|
|
|
|
|
Hi,
Is there any way to define stored procedute to return nText(memo).
I need this to convert my memo field to my own data.
Any help?
Be simple and Be sample.
|
|
|
|
|
i would like to store farsi date in ms sql server, can any body know how to do it
ramesh
Gourigari Ramesh Reddy
Hyderabad
|
|
|
|
|
Hi there,
I cannot manage to use the greek character in mysql db.
I try using the greek character set and collation, but no way, it doesn't working.
Does someone have already success to work with mysql and non latin character ?
If yes can you help by giving me some advices plz.
Thx in advance.
|
|
|
|
|
hi
i imported an ms access db to SQL SERVER 2000 using the tool "import and export data".
Now all my relations from my access db are not shown or created in the sql server db.
How does this come? Is there a way to also import the relations? or do i have to lay them back one by one by hand?
grtz & thx
|
|
|
|
|
|
Hi all,
I wanna know about, r Sql Server 2000 support the Booleon data type, if yes plz tell how can it use...
and also tell about some common Data type like datatime,varchar,numeric...
Thanx in advance
Sajjad
|
|
|
|
|
imshally81 wrote:
Sql Server 2000 support the Booleon data type
Yes, in SQL Server it is called bit
imshally81 wrote:
tell about some common Data type
That's a vig vague. What do you want to know?
The base datatypes are:
binary Bigint bit Char datetime decimal Float image Int Money
nchar Ntext nvarchar Numeric Real smalldatetime smallint smallmoney sql_variant sysname text timestamp tinyint varbinary varchar uniqueidentifier
My: Blog | Photos | Next SQL Presentation
WDevs.com - Open Source Code Hosting, Blogs, FTP, Mail and More
|
|
|
|
|
Thanx for reply,
I just wanna know small introduction of common data types and their usage....
Sajjad
|
|
|
|
|
|
|
I have a table on an SQLServer 2000 box with a DateTime field called CallTime.
I want to select all the records between 19:00 and 06:59 over a period of days
Is there a more efficent way of doing the select in a stored procedure than this,
WHERE (DATEPART(hh, dbo.JobData.calltime) * 60 + DATEPART(mi, dbo.JobData.calltime) BETWEEN
DATEPART(hh, '19:00') * 60 + DATEPART(mi, '19:00') AND DATEPART(hh, '23:59') * 60 + DATEPART(mi,
'23:59')) OR (DATEPART(hh, dbo.JobData.calltime) * 60 + DATEPART(mi, dbo.JobData.calltime) BETWEEN
DATEPART(hh, '00:00') * 60 + DATEPART(mi, '00:00') AND DATEPART(hh, '06:59') * 60 + DATEPART(mi,
'06:59'))
Michael
CP Blog [^] Development Blog [^]
|
|
|
|
|
|
Thanks Colin.
Having to split the WHERE up into before midnight and after midnight seemed to a bit clunky, but it'll do the job. I really hate T-SQL somedays, feels so primitive. Here's hoping that SQLServer2005 has a few useful enhancements.
Michael
CP Blog [^] Development Blog [^]
|
|
|
|
|
|
Colin Angus Mackay wrote:
Another thought occurs to me...
You could create an extra column to store the minutes (or seconds) since midnight. It is updated by a trigger on the table. Your query would be less complex and probably run faster too.
Thanks. I hadn't thought of that one. I may look into implementing that for the next release of the software. I'll stick with the query for now as I'm only using it to build a View to produce a report and I don't want to make too many changes.
Michael
CP Blog [^] Development Blog [^]
|
|
|
|
|
Could you subtract out 7 hours from each DateTime value, then convert the result to a string formatting the time in AM/PM format and just keep the ones that have a PM as their time component by using a LIKE comparison? Not sure just what this SQL would look like, but I think it work.
where to_char((DateTime - 10584000),'YYYYMMDDHHMISSAM') LIKE '_____________PM'
The value of 1058400 is how many seconds are in 7 hours.
Chris Meech
I am Canadian. [heard in a local bar]
Remember that in Texas, Gun Control is hitting what you aim at. [Richard Stringer]
Nice sig! [Tim Deveaux on Matt Newman's sig with a quote from me]
|
|
|
|
|
Hi all,
I m desiging the database first time, so how can i design the database,how i set the datatype of Datafield.(means which creteria i use for giving data type).
how can i manage the Relationship.....
plz discuss in detail.....
thanx in advance
Sajjad Rizvi
|
|
|
|
|
"E. F. Codd"...put that in Google (or even better, Amazon) and read the results.
|
|
|
|
|
|
Hi
does ne1 know how to put an if statement with in sql query ??
im looking on doing something like the below
Select school_id,class_id from student
if school_id = 1
where left(class_id,1) = @class_val
else
where left(class_id,2) = @class_val
Any ideas
Thanks
Si
|
|
|
|