|
Hi Niaher
The @@ROWCOUNT variable (and others like @@ERROR) are local to each database connection. Your stored procedure can use this to implement concurrency control.
Regards
Andy
|
|
|
|
|
Thank you. So what about a generic query with multiple statements, does it have a single connection? Can I use them to implement my concurrency control?
|
|
|
|
|
Yes you can use them for concurrency control. Which development language are you using?
|
|
|
|
|
Using C#. Btw I know it is a very controversial question, but what is a better choice performance-wise, a stored procedure or a dynamic query? In my case I will have not more than 15 tables and my goal is to support concurrecy in insert, update and delete logic, be it in SPs or dynamic queries.
Niaher
|
|
|
|
|
You're right - it is a very controversial question
Performance should be very similar for this type of logic - SQL-Server will cache query plans for both methods.
Stored procedures encourage:- Encapsulation of data-access logic - so you can substantially change the underlying SQL at a later date.
- Better security - You can deny direct access to the database tables, and force all access via the stored procedure layer.
- Reduced susceptablity to SQL-Injection attacks.
The downside is that you need to write more code, and many programmers don't like writing SQL.
I normally use Stored Procedures in my projects (because I tend to work for clients whose the coding standards dictate that they should be used). I normally write code generators to do the boring stuff for me.
Regards
Andy
|
|
|
|
|
i have a DTs that has steps, collecting info from Different tables and recreate a temp table for reporting. When i execute this DTS that has steps, i get the Error
"Execution Canceled by user"
and i did not cancel it.
Please help
Vuyiswa Maseko,
Sorrow is Better than Laughter, it may Sudden your Face, but It sharpens your Understanding
VB.NET/SQL7/2000/2005
http://vuyiswamb.007ihost.com
http://Ecadre.007ihost.com
vuyiswam@tshwane.gov.za
|
|
|
|
|
|
Thanks it worked for me
Vuyiswa Maseko,
Sorrow is Better than Laughter, it may Sudden your Face, but It sharpens your Understanding
VB.NET/SQL7/2000/2005
http://vuyiswamb.007ihost.com
http://Ecadre.007ihost.com
vuyiswam@tshwane.gov.za
|
|
|
|
|
HTH!
Raz
/*
Ghazi Hadi Al Wadi, PMP, ASQ SSGB, DBA
*/
|
|
|
|
|
hi....
Now displaying date like 10-2007 but I want to display Oct-2007.in Sql Query..anybody know plz reply me..
Rajendran
|
|
|
|
|
Try This,
select convert(varchar(50),getdate(),106)
|
|
|
|
|
hi soni Uma....Thanks for reply.....
I want to display only the month and year..(Oct-2007) if u know that plz reply me..
see the following code...thats i have used...but its displaying 10-2007....
select Cast(DatePart(month,RenewalBaseMonth) as varchar) + '/' +Cast(DatePart(year,RenewalBaseMonth) as varchar) as RenewalBaseMonth
from #temp21
Thanks
Rajendran
|
|
|
|
|
Hi,
Try this
select Cast(DateName(month,RenewalBaseMonth) as varchar(3)) + '/' +Cast(DatePart(year,RenewalBaseMonth) as varchar) as RenewalBaseMonth
from #temp21
Senthil
-- modified at 8:15 Tuesday 30th October, 2007
|
|
|
|
|
hi,
Its working fine....
Really good work and thanks alot....
Rajendran
|
|
|
|
|
Pls rate my answer if it is working well
Senthil
|
|
|
|
|
May I know where u r working..If u feel good tell me.
Thanks..
Rajendran
|
|
|
|
|
Hi Rajendran,
I am working in Pricol Ltd, Coimbatore as Dev lead.
How about u?
Senthil
|
|
|
|
|
Senu Gandhi wrote: Pls rate my answer if it is working well
It is rude to solicit votes.
|
|
|
|
|
|
R a jendran wrote: already I voted for u...5/5
y u r saying like this..really good work..
I can't even read that. Can you stick to English please.
|
|
|
|
|
sorry ....i was read that hidden part thats Y replied again....i 'll correct it..
thanks
Rajendran
|
|
|
|
|
R a jendran wrote: Y
That is the penutimate letter of the modern English alphabet. It is not a word per se.
|
|
|
|
|
Ok
This is work fine
select DATENAME(MONTH,GETDATE()) + '/' + Cast(DatePart(year,getdate()) as varchar)
Have nice time
|
|
|
|
|
Thanks for reply...already senu gandhi sent me that solution...I solved that problem ...
Thanks..
Rajendran
|
|
|
|
|
Hi,
I have a problem with a sql-Statement. I’m developing an application in which a user can type in a sql-statement, e.g. "Select * from (select name from employee)" . This statement is not very reasonable but it is syntactically correct.
My code is
OracleCommand cmd = new OracleCommand("Select * from (select name from employee)", myOracleConnection);
OracleDataReader rdr = cmd.ExecuteReader(CommandBehavior.KeyInfo);
System.Data.DataTable colinfo = rdr.GetSchemaTable();
At this staement the application crashed with an exception: "InvalidOperationException: Identifier expected or identifier in quotes expected" . (The message is in germaan: "Syntaxfehler: Erwartet wird ein Bezeichner bzw. Bezeichner in Anführungszeichen.", but i try to tranlate it in english)
I want to use GetSchemaTable to get all the columninformation I needed to display the result. So how can I solve the problem ?
Thanks in advances
Willibert
|
|
|
|