|
And also stored procedure are pre comiled thing so not compiling it everytime you execute that unlike normal sql queries.
Best Regards,
Apurva Kaushal
|
|
|
|
|
And also don't repost..
Best Regards,
Apurva Kaushal
|
|
|
|
|
why we shouled using the stored procedure vs asp.net ??
|
|
|
|
|
Please don't repost the same question again and again
"Aim to go where U have never been B4 and Strive to achieve it"
http://groups.yahoo.com/subscribe/dotnetforfreshers
http://himabinduvejella.blogspot.com
|
|
|
|
|
yazan_zahi wrote: why we shouled using the stored procedure vs asp.net ??
The two things are not the same. You cannot write database code in ASP.NET.
|
|
|
|
|
Hi
I am trying to fetch data by using dynamic SQL which is stored in sql stored procedure and data is returned in dataset. But when i am doing
1 Dim PrdDataSet As New DataSet
2 PrdDataSet = SqlHelper.ExecDataSet("GetProductsDetails", CommandType.StoredProcedure, objparam)
3 ?PrdDataSet.Tables(0).Rows.Count
Line three is not dispaying an error "reference not set"
when i chnage my sp to hard code sql e.g. select * from product i am able to see row count in ds?
I am confuse....Please help me.
Amit
|
|
|
|
|
Amit Kumar G wrote: PrdDataSet = SqlHelper.ExecDataSet("GetProductsDetails", CommandType.StoredProcedure, objparam)
Your ExecDataSet call has obviously failed. Without seeing the code, it is hard to guess why. Try adding a try and catch block to see if any exceptions are being thrown, or step through each line of code in the function to find out what is going wrong.
First guess would be that the user the application is running under, doesn't have execute permissions for the stored procedure.
|
|
|
|
|
I have a report that I created that uses parameters. One of the parameters queries data from a table and inserts it into a combobox. My question is: How do I insert a wildcard into a queried parameter? For example if the query returns a list of teams how can I add a wildcard to that dataset so I can also have the option to pull of all the teams? Any help would be appreciated.
-Garrett
|
|
|
|
|
O.K. So I decided to create a stored procedure that takes a sql statement as a parameter and then adds a wildcard to the first row. This seemed to work fine. Code is below:
<br />
CREATE PROCEDURE sp_add_wildcard<br />
@sql nvarchar(1000)<br />
AS<br />
<br />
create table #paras<br />
(<br />
label nvarchar(255),<br />
value nvarchar(255)<br />
)<br />
<br />
insert into #paras (label,value) values ('(ALL)','%')<br />
execute('insert into #paras (label,value) ' + @sql)<br />
<br />
select * from #paras<br />
<br />
drop table #paras<br />
GO<br />
|
|
|
|
|
Usually in my RS datasets, I do a union
SELECT 'All' as label, '%' as value
union
SELECT label, value from myLookupTable
|
|
|
|
|
Hi everyone,
I want to learning sql2000 but Im hearing that SqlServer2000 is differ with SqlServer2005 now i want to know its right or no and if its right this difference is in statements or environment.
Thanks
|
|
|
|
|
messages wrote: Im hearing that SqlServer2000 is differ with SqlServer2005
Yes there are differences between SQL Server 2000 and SQL Server 2005
messages wrote: i want to know its right or no
Yes, what you heard is correct.
messages wrote: if its right this difference is in statements or environment
Yes, to both.
|
|
|
|
|
Hi colin,
Thanks for your help so if i try to learning sql2000 and then i want to working with SqlServer2005 i need to learning again because i hear that it has one enviroment
like vs.net and it donest Query and Enterprise.
Thanks
|
|
|
|
|
Hi All,
I have a DataTable in cache object and a local Datatable populated by calling an SP. I need to compare the whole data in both DataTables.If Cache DataTable's data is old then refresh it with latest one by calling the SP again and then use it later on.
How can I achieve this ?
Pls guide me.
Thanks
Omkar
|
|
|
|
|
Um. The point of having the cache is to save the overhead of querying the database. If you have to query the database to find out if the cache is still valid, the cache becomes pointless - it's just wasting memory.
ASP.NET 2.0 offers the SqlCacheDependency class which, on SQL Server 2005, uses a feature where the server software itself can call you back to tell you that the results of a query have changed. SQL Server 2000 doesn't offer this, but ASP.NET supplies a tool (aspnet_regsql.exe ) which can be used to create (I assume) triggers on tables which will allow a simple scalar lookup to determine if the base table has changed, rather than having to perform the potentially-costly query.
In general, though, to compare two DataTable s, you would simply iterate over the Rows collection, and if there was any row that was different in one table compared to the other one, or a row present in one missing in the other, they'd be different.
|
|
|
|
|
Hi,
I have one java table
How to retrieve the rows from the javatable using vbscript
|
|
|
|
|
Probably this is not the correct forum for that question.
Best Regards,
Apurva Kaushal
|
|
|
|
|
I know this is a newbie question but I am a newbie to writing stored procedures, Ok I want to right a stored procedure that copys data from one table to another table based on a certain ID then output back to the program that executes the stored procedure the ID of the next record available in the table that was just copied into. So basically i have table x and y, y is a history table of x, whenever things are about to change in x i save certain records (based on an ID) into Y, after I save this specific data to y, I want to ouput Y next record ID that is avaible(ex. if I add rows with IDs 1-10, i want to output back either 11). So how can I do this? Any Help will be greatly appreciated.
|
|
|
|
|
Insert Into TableA ( ColumnList )
Select SimiliarColumnLIst
From TableB
Where Conditional
After your insert statement, add either of the following
SELECT @@IDENTITY
OR
SELECT SCOPE_IDENTITY()
@@IDENTITY will return the ID of the last record inserted. If you have triggers on your table(s), then it would be the ID of the last record inserted by a trigger, in which case SCOPE_IDENTITY() returns the ID of the newest record, even if a trigger were to perform inserts against other tables. I personally always use SCOPE_IDENTITY() since I know what it will return now and in teh future, regardless of changes to the DB.
- Sage
LinkRenter
|
|
|
|
|
How to send HTML Form as body using SQL Mail in SQL Server?
Arghya Mahapatra
|
|
|
|
|
Use xp_sendmail with variables
EXEC xp_sendmail @recipients = 'robertk;laurac',
@message = 'The master database is full.',
@copy_recipients = 'anned;michaels',
@subject = 'Master Database Status'
Thanks & Regards
Kumar Prabhakar
abc
|
|
|
|
|
Hi friends,
Can anyone please tell me the answer for this query.
How to get the name of a person who gets 2nd maximum salary in an Organization from Employee table?
Thanks in Advance.
Prya
|
|
|
|
|
This could be one way:
select min(Salary) from(SELECT distinct TOP n Salary FROM table_name ORDER BY Salary desc)
Replace n with 2.
Best Regards,
Apurva Kaushal
|
|
|
|
|
hi
I need to get the Empname of the person who gets second salary. Can you help for that.
Prya
|
|
|
|
|
put empname in the same query in place of salary.
Best Regards,
Apurva Kaushal
|
|
|
|