Click here to Skip to main content
15,939,960 members
Home / Discussions / Database
   

Database

 
QuestionHow to insert data from MS SQL server in MS EXCEL Sheet? Pin
guriqbal8717-Jul-08 4:22
guriqbal8717-Jul-08 4:22 
AnswerRe: How to insert data from MS SQL server in MS EXCEL Sheet? Pin
leoinfo17-Jul-08 5:17
leoinfo17-Jul-08 5:17 
GeneralRe: How to insert data from MS SQL server in MS EXCEL Sheet? Pin
guriqbal8720-Jul-08 20:50
guriqbal8720-Jul-08 20:50 
AnswerCross Post Pin
Paul Conrad17-Jul-08 16:51
professionalPaul Conrad17-Jul-08 16:51 
QuestionSending Email Pin
jonhbt17-Jul-08 3:38
jonhbt17-Jul-08 3:38 
AnswerRe: Sending Email Pin
Wendelius17-Jul-08 8:06
mentorWendelius17-Jul-08 8:06 
QuestionNested Cursor loop problem Pin
Member 387988117-Jul-08 3:25
Member 387988117-Jul-08 3:25 
AnswerRe: Nested Cursor loop problem Pin
Mark J. Miller17-Jul-08 9:27
Mark J. Miller17-Jul-08 9:27 
One possibile problem is that you are calling FETCH NEXT on your inner cursor at the start of the inner loop. Move the call from the start to the end.

Also, why are you inserting records like

INSERT INTO @Result VALUES (@mgID, @EmpDetail)

When @EmpDetail is a comma separated list of values? There really isn't any reason to do this when you are using a relational database. The relationship between Manager and Employee is maintained when you do this:

CREATE TABLE Manager(
ManagerID INT,
ManagerName VARCHAR(50)
)

CREATE TABLE Employee(
EmployeeID INT,
ManagerID INT,
EmployeeName VARCHAR(50)
)


Then when you want to get data from both tables you do this:
DECLARE @EmployeeID INT
SET @EmployeeID = 5

SELECT EmployeeID,
EmployeeName,
ManagerName
FROM Employee E
INNER JOIN Manager M ON M.ManagerID = E.ManagerID
WHERE EmployeeID = @EmployeeID

When you try and maintain a delimited list in a column you're breaking normalization and it will make the data a nightmare to maintain. If you need to enforce the relationships between tables, create foreign key references and they will prevent you from corrupting the relationships you've defined. If you're going to define your data the way it seems you are, you might as well be using Excel or just plain text files.

Code responsibly: OWASP.org
Mark's blog: developMENTALmadness.blogspot.com

GeneralRe: Nested Cursor loop problem [modified] Pin
Member 387988117-Jul-08 19:59
Member 387988117-Jul-08 19:59 
GeneralRe: Nested Cursor loop problem Pin
Mark J. Miller18-Jul-08 5:20
Mark J. Miller18-Jul-08 5:20 
QuestionCompact database not working Pin
krishnan.s17-Jul-08 2:41
krishnan.s17-Jul-08 2:41 
AnswerRe: Compact database not working Pin
Paul Conrad17-Jul-08 16:51
professionalPaul Conrad17-Jul-08 16:51 
QuestionNot In operation? Pin
Member 387988117-Jul-08 1:03
Member 387988117-Jul-08 1:03 
AnswerRe: Not In operation? Pin
TheFM23417-Jul-08 3:00
TheFM23417-Jul-08 3:00 
GeneralRe: Not In operation? Pin
Member 387988117-Jul-08 3:09
Member 387988117-Jul-08 3:09 
Questionselect datas using union operation Pin
deepthy.p.m16-Jul-08 22:48
deepthy.p.m16-Jul-08 22:48 
AnswerRe: select datas using union operation Pin
Vimalsoft(Pty) Ltd17-Jul-08 0:50
professionalVimalsoft(Pty) Ltd17-Jul-08 0:50 
Questionreturn Table name + Column Name in sql query Pin
farabba16-Jul-08 20:51
farabba16-Jul-08 20:51 
AnswerRe: return Table name + Column Name in sql query Pin
Harvey Saayman16-Jul-08 23:01
Harvey Saayman16-Jul-08 23:01 
GeneralRe: return Table name + Column Name in sql query Pin
Mycroft Holmes17-Jul-08 20:08
professionalMycroft Holmes17-Jul-08 20:08 
GeneralRe: return Table name + Column Name in sql query Pin
Harvey Saayman17-Jul-08 20:19
Harvey Saayman17-Jul-08 20:19 
GeneralRe: return Table name + Column Name in sql query Pin
Mycroft Holmes17-Jul-08 20:44
professionalMycroft Holmes17-Jul-08 20:44 
AnswerRe: return Table name + Column Name in sql query Pin
MBCDC21-Jul-08 0:39
MBCDC21-Jul-08 0:39 
Questiondynamically applyin styles based on DB Value to reports Pin
ch.ramesh16-Jul-08 19:06
ch.ramesh16-Jul-08 19:06 
AnswerRe: dynamically applyin styles based on DB Value to reports Pin
Ashfield16-Jul-08 20:13
Ashfield16-Jul-08 20:13 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.