473,324 Members | 2,196 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,324 software developers and data experts.

Dynamic and complex query(C#+sql server2000)

Joe
Dear Friends,

How do write the below dynamic update Query? I am new to this SQL Query.Its
very very urgent requirements.
If anyone knows please help me the below SQL query.
I would appreciate any help.

UpdateEmployee()

FieldName datatYpe

EmpName - string
EmpNo - int
Sex - string
Salary - Float
DoB - datetime
Address - string
Remarks - string
hours - int
AvailableDate -dtatetime

Passed Parameters: EmpNo or EmpName, sex, Salary, DOB, Address,
Remarks,hours, AvailableDate

Please note, this method is overloaded. Although either the EmpNo or
EmpName is required in order to select the Employee record, one or more of
the other variables may be passed.

Return Parameters: ErrorCode

Pseudo Code:

1. Confirm that either the EmpNo or the EmpName exists in the database

2. Confirm that at least one other parameter is passed

3. Confirm that all passed parameters are of the correct data type

4. Update the Employee Table using the Passed Parameters to modify the
fields
Thanks,
Nov 16 '05 #1
1 1403
When you drop an oledbdataadapter on a form, the designer will create
connection object and generate update, delete, insert and select statements
for you. Then switch to code view and expand initializecomponents() method.
You'll see what your looking for in there.

Also, make sure you have an ODBC connection setup for target database
because designer will ask for it.

Charlie


"Joe" <ra********@hotmail.com> wrote in message
news:eI**************@TK2MSFTNGP10.phx.gbl...
Dear Friends,

How do write the below dynamic update Query? I am new to this SQL Query.Its very very urgent requirements.
If anyone knows please help me the below SQL query.
I would appreciate any help.

UpdateEmployee()

FieldName datatYpe

EmpName - string
EmpNo - int
Sex - string
Salary - Float
DoB - datetime
Address - string
Remarks - string
hours - int
AvailableDate -dtatetime

Passed Parameters: EmpNo or EmpName, sex, Salary, DOB, Address,
Remarks,hours, AvailableDate

Please note, this method is overloaded. Although either the EmpNo or
EmpName is required in order to select the Employee record, one or more of
the other variables may be passed.

Return Parameters: ErrorCode

Pseudo Code:

1. Confirm that either the EmpNo or the EmpName exists in the database

2. Confirm that at least one other parameter is passed

3. Confirm that all passed parameters are of the correct data type

4. Update the Employee Table using the Passed Parameters to modify the
fields
Thanks,

Nov 16 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Marcus | last post by:
Hi I have a very complex sql query and a explain plan. I found there is a full table scan in ID=9 9 8 TABLE ACCESS (FULL) OF 'F_LOTTXNHIST' (Cost=84573 Card=185892...
1
by: Guinness Mann | last post by:
When you guys talk about "dynamic SQL," to what exactly are you referring? Is dynamic SQL anything that isn't a stored procedure? Specifically, I use ASP.NET to communicate with my SQL Server...
5
by: Ralph | last post by:
Hi all, I'm a newbie to MS-SQL UDFs and seem to have a real big problem. I need to implement a logic to receive an adress build out of various user definable fields from various user defined...
7
by: Jack | last post by:
Hi, I am trying to test a sql statement in Access which gives me the error as stated in the heading. The sql statement is built as a part of asp login verification, where the userid and password...
4
by: Tim.D | last post by:
People, I've ventured into the wonderful world of Stored Procedures. My first experience has been relatively successful however I am stuck on using host variables to specifiy actualy table or...
3
by: Peter Bailey | last post by:
Could someone please tell me how to pass criteria as if it were a parameter. I have a routine now that creates the sql string (well almost). at present the parameter is so I can pass one item ie...
0
by: leileili | last post by:
Hello, I'm new in dynamic SQL query and I have a problem need help. For example: I have a SQL query like this: select hw.family,hw.id where hw.id="1234567"; and I have a txt file holding...
6
by: MattC | last post by:
Hi, I'm implementing a new Business Layer in one of our applications. I'm toying with the idea of placing all the Create, Read, Update and Delete SQL in the object in question and build a...
3
by: topmind | last post by:
I am generally new to dot.net, coming from "scriptish" web languages such as ColdFusion and Php. I have a few questions if you don't mind. First, how does one go about inserting dynamic SQL...
11
by: Ronald S. Cook | last post by:
I've read a few posts on the stored procedure vs dynamic sql debate. I ran a few performance test for myself and it appears to be a wash. Given that, I'm leaning toward dynamic sql mostly...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.