|
Im agree with Pete.
If the table dont have many columns you can make a SqL BY any Column whith different sort. But this no mantenible for futures develops.
I have to work with a lot dynamic sentences, i suggest dont use "*" and before you put this sentence into a procedure run execute plan to watch the behavior
|
|
|
|
|
Hi,
After my SELECT I have the following results (partially here):
ID Name ParentID
256 Language, Literature And Biography 2878
257 Language & Linguistics 256
258 Philosophy Of Language 257
261 Language Acquisition 260
267 Language Family Studies 263
289 Language Usage Guides 284
292 Language Teaching & Learning (other Than ELT) 256
293 Language Teaching Theory & Methods 292
294 Language Teaching & Learning Material & Coursework 292
(please excuse if this is not properly aligned)
I thought about using the dataset's Relations property, like:
ds.Relations.Add("NodeRelation", ds.Tables(0).Columns("ID"), ds.Tables(0).Columns("ParentID"))
..but I get errors if there is no link between and ID and ParentID. How else can I do this??
Please help.
Regards
ma se
|
|
|
|
|
Please explain. What exactly are you trying to do and what is not working? What is your select statement? We need more information to help you.
|
|
|
|
|
Hi,
I am developing an application using Visual studio 2005 and sqlEXPRESS 2005(both are installed in my machine). My problem is i can connect to sqlexpress via visual studio. I think it does not accept my connection string which is:
"Server=myServerAddress;Database=myDataBase;Uid=myUsername;Pwd=myPassword";
for myServerAddress if i wrote localhost\SQLEXPRESS C# doest not like the '\'.
If someone i have an idea ?
Thank you
|
|
|
|
|
try localhost\\SQLEXPRESS
I Love SQL
|
|
|
|
|
|
hi all
how many max connection to a database in sqlserver ??
|
|
|
|
|
Please make question more sensitive.
And try to make a google[^]search
I Love SQL
|
|
|
|
|
Hello,
32767 concurrent connections are allowed in SQL 2000.
Senthil S
Software Engineer
|
|
|
|
|
How can i show a crystlreport in vb program
|
|
|
|
|
You couldn't have picked a more inappropriate forum could you? I doubt there are many people here who have active VB6 skills.
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
Pete O`Hanlon wrote: I doubt there are many people here who have active VB6 skills.
Some of us have to still maintain legacy code for clients who won't (or can't) upgrade...
|
|
|
|
|
But, out of the 4,382,390 members, how many are going to admit to having VB skills and how many actually look at the forums.
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
Pete O`Hanlon wrote: how many are going to admit to having VB skills
Why not?? anybody can do VB...
|
|
|
|
|
Go on - post this as a survey question, and see how many admit to currently coding in VB/
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
Pete O`Hanlon wrote: Go on - post this as a survey question, and see how many admit to currently coding in VB/
I did not say people would admit to doing it, I just said anybody _could_
|
|
|
|
|
Maybe, but they don't do that a SQL forum. They would do that in a VB forum.
Upcoming events:
* Glasgow: Mock Objects, SQL Server CLR Integration, Reporting Services, db4o, Dependency Injection with Spring ...
"I wouldn't say boo to a goose. I'm not a coward, I just realise that it would be largely pointless."
My website
|
|
|
|
|
Colin Angus Mackay wrote: Maybe, but they don't do that a SQL forum. They would do that in a VB forum
You are right... precisely the reason I was only replying to Pete and not the OP.
|
|
|
|
|
may be following links helpful to u.
http://visualbasic.ittoolbox.com/documents/popular-q-and-a/viewing-a-crystal-report-using-vb-3386
http://www.freevbcode.com/ShowCode.asp?ID=4832
|
|
|
|
|
hello
I have two related table
table1
cId
cDesc
table2
Id
Name
phone
cId
These two tables are related
where cId in table 1 is primary key and cId in table2 is foreign key
If I want to delete a record in table 1 which is related to table 2
Which is faster and more accurate
should I write my stored procedure like this
if exists(select * from table2 where cID = @CID)
delete from table1 where cID = @CID
else
return 0
------------------------------------------
or
------------------------------------------
delete from table1 where cID = @CID
if @@error<>0
return 0
|
|
|
|
|
If exists is a pretty slow approach. If you really wanted to do a select statement first you should do something like this:
if (select count(cID) from table2 where cID = @CID) > 0
begin
delete from table1 where cID = @CID
end
You probably don't want to do blind deletes since you may incur some locks that you don't really need if the row isn't there.
Hope that helps.
Ben
|
|
|
|
|
I don't know where you got that idea. EXISTS internally does a TOP 1, stopping as soon as it finds a row. Your approach will require SQL Server to continue after finding a row, to count all the matching rows (this assumes cID does not have a UNIQUE index on it). EXISTS is generally the better solution.
SQL Server only exclusively locks rows that will be changed, initially. The exception is if you're using the SERIALIZABLE transaction isolation level, in which case key-range locks will be taken to prevent new rows being inserted. If a large number of rows are affected, and SQL Server is running low on memory, it may decide to escalate to page locks or even table locks, because the lock object itself requires a certain amount of memory (one page lock obviously takes much less memory than 50 row locks). A DELETE operation that doesn't find any matching rows won't take any locks in READ COMMITTED or REPEATABLE READ isolation levels.
|
|
|
|
|
I guess I was thinking of NOT EXISTS being the performance hog. I was assuming the cID has a Unique index on it.
Ben
|
|
|
|
|
Hello,
There is no SQL r any format of codes.
Because if u created Primary Key in Master table and Forgin Key in Child table is enough. If you using SQL 2000 r 2005, the primary n forgin key relation itself have that fuction of deleteing. Try it
It is better to use Dotnet's Server Explorer which give all the facilities..
Senthil S
Software Engineer
|
|
|
|
|
hi,
Is it possible to connect oracle without 'tnsname.ora' in VB.NET
I want to use tnsname.ora entry in connection string Eg.
CONNECTSTRING=(DESCRIPTION=" & _
"(ADDRESS=(PROTOCOL=TCP)" & _
"(HOST=mysrv)(PORT=7001))" & _
"(CONNECT_DATA=(SERVICE_NAME=MYDB))); uid=read;pwd=read;"
|
|
|
|