|
where date > @Date1 and date < @Date2 or using between or there's a faster solution?
<italic>Work hard, Work effectively and a bit of luck is the key to success.
|
|
|
|
|
Try it and see. I'd guess that between internally does > < and is probably slower for the extra step, but only by a miniscule amount.
Christian
I have several lifelong friends that are New Yorkers but I have always gravitated toward the weirdo's. - Richard Stringer
|
|
|
|
|
Hi All,
I was wondering if I could get some advice on this. What Im trying to do is view a stored procedure in an asp page. I dont know much about it and was wondering is it like displaying records in a table? Any help/links would be greatly appreciated. Thanks in advance
Nic
|
|
|
|
|
Assuming you are talking about SQL Server 2000 (You didn't mention a database product - so the rest of this answer may not apply) you can perform a query like this:
select * from syscomments
inner join sysobjects on sysobjects.id = syscomments.id
where xtype='P'
Which will return all of the stored procedures and the their uncompiled source.
Does this help?
My: Blog | Photos
WDevs.com - Open Source Code Hosting, Blogs, FTP, Mail and More
|
|
|
|
|
Or using INFORMATION_SCHEMA:
SELECT ROUTINE_DEFINITION
FROM INFORMATION_SCHEMA.Routines
WHERE ROUTINE_CATALOG = 'MyDatabaseName'
AND ROUTINE_NAME = 'MyProcName'
MS SQL Server will return NULL if the procedure has been encrypted.
|
|
|
|
|
hi,
can any one help me to understand the difference between the manged providers and ole-db provider.And I also want to know the manage provider for oracle.
Satish
|
|
|
|
|
|
hi Colin,
Thank you very much for providing the link.
Satish
|
|
|
|
|
My app suddenly won't install MSDE, it just freezes towards the end, and the error log just says something like 'performing custom actions', then a big dump of info including a fail message when that timed out. I've made sure that no install of the same name exists on the machine.
Christian
I have several lifelong friends that are New Yorkers but I have always gravitated toward the weirdo's. - Richard Stringer
|
|
|
|
|
Hi,
I need a DB w/ a small footprint that will ship with my app. I was wondering what people are mostly using.
I'm thinking Access but I'm not sure if that would require the user to have M$ office installed ??
I also looked at FireBird (firebirdsql.com) but I can't seem to find any reviews from developers who have used it.
MSDE @ 70MB (i think) is just too large !
Any ideas ???
|
|
|
|
|
Take a look at sqlite:
http://www.sqlite.org/
|
|
|
|
|
|
Hi
I am familiar with RDBMS to some extent. My recent DB had graph structure
and now i want to be professional in DB ( Like Colin Mackay )!.
Can you introduct some book for this purpose?
Thanks 1000000.
|
|
|
|
|
|
I'm developing an application using the GenericOLEDB dll accessing an access 2000-database. Mostly SELECTs are being used.
I don't know whether this is the correct approach, but I have chosen to create a new GenericOLEDB-object each time I access the database, and this has caused my application to be very slow. I guess this is because of opening a new connection each time.
What is the recommended approach? Having a global object leaving the connection open all the time seems like a bad solution to me, but I may be wrong?
All answers will be appreciated.
Sincerely,
Sjur Rondestveit
|
|
|
|
|
How to protect SQL databse not allowaning users to alter from enterprice manager.
|
|
|
|
|
Well, if they have an accout in SQL Server then they can log in and do what ever the account permits.
One thing that I am wondering: If they are not supposed to change things in the database with Enterprise Manager then why install it? Why do users have a local installation of the SQL Server client tools?
I am trying to work out your current set up because I could suggest something that could shut out something that is needed. The only users that I've ever come across that have Enterprise Manager (or any of the other database client tools) installed on their machines are DBAs, Developers and the System Admins.
My: Blog | Photos
WDevs.com - Open Source Code Hosting, Blogs, FTP, Mail and More
|
|
|
|
|
Don't allow your users to connect using the sa account. SQL Server has strong security support and by default, no-one other than the database owner has access to anything. You should consider what you want your users to be able to do with a database and set the roles appropriately.
If you don't want users to be able to edit data, I suggest writing stored procedures that accept data in the valid form, grant EXEC permission on the stored procedures, and revoke INSERT, UPDATE and DELETE permission on the underlying data tables. Then users must use the stored procedures to make changes.
If you're trying to ensure that only consistent data is stored, consider using primary keys, UNIQUE constraints, foreign key constraints and CHECK constraints to enforce valid data entry. If you want to denormalise your data (e.g. keep an order total field against an order record rather than summing each order line for that order), write a trigger that updates the order total when order lines are added, updated or deleted.
Stability. What an interesting concept. -- Chris Maunder
|
|
|
|
|
Hi, I have two design objectives in mind:
1. to integrate NHibernate into data access layer of our applications
2. to maintain flexibility to switch from one OR tool (Object Relational mapping tool) to another (HNibernate to ADO.NET 2.0 ObjectSpace for instance).
To meet these requirements, it's neccessary to top our "OR" layer with an additional "OR broker" layer
class ObjBrokerFactory {<br />
<br />
IObjBroker GetObjBroker(ortype) {<br />
select ortype:<br />
case NHIBERNATE: return (IObjBroker) new NHibnernateObjBroker(...);<br />
case OBJSPACE: return (IObjBroker) new ObjSpaceBroker(...);<br />
}<br />
}<br />
<br />
class ObjHNibernateBroker {<br />
public New(...) {<br />
... initialized depending on OR type specified ...<br />
}<br />
<br />
public Finder(criteria) {...}<br />
public Insert(obj) {...}<br />
public Update(obj) {...}<br />
public Delete(obj) {...}<br />
}<br />
Then in client, instead of calling :
UserAccount acc = new UserAccount(...);<br />
acc.Email = "john.doe@hotmail.com";<br />
...<br />
IObjBroker broker = brokerFactory.GetObjBroker(ortype.NHIBERNATE);<br />
...<br />
broker.Insert(acc);<br />
...
Looks nice and clean, but, what if you need to persists a number of different object within one transaction? With NHibernate:
<br />
ISessionFactory factory = cfg.BuildSessionFactory();<br />
ISession session = factory.OpenSession();<br />
ITransaction transaction = session.BeginTransaction();<br />
User newUser = new User();<br />
newUser.Id = "joe_cool";<br />
newUser.UserName = "Joseph Cool";<br />
...<br />
session.Save(newUser);<br />
...<br />
transaction.Commit();<br />
session.Close();<br />
With ObjectSpace however:
<br />
IObjectSpace animal = (Animal) objectSpace.CreateObject(typeof(Animal), <br />
ID, Age, Weight);<br />
objectSpace.BeginTransaction();<br />
objectSpace.Update(animal);<br />
objectSpace.CommitTransaction();<br />
So much so for our "OR Broker" layer - any suggestion? Is there any good authoritative article on this subject? Design Pattern I'm not aware of?
Thanks in advance.
References:
1. NHibernate QuickStart http://nhibernate.sourceforge.net/quickstart.html
2. NHibernate - a more practical sample http://www.theserverside.net/articles/showarticle.tss?id=NHibernate[^]
3. ASP Appliance ADO.NET 2.0 ObjectSpace http://aspalliance.com/articleViewer.aspx?aId=248[^]
4. MSDN ObjectSpace http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnadonet/html/objectspaces.asp[^]
5. Sitepoint: http://www.sitepoint.com/blog-post-view.php?id=156266[^]
Norman Fung
|
|
|
|
|
I Want to Use Soundex in Dataset search But it gives "The expression contains undefined function call soundex()."
code for Like Function
dataset.Tables[0].Select("fname like '"+name+"%'");
and following Code I Want To Use For The Select
dataset.Tables[0].Select("Soundex(fname) =Soundex ("+name+")");
Any Solution
Please Give Reply As Early As Possible
|
|
|
|
|
When using webhits in the Index Service on IIS, I only see the ASP version of creating search forms. For the Record Set property, you have to set it to "Query Restriction" and then some other code to use the qFullHit.htw or qsumHit.htw.
My question is, does ADO.NET have a similar solution for using webhits in IIS?
|
|
|
|
|
I’ve been working on this quire for a day now and can’t seem to figure it out.
Given theses tables: (if there is an error in the create table disregard it. This code is the simplest way I can describe the tables)
<br />
Create table Problem as (PID int Primary Key, <br />
POpenDate DateTime Not Null,<br />
Pclosed DateTime Not Null<br />
)on primary<br />
Create table Notes as ( NID int PrimaryKey,<br />
PID int ForegnKey to Problem.PID,<br />
NEditDate<br />
)on primary
There is a one-to-many relationship between Problems and Notes.
I’m trying to select this:
Select p.PID, p.POpenDate, n.NEditDate as ‘LastEditDate’, p.PclosedDate <br />
Form Problems as p INNER JOIN Notes as n on p.PID = n.NID
Now because Notes keeps a record of all Edits to a Problem this select statement returns a record for every Edit since all edits must have a problem. I only want the most resent, or the closest date to now, returned.
A few things I’ve tried:
select DISTINCT ….. Doesn’t work they are all distinct because of the EditDate
select … group by p.PID Gave me: Server: Msg 8120, Level 16, State 1, Line 1
Column '_FieldName_' is invalid in the select list because it is not contained in either an aggregate function or the GROUP BY clause.
Select top 1… Didn’t work only returns the Top one (well no kidding eh) I need the top 1 for each PID
I can’t change the design of the Db either.
Any Help would be Very much appreciated
Thank you,
Ronald Hahn, CNT - Computer Engineering Technologist
New Technologies Analyst
HahnTech Affiliated With Code Constructors
Edmonton, Alberta, Canada
Email: rhahn82@telus.net
|
|
|
|
|
select *
from problems a
, tblnotes b
where a.id=b.id
and b.adddate =
(select max(adddate)
from tblnotes x
where x.id = a.id)
Ronald Hahn, CNT - Computer Engineering Technologist
New Technologies Analyst
HahnTech Affiliated With Code Constructors
Edmonton, Alberta, Canada
Email: rhahn82@telus.net
|
|
|
|
|
I'm doing an web project about virtual stock exchange. With me that project is very important and i'm really worry about my database. I wonder is there anybody interested in my project 'n can help me improving my database better or somewhere can check my database? If you can, plz email to me : duc.to.ho@gmail.com
Thank you!
|
|
|
|
|
[WebMethod]
public DataSet GetEmployees()
{
.
.
.
}
or
[WebMethod]
public []Employee GetEmployees()
{
.
.
.
}
which Employee is business object and using dataReader is filled.
|
|
|
|