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
 SQL Server 2008 Forums
 Transact-SQL (2008)
 How to stored data at the same time with Stored pr

Author  Topic 

programer
Posting Yak Master

221 Posts

Posted - 2012-01-03 : 16:19:13
Hello,

I would like to know how to stored data at the same time.

My code:
INSERT INTO dbo.tbl_PaymentDetails
(PaymentTypeID,
AttributeName,
Value)
VALUES (@PaymentTypeID,
@AttributeName,
@Value)


PaymentTypeID,AttribiteName, Value
22,SWIFT, DIASJD
22,BANK, JKDIASOD

When i called stored proceduro be must at the same time to stored:
22,SWIFT, DIASJD
22,BANK, JKDIASOD

How to do it?

Regards

X002548
Not Just a Number

15586 Posts

Posted - 2012-01-03 : 16:35:27
POST DDL

Sample Data in DML Form (check, already done, I Guess)

Post Expected Results

Brett

8-)

Hint: Want your questions answered fast? Follow the direction in this link
http://weblogs.sqlteam.com/brettk/archive/2005/05/25/5276.aspx


Want to help yourself?

http://msdn.microsoft.com/en-us/library/ms130214.aspx

http://weblogs.sqlteam.com/brettk/

http://brettkaiser.blogspot.com/


Go to Top of Page

programer
Posting Yak Master

221 Posts

Posted - 2012-01-03 : 17:18:28
quote:
Originally posted by X002548

POST DDL

Sample Data in DML Form (check, already done, I Guess)

Post Expected Results

Brett

8-)

Hint: Want your questions answered fast? Follow the direction in this link
http://weblogs.sqlteam.com/brettk/archive/2005/05/25/5276.aspx


Want to help yourself?

http://msdn.microsoft.com/en-us/library/ms130214.aspx

http://weblogs.sqlteam.com/brettk/

http://brettkaiser.blogspot.com/






Sorry, I don't understand your answer??
Go to Top of Page

GilaMonster
Master Smack Fu Yak Hacker

4507 Posts

Posted - 2012-01-03 : 17:34:06
He's asking for table definitions (DDL). The CREATE TABLE statements.

Also, I'm not clear what you're asking

--
Gail Shaw
SQL Server MVP
Go to Top of Page

programer
Posting Yak Master

221 Posts

Posted - 2012-01-03 : 17:40:32
quote:
Originally posted by GilaMonster

He's asking for table definitions (DDL). The CREATE TABLE statements.

Also, I'm not clear what you're asking

--
Gail Shaw
SQL Server MVP



How to stored more data in the column same AttributeName at the same time?
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2012-01-03 : 18:05:49
Here you go:

INSERT INTO dbo.tbl_PaymentDetails (PaymentTypeID, AttributeName, Value)
SELECT 22,SWIFT, DIASJD UNION ALL
SELECT 22,BANK, JKDIASOD

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page

GilaMonster
Master Smack Fu Yak Hacker

4507 Posts

Posted - 2012-01-04 : 04:28:06
By the way, that looks like some form of EAV design (entity, attribute, value). Those kinds of design are typically a nightmare to work with, to query and are hell on performance.

--
Gail Shaw
SQL Server MVP
Go to Top of Page

programer
Posting Yak Master

221 Posts

Posted - 2012-01-04 : 04:35:14
quote:
Originally posted by GilaMonster

By the way, that looks like some form of EAV design (entity, attribute, value). Those kinds of design are typically a nightmare to work with, to query and are hell on performance.

--
Gail Shaw
SQL Server MVP



What do you mean by that: ?
By the way, that looks like some form of EAV design (entity, attribute, value). Those kinds of design are typically a nightmare to work with, to query and are hell on performance.
Go to Top of Page

GilaMonster
Master Smack Fu Yak Hacker

4507 Posts

Posted - 2012-01-04 : 06:03:39
Exactly what I said.

This looks like a type of EAV table. (google for details of EAV if you don't know what I'm talking about). EAV tables are generally a pain to work with. They generally are harder to query than a properly designed table and perform worse. They can look very promising to people who don't know that much about database design, they appear to be a excellent solution to all sorts of problems (unknown attributes being the main one), but they don't live up to that promise.

--
Gail Shaw
SQL Server MVP
Go to Top of Page

programer
Posting Yak Master

221 Posts

Posted - 2012-01-04 : 07:15:00
quote:
Originally posted by GilaMonster

Exactly what I said.

This looks like a type of EAV table. (google for details of EAV if you don't know what I'm talking about). EAV tables are generally a pain to work with. They generally are harder to query than a properly designed table and perform worse. They can look very promising to people who don't know that much about database design, they appear to be a excellent solution to all sorts of problems (unknown attributes being the main one), but they don't live up to that promise.

--
Gail Shaw
SQL Server MVP



If I understand correctly I would not want to create a database so?
In this case for each payment system to make a new table?
I was thinking that is better solution if i create one table for payment systems?
Go to Top of Page

programer
Posting Yak Master

221 Posts

Posted - 2012-01-04 : 07:22:09
quote:
Originally posted by GilaMonster

Exactly what I said.

This looks like a type of EAV table. (google for details of EAV if you don't know what I'm talking about). EAV tables are generally a pain to work with. They generally are harder to query than a properly designed table and perform worse. They can look very promising to people who don't know that much about database design, they appear to be a excellent solution to all sorts of problems (unknown attributes being the main one), but they don't live up to that promise.

--
Gail Shaw
SQL Server MVP



Hello again,

i read about EAV table: http://en.wikipedia.org/wiki/Entity%E2%80%93attribute%E2%80%93value_model

Could you send a table with some data?

CREATE TABLE EAV and enter some of data?
Go to Top of Page
   

- Advertisement -