Stored Procedure Which Runs On 5000 Users In Tbluser Table With Some Filter Condition In Database?

Mar 7, 2011

I have created one stored procedure which runs on 5000 users in tbluser table with some filter condition in database.There are 4 filtering condition(FC1,FC2,FC3,FC4).Filtering condition has some ListBox and dropdown list of department and countries.I want output as given below:

ID Name StaffNo department Points
1 KK 111 dep1 2
2 NN 222 dep2 1
3 DD 333 dep3 4


I got ID,Name,StaffNo,department in resultset but not points.

points calculation would be based on filtering condition like

if FC1 matched user gained point 1,if both FC1 and FC2 matched user gained 2 point,if both FC1 ,FC2 and FC3 matched user gained 3 point etc.

--in stored procedure i m using dynamic query
DECLARE @SQL VARCHAR(2000)
SET @SQL = 'SELECT U.UserID, U.StaffNo,U.FirstName+'' ''+ U.LastName AS EmployeeName,''?'' AS Points FROM tblUser U '[code]....

all filtering condition are implemented with OR logic.

View 3 Replies


Similar Messages:

ADO.NET :: Managing TypedDataSets When There Is A Change In Backend Table / Stored Procedure / Database Schema

Sep 15, 2010

if there is any easier way to synchronize the TypedDataSets with the chages made to backend Table / Stored Procedure schema. I use Typed DataSets in my project extensively and I found them very useful and easier to code, but difficult to maintain

The difficuly I have always faced is whenever there is a change in a backend database table structure or stored procedure that is linked to any of the Typed DataSet in our project requires to recreate whole DataSet again by scrapping the old one. The backend changes will not be reflected unless and untill you recreate the whole stuff again.

Is there any easier way to synchronize those typed datasets with the changes made to backend database schema or any other workaround that will not required to recreate the whole DataSet again.

View 2 Replies

Data Controls :: Calculate Textbox Value Based On If Condition Inside Stored Procedure

Jul 17, 2015

I have 3 Textboxes in my Web page. When user key in value in these 3 textboxes,their result should show on a "Label"

1) Gross Amount
2) Taxable Amount
3) Tax Amount

I have to write a Stored Procedure for calculating the value of above textboxes.

Condition is:

If Gross Amount is > or < 0.00, then Taxable and Tax amount should calculate based on below formula:
@TaxableAmt = @GrossAmt / @Rate
@TaxAmt = @GrossAmt - @TaxableAmt

but If Taxable Aount is > or < 0.00, then Gross and Tax amount should calculate based on below forumla:

@GrossAmt = @TaxableAmt * @Rate
@TaxAmt = @GrossAmt - @TaxableAmt

and for "Tax Amount" I have 2 different conditions:

If Tax Amount is = 0.00, then Taxable and Gross amount should calculate based on below formula:
@TaxableAmt = @TaxAmt / (@Rate-1)
@GrossAmt = @TaxAmt + @TaxableAmt

but If Tax Amout is <> 0.00, then whatever the value of Tax Amount is, it should key-in/show as it is.

i.e., @TaxAmt = @TaxAmt

For this requirement, I wrote below SP:

ALTER PROCEDURE [Invoice].[usp_tbl_TaxCode_Update]
-- Add the parameters for the stored procedure here
@TaxCodeID nvarchar(50) ,
@GrossAmt decimal(18, 2),
@TaxableAmt decimal(18, 2),
@TaxAmt decimal(18, 2)

[code]...

But its not working as per required.

View 1 Replies

SQL Server :: How To Create A Stored Procedure For Authenticating Users

Nov 11, 2010

trying to create a stored procedure to authenticate users, if users are authenticated their data like userid, first name, etc are returned in a cursor. However, if users are not authenticated an error is returned or something that indicates users were not authenticated.

But I don't know how to do this in a stored procedure.

View 2 Replies

ADO.NET :: Getting Data From A Stored Procedure Instead Of A Table?

Oct 19, 2010

Using linq2sql, I've seen examples of using stored procedures for insert, update and delete but how can I use a stored procedure for select?

View 4 Replies

DataSource Controls :: How To Convert The Oracle Stored Procedure To Sqlserver 2005 Stored Procedure

Apr 2, 2010

This is surareddy. i nead some small clarification in the "Stored Procedure"

how to convert the oracle Stored Procedure to sqlserver2005/2008 Stored Procedure.

right now i am enhancing the project that project already developed the oracle Stored Procedure. now our company is using sqlserver 2005/2008.

how to convert the Oracle Stored Procedure to sqlserver 2005 Stored Procedure

View 4 Replies

DataSource Controls :: Do Not Use Or Call Any Stored Procedure But It Says "Could Not Find Stored Procedure 'xxxxx'?

Dec 9, 2010

Initially, I have tried to use stored procedure. But I changed my mind and preferred to call sql query in codebase with command text. However, it stills tries to find initially-called stored procedure (which is neither called or exists).I think that it is related caching. But I tried it with different browsers it did not work.What might be the reason?

View 4 Replies

Databases :: How To Return A Table Through A Stored Procedure

Mar 24, 2010

I'm not so familiar with stored procedures but I'm interesting in moving most of my web selects to stored procedures. I'm working with .net based website and all my data access is something like this:

[Code]....

But now I want to improve some process and make tunings. For that I want to use stored procedures, so instead of the "SELECT ...." sentence I'll put stored procedure name. My problem is how to return a table from one.

View 3 Replies

Web Forms :: Display Image Which Is Stored In Some Folder And Its Path Is Stored In Database Table?

Feb 13, 2013

i want to display image which is stored in some folder and its path is stored in database table. i used your link [URL] for the same but i am not storing any thing like data column in my table and have passed name column to Byte[]and so its giving datatype error there. what is the way to convert it to byte?

View 1 Replies

Web Forms :: Display Image Which Is Stored In Some Folder And Its Path Is Stored In Database Table

Dec 27, 2011

i want to display image which is stored in some folder and its path is stored in database table. i used your link URL... for the same but i am not storing any thing like data column in my table and have passed name column to Byte[]and so its giving datatype error there.

View 1 Replies

SQL Server :: How To Create Temp Table Stored Procedure

Mar 23, 2011

i would like to retrieve data from two table, how can i create a temp table and then insert data from two different table.and then use the temp table to join other table in stored procedure.if i want to select same data from two table, how can i select all distinct data from two table into temp table

View 4 Replies

SQL Server :: How To Pass A Temp Table Between Stored Procedure

Oct 27, 2010

I have "HUGE" stored Procedure... so I just decided to separate this big SP to some small sp ( for easy to maintain)I meet a problem is in SP A

create table #tmp
(
)
select .
from.
// then call sp B
exec B -- would it possible to pass my temp table to SP B? so I can do next operate in SP B

View 5 Replies

SQL Server :: Send A Table With Value As A Parameter In A Stored Procedure?

Jul 14, 2010

I need to send a table with value as a parameter in a stored procedure. It is possible any how?

View 3 Replies

C# - Get Column Names From Table Returned From Stored Procedure?

Feb 10, 2011

I have a stored procedure which returns a table. The stored proc is called via a linq datacontext.

It works fine and I get the table back however I really want to also get the title relating to each particular cell returned.

The stored procedure call is like:

var table = DataContext.GetTable().ToList();

So I get a List<GetTable>. The data is fine I just want the column names as well.

View 2 Replies

SQL Server :: Table Variable As Parameter For Stored Procedure?

Sep 9, 2010

My stored procedure expects a uniqueidentifier as a parameter. However, this unique identifier is stored in a table variable, which looks like this:

DECLARE @GiftGuid uniqueidentifie

View 14 Replies

Running Stored Procedure Using Linq Into SQL Members Table?

Sep 8, 2010

Using asp.net MVC in c#, I am making a call to a stored procedure using Linq into my SQL Members table. I have no internal caching on the application, already checked to make sure it is turned off.

Test case:I have my username set to test1. From the website I change my username to test2. The website still shows test1. I go to Management Studio and run my stored procedure called MemberByEmail, it shows test2 correctly.I start simple, refresh my page to see if it's browser cache, still test1. I go to debugging and walk through the code and find that it goes correctly all the way to here to call the database:

/// <summary>Method that is mapped to the dbo.MemberByEmail database procedure.</summary>
/// <returns></returns>
[System.Data.Linq.Mapping.Function(Name="dbo.MemberByEmail")][code]...

Again I ran the stored procedure through Management Studio, and it came up with test2 as the username. I waited for 15 minutes, refreshing the web page every 5 or so, and it never cleared and served the correct test2 from the db. The last strange piece, I ran IISReset and refreshed the page, test2 was returned.

UPDATE: I created a console application to take out the web piece of it. The problem is the same when accessing directly from a console app also, no change.

View 2 Replies

DataSource Controls :: Using Table Variable In Stored Procedure?

Feb 18, 2010

I've written a stored procedure which uses a table variable. The stored procedure is shown below:

[Code]....

The table variable @CaseNumbers is declared, and is a bunch of values are inserted using a table-valued function called SplitStringIntoInts. At this point I can select from @CaseNumbers and this works fine.But when I try to join onto @CaseNumbers, the name '@CaseNumbers' in the ON clause is highlighted with the error 'Must declare scalar variable @CaseNumbers'. What?! It's not scalar, I declared it ages ago and I have used it since!

View 3 Replies

C# - Outputting Data With An Access Database But Users Stored In An SQL Database?

Dec 3, 2010

I'm creating an ecommerce site using asp.net and a Access Datasource, I have used the pre-defined logging in and registering controls provided by Visual Studio 2010 which stores the user data in a SQL server.

For my site the content of the shopping cart is uploaded to a table in the access database, I need to however save the contents of the cart to a specific user ID. For example if User number 1 orders book id's 4,7,2 this needs to be saved, but if user number 2 comes along and orders 4,1,7 this needs to be saved for them as well.

So a user can have many carts, this is sorted in access but with the user ID being saved to a different database is there anyway I can link the two databases so I can say

"Save bookid's 1,2,3 in tblcart where userID is the same as the logged in user"

View 1 Replies

Web Forms :: Store Values In Two Table In Database - Nested If Condition

Apr 27, 2016

I want to store Values in two table in database..

For Ex.

table 1-- Resi

if Resi is clicked then the values are stored in resi_db and then it will also get store in the HEG01_db table in database..

table 2-- NonResi 

if NonResi is clicked then the values are stored in NonResi_db and then it will also get store in the HEG01_db table in database..

View 1 Replies

DataSource Controls :: How To Join Table In Stored Procedure Sql Server Db

Jun 9, 2010

my stored procedure is always extract some data into temp table such as"select name,address,content into #TEMP1 from table1,table2,table3"
finally, select another table together with #TEMP1 to extract all desire data from one queryselect T.name,T.address,T.content,C.other from #TEMP1 T, otherTable C
where T.ID=C.IDI would like to ask if i want to join one more table T2 into final query with "otherTable left C outer join on C.ID=T2.ID"

View 1 Replies

DataSource Controls :: When Use ##Temp Table In Stored Procedure, It Gives An Error?

Jun 15, 2010

i m using ##Temp Table in stored procedure..it gives this error There is already an object named '##people' in the database.in two codition1.in case of multisession2. if transaction drop in between even i drop Table in Last in stored procedure..what can i use in place of temp table to hold data for a time being

View 1 Replies

SQL Server :: Stored Procedure Is Not Passing In A Primary Key Into A Foriegn Key In Another Table?

Jul 14, 2010

I am a rookie developer here and I have tried looking around for an answer but I am little confused. I have a stored procedure that calls multiple stored procedures when I go to create a new contact.[Code]....

I though I could use the OUTPUT Command to copy out the NewContactID but I am getting all kinds of syntax errors. I am confused as to what I am missing here.

View 3 Replies

Configuration :: Method Not Found For New Table Adapter Using Stored Procedure

Aug 31, 2010

I am using table adapter in a dataset type (.xsd) file mapping to database. But I found after I created a new stored procedure in database and use table adapter mapping to the new stored procedure, I got method not found error like

Method not found: 'PO_GetNewOrdersSummaryDataTable BizTalk.Application.DataAccess.DatalayerTableAdapters.PO_GetNewOrdersSummaryTableAdapter.GetDataByCompletedDays(System.String, System.String, System.Nullable`1<Boolean>, System.Nullable`1<Boolean>, System.Nullable`1<Int32>)'.

on the testing server. But it is fine if I run the web application on my local dev machine and another machine we use it for building application before deployment. Does anyone know what could cause this problem on testing server? It works fine before I created the new method

GetDataByCompletedDays in PO_GetNewOrdersSummaryTableAdapter.

View 3 Replies

DataSource Controls :: Stored Procedure Does Not Indicate Table Returned In Dataset?

Apr 23, 2010

This may not be the correct place to put this as it is both a stored procedure AND Visual Studio 2008 problem.

I have the following stored procedure:

[Code]....

I have been mokeying around with it because of what is happening. I have a dataset, call it dataset1. I drag this stored procedure onto the dataset. I EXPECT a datatable to appear, instead the data set adds this store procedure to the queries table adapter and sets the exec mode to 'NonQuery' which unless I am very mistaken, means "don't expect a dataset back from this' when in fact you DO expect a dataset back from this.

The SQL server is a Windows 2000 Server running SQL 2000. It has never caused us a moments grief since we set it up oh-so-many years ago.

If I connect to a different database and drag a query into the same dataset I get a datatable as I expect. I cannot see where / how this procedure could be wrong. The query when executed returns exactly the data I expect, in the format I expect (looks like a table, acts like a table in the Query analyzer).

View 3 Replies

SQL Server :: Have A Stored Procedure Execute Another Stored Procedure During Time Period?

Jan 28, 2011

I could probably figure this out if I tried to, but I have been working so long on code, I'm a little fried

I have a stored procedure, and I want to execute another stored procedure during a time period of lets say 1/1/2011 to 12/31/2011

How Would I accomplish this?

View 4 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved