Showing posts with label complex. Show all posts
Showing posts with label complex. Show all posts

Sunday, March 11, 2012

Displaying multiple records from one record

Hi there,

I've a complex stored procedure, which I'm trying to get a list of one or more users based the list of records that are being display. If I mentioned the overall store procedure here it'll turn you off, so I'll put the questions in bitesize chunks.

Example would be if Bob and Luke work for Acrm Corp and John for Maxwellarms Ltd, and there was an intimediate table which linked both. With my stored procedure I want to display both names in the same row as Acrm Corp. Is there a way to do this?

User table
Userid Username

1 Bob
2 Luke
3 John

Store procedure result
Companyname Username

Acrm Corp Null
Maxwellarm Ltd Null

Regards,

Since my last post, I found that the CMS is storing individual ids.

Still it would be nice to know how others are doing this.

An addition to my post above, I believe if I wanted more than one firstname and surname to appear in the columns, that I would have to create a different stored procedure retrieving the unique id from the first stored procedure.

Tuesday, February 14, 2012

Display estimated execution plan problem

Hi all,
I have a complex query inside a stored procedure. When I try to see the
estimated query plan from Query Analyzer it hangs (I wait for at least one
minute).
When I stoped the QA with the red button it answers with a syntax error...
But there aren't syntax errors... I tried to do the same in another
environment and all things work.
Any idea?
Thank you very much!!
Alexandre Calderaro
Avanade Italy
Hi Alex my colleage :-)
Same Compatibility level ? If you use another compat. level some
statements might not be able to compile.
HTH, Jens K. Suessmeyer.
http://www.sqlserver2005.de