|
David Mujica wrote: If you really only have 20 or so records
If you have 20 records and you only need 1, why load other 19 records if you know that you'll throw them away anyway ?
What if you have 10000 users loading extra 19 records everytime ?
David Mujica wrote: save yourself lots of headaches with complex SQL
I cannot agree with this ... I prefer the headaches
Please... SAVE my time by rating the posts that you read!
There are 10 kinds of people in the world: those who understand binary and those who don't.
|
|
|
|
|
select top 2 rowposition from tablename where rowposition > 1
I Love T-SQL
"Don't torture yourself,let the life to do it for you."
|
|
|
|
|
Regardless of all the fine answers you have been given, why do you need to read all the records if you know you need one of them?
What I mean is, if you know you want the nth record there must be something that makes it the one you want, so why not put that criteria in the original select?
Bob
Ashfield Consultants Ltd
|
|
|
|
|
Actually we have this requirement when calculating VAR, get the 500 scenarios, sort by your worst exposure and get 5th worst exposure of 500, rowposition does this.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Hi Everybody,
I have Visual Studio 2005 and SQL Server 2005 installed on my PC which runs on Windows XP PE.The problem is when I finished the setup of SQL Srver 2005 it was not getting connected using SQL Server Authentication, so I used windows authentication.Now I developed an application it is running on my PC but whenever I am running it using IIS the connection can not be established with SQL Server.What can be wrong? how can i create a user with password on SQL Server? Also if i create this application fully fuctionable on my machine then at the time of deployment will it create any problem on the remote server?
One last point:Can anyone give me a sample connection string for remote server.I know it for my PC only but what parameters i have to give when connecting to a remote database and how?
|
|
|
|
|
if u have user id and pwd then use the following:
Data Source=urServerAddress;Initial Catalog=urDataBase;User Id=myUsername;Password=myPassword;
if u r using windows authentication then use the following:
Data Source=urServerAddress;Initial Catalog=urDataBase;Integrated Security=SSPI;
Abdul Sami,
Systems Analyst
|
|
|
|
|
Clickety[^]
You will need to change the connection types allowed to both integrated & sql standard.
Create an application specific standard identity in SQL server, give it adequate rights to your database (not sa and probably not DBO). We have a script that grants execute on all procs and select on all tables & views.
Use the standard creds in the connection string you decide to use!
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
I used CDaoDatabase and its sibling classes in my app, but I can not install the app in customers' computer.
I guess that some dlls or registers are missing, because all are fine if I install VC++ on customers PC.
If I change database calsses from CDaoDatabase to CDatabase, there is no installation problem, so I think all troubles are from dao's issues.
I am using Visual studio 6.0 on Windows XP platform.
I do like dao database because it is much more powerful, but I can not install my app for customers.
how do you install your dao app for customers?
thanks
|
|
|
|
|
|
I had never heard of CDaoDatabase, however this seem to indicate there are plenty of resources out there to research try.
clickety[^]
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Hi guys,
I am pretty new to using MS Access data base and its connectivity.I have a webpage which is made up of HTML.This webpage has some fields in it.I have developed this webpage using Dreamweaver MX technology.
As soon as the users type the information and submit the values,I have designed the webpage to be in such a manner that the information is sent to my email.
Now I am trying to develop a way ,where the user values are stored in my MS Access database.Can anyone help me out in this regard.
What actually needs to be done.How can I establish the connectivity.I am pretty much confused as to what connection strings I should use.Should I change the HTML page to .aspx page????Kindly let me know in detail.Thanks a lot.
Regards,
Vamsee.
|
|
|
|
|
You are posting in the wrong Forum, you should have used ASP.NET Forum, but now to answer your question you have to write a data layer class that will interact with your page and create a Stored Procedure for insert. So that means when a user clicks Submit the data layer wil take the Parameters passed in your form and pass it in the Stored procedure and your records will be in the Database. like at this article and it can be done in Web too
http://www.codeproject.com/KB/cs/NTier.aspx[^]
Vuyiswa Maseko,
Sorrow is Better than Laughter, it may Sadden your Face, but It sharpens your Understanding
VB.NET/SQL7/2000/2005
http://vuyiswamb.007ihost.com
http://Ecadre.007ihost.com
vuyiswam@tshwane.gov.za
|
|
|
|
|
Sorry,
That I have posted in the wrong Place.Your explanation was very good.I will try this and get back to you if I have any doubts.Thanks a lot.
|
|
|
|
|
Your are welcome, am glad i helped.
Vuyiswa Maseko,
Sorrow is Better than Laughter, it may Sadden your Face, but It sharpens your Understanding
VB.NET/SQL7/2000/2005
http://vuyiswamb.007ihost.com
http://Ecadre.007ihost.com
vuyiswam@tshwane.gov.za
|
|
|
|
|
hi vamseeraja,
why don´t you became pretty new using SQL Server database, and by the way, became also pretty new using aspx too, instead of html!!!
|
|
|
|
|
Ya I can do that...
But the client I work for are not Computer geeks.so my Boss who also works along with me wants it to be simple technology.So I thought that.Also she wants the database to be in MS Access.
Thanks a lot for suggesting me.
|
|
|
|
|
Good Evening All
I undestand that if i write a Select into statement like this
SELECT * INTO NEW_TABLE FROM OLD_TABLE
This will create a table named New_Table and Copy the Data from the Old table to the New table. Now Every time this kind of statement runs , there should not be a table like New_TABLE? am i right?, am asking this because i have a process that is misbehaving written by a previous developer, if am wrong i think he thought that Select into statement Appends the records if the table New_Table is found.
i just need Clarity
Thanks
Vuyiswa Maseko,
Sorrow is Better than Laughter, it may Sadden your Face, but It sharpens your Understanding
VB.NET/SQL7/2000/2005
http://vuyiswamb.007ihost.com
http://Ecadre.007ihost.com
vuyiswam@tshwane.gov.za
|
|
|
|
|
First: what database is this associated with? Different systems will have different SQL syntax.
|
|
|
|
|
I dont Understand your Question. Am talking about SQL
Vuyiswa Maseko,
Sorrow is Better than Laughter, it may Sadden your Face, but It sharpens your Understanding
VB.NET/SQL7/2000/2005
http://vuyiswamb.007ihost.com
http://Ecadre.007ihost.com
vuyiswam@tshwane.gov.za
|
|
|
|
|
You are correct, Select Into syntax does not append.
|
|
|
|
|
Thank you , i understand
Vuyiswa Maseko,
Sorrow is Better than Laughter, it may Sadden your Face, but It sharpens your Understanding
VB.NET/SQL7/2000/2005
http://vuyiswamb.007ihost.com
http://Ecadre.007ihost.com
vuyiswam@tshwane.gov.za
|
|
|
|
|
..and it locks the system tables such as syscolumns for the duration of the select, potentially locking out other users - use with care. I prefer
Select * into New_Table from Old_Table where 1 = 2
insert into New_table select * from Old_Table
as this greatly reduces the lock time.
If necessary you could check for the existence of the new table before doing the select into and drop it if required.
Bob
Ashfield Consultants Ltd
|
|
|
|
|
Hi there,
I am an e-commerce website. I don't know how to architect the database and I am hoping for some input. The database has not been done yet.
I have 2 web solutions (2 different .net projects). The code is exactly the same. I have one website hosted in Country A for Country A, and I have the other website hosted in Country B only for country B. Reason for this is I want faster download rates.
Ideally I would like to have 2 seperate databases, one for Country A and the other for Country B, so this means that I will have to add the products twice. Some products only display in Country A and some products only display in Country B. I was thinking of having a master database that contains the products and then some how "get" the products to Country A and to Country B so that doanload rates are quicker. I want my users to be able to use both websites, so they can login in on any of the websites.
I hope I am making sense?? If you have any interesting articles please let me know.
Thanks
|
|
|
|
|
If you structure the tables correctly, you will be able to contain it in a single database.
Use a single user/login table(s) for both sites, this way you wont have to import anything if you kept the site's databases different.
If product's are a one to one relationship to countries (one product can be sold in one county), then you can have a product data set with a column for the country ID. Have a table with the countries (A and B in your example), then join the products and country.
If one product can belong to both countries, then you can have a product table with country "flags" (a bit column with 1 indicating yes and 0 indicating no). So you might have productid = 1, country A = 1, and country B = 1 meaning that the product is available in both countries. If you do expand, then you will have to keep adding countries. To avoid that, you can have a "mapping" table where you map single products to multiple countries (being a true one to many build).
I'm assuming that both sites will use a common database server.
|
|
|
|
|
I will be using SQL Server 2005. I can host the database in Country A, but then downloads times for Country B will be slower? A couple of seconds is big deal for me.
|
|
|
|