Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 Development Tools
 ASP.NET
 Storing 85 fieds into SqlServer

Author  Topic 

rajeev.dhawan
Starting Member

5 Posts

Posted - 2007-06-08 : 07:11:34
Hi
I want a best solution as per performance point of view.
My problem is I have a table in Sqlserver which is storing data in 85 fields. All the data is available on a ASPX Page in the form of static TextBox controls(ASP:Button).

I want to Press a Button and data should be stored.

spirit1
Cybernetic Yak Master

11752 Posts

Posted - 2007-06-08 : 07:16:47
create a stored procedure with 85 parameters and pass the textbox values in...

although let me say that 85 textboxes on one page is a really bad UI

_______________________________________________
Causing trouble since 1980
blog: http://weblogs.sqlteam.com/mladenp
Go to Top of Page

rajeev.dhawan
Starting Member

5 Posts

Posted - 2007-06-08 : 07:19:11
Yes this I know its a bad GUI. But its the requirement of the Client.
Boss I am affraiding from creating stored procedure for 85 fiels. I am following 3 tier archi. And It is a tedious task to create a storedprocedure with 85 parameters. and 85 prarameters from a function
Go to Top of Page

spirit1
Cybernetic Yak Master

11752 Posts

Posted - 2007-06-08 : 07:41:22
well that's the way to go... i don't know what are you affraid of.

_______________________________________________
Causing trouble since 1980
blog: http://weblogs.sqlteam.com/mladenp
Go to Top of Page

rajeev.dhawan
Starting Member

5 Posts

Posted - 2007-06-08 : 07:49:22
I Am thinking a solution that if i pass XML string to a stored procedure with EID and stored proedure first delete the record of that EID and insert a new one based on XML string.

CAN u help me to achive this.
Go to Top of Page

spirit1
Cybernetic Yak Master

11752 Posts

Posted - 2007-06-08 : 08:01:47
that is ridicolous.

what's wrong with just using paramteres?

_______________________________________________
Causing trouble since 1980
blog: http://weblogs.sqlteam.com/mladenp
Go to Top of Page

jsmith8858
Dr. Cross Join

7423 Posts

Posted - 2007-06-08 : 08:38:13
You should really look at your database design as well ... 85 columns in 1 table? You should try to normalize your schema:

http://www.datamodel.org/NormalizationRules.html

- Jeff
http://weblogs.sqlteam.com/JeffS
Go to Top of Page

jsmith8858
Dr. Cross Join

7423 Posts

Posted - 2007-06-08 : 08:40:37
This is also appears to be in danger of following a classic programming "anti-pattern":

Programmer wants to do things the "easy way" instead of using best practices and the most straightforward methods, so they end up adding layers and layers of complexity and complication to their project to avoid the direct approach, and it ends up much longer, much more confusing, and it ends up being much more work that takes much longer.

beware!

- Jeff
http://weblogs.sqlteam.com/JeffS
Go to Top of Page

Kristen
Test

22859 Posts

Posted - 2007-06-08 : 10:28:36
"I am affraiding from creating stored procedure for 85 fiels"

You can ask SQL Server (or the Dev Tool you are using etc. etc.) to give you a list of the column names, that makes it real easy to make the Parameter List, the INSERT statement Column List and the UPDATE statement Column List.

I can't remember the last time I typed a list of column names for that sort of a job - I always query the database, and then delete (or often just comment out) the ones I don't want.

(If that's the bit that it annoying you??)

Kristen
Go to Top of Page

spirit1
Cybernetic Yak Master

11752 Posts

Posted - 2007-06-08 : 10:53:58
plus there are several tools out there for CRUD generation.
search on google...

_______________________________________________
Causing trouble since 1980
blog: http://weblogs.sqlteam.com/mladenp
Go to Top of Page

rudesyle
Posting Yak Master

110 Posts

Posted - 2007-06-11 : 13:01:48
quote:
Originally posted by rajeev.dhawan

Yes this I know its a bad GUI. But its the requirement of the Client.
Boss I am affraiding from creating stored procedure for 85 fiels. I am following 3 tier archi. And It is a tedious task to create a storedprocedure with 85 parameters. and 85 prarameters from a function



To answer your question, yes you can do this. Just look up the OPENXML function in sql server.
Go to Top of Page
   

- Advertisement -