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
 General SQL Server Forums
 New to SQL Server Programming
 Capturing only a part of SP result

Author  Topic 

riya.johnson
Starting Member

17 Posts

Posted - 2009-09-17 : 08:01:38
Hi,

I am running
exec sp_configure "Cross DB Ownership Chaining"

Now I want to display on the current setting in the database.
So I want only run_value to be displayed & ignore the other columns.

Please guide me

Regards
Riya

Riya Johnson

DonAtWork
Master Smack Fu Yak Hacker

2167 Posts

Posted - 2009-09-17 : 08:02:42
display where? Filter the results in your front end.

http://weblogs.sqlteam.com/jeffs/archive/2008/05/13/question-needed-not-answer.aspx
How to ask: http://weblogs.sqlteam.com/brettk/archive/2005/05/25.aspx

For ultra basic questions, follow these links.
http://www.sql-tutorial.net/
http://www.firstsql.com/tutor.htm
http://www.w3schools.com/sql/default.asp
Go to Top of Page

Lumbago
Norsk Yak Master

3271 Posts

Posted - 2009-09-17 : 10:34:00
[code]DECLARE @mytable table (
name varchar(100),
minimum int,
maximum int,
config_value int,
run_value int
)

INSERT INTO @mytable
exec sp_configure "Cross DB Ownership Chaining"

select run_value from @mytable[/code]

- Lumbago
Go to Top of Page

riya.johnson
Starting Member

17 Posts

Posted - 2009-09-18 : 00:52:08
Its not working. It is displaying the following message

"EXECUTE cannot be used as a source when inserting into a table variable."

Riya Johnson
Go to Top of Page

timmy
Master Smack Fu Yak Hacker

1242 Posts

Posted - 2009-09-18 : 01:36:26
Change Lumbago's script from using a table variable to using a temp table:

CREATE TABLE #Mytable
instead of
DECLARE @myTable TABLE

Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2009-09-18 : 02:25:02
Note that outputing to table variable by executing the procedure works only from the version 2005

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page
   

- Advertisement -