| Author |
Topic |
|
AShehzad
Starting Member
8 Posts |
Posted - 2008-11-11 : 04:56:21
|
| is it possible to apply filter on result set produced by a system sp? For example i have used a system stored procedure sp_fkeys tablenameIt produced several columns in result, and i am interested in just one or a couple of columns. Is there any way to get my required column out of that result set?RegardsAtif Shehzad DBA Pakistan Revenue Automation Limited |
|
|
spirit1
Cybernetic Yak Master
11752 Posts |
Posted - 2008-11-11 : 04:59:28
|
| not really. you'll have to insert the data into a temp table and then select from there._______________________________________________Causing trouble since 1980Blog: http://weblogs.sqlteam.com/mladenpSpeed up SSMS development: www.ssmstoolspack.com <- version 1.1 out! |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2008-11-11 : 05:12:20
|
| http://sqlblogcasts.com/blogs/madhivanan/archive/2007/11/26/select-columns-from-exec-procedure-name-is-this-possible.aspxMadhivananFailing to plan is Planning to fail |
 |
|
|
spirit1
Cybernetic Yak Master
11752 Posts |
Posted - 2008-11-11 : 05:14:09
|
| acctually the openrowset doesn't work for all system sprocs. sp_who is one of those if i remember correctly._______________________________________________Causing trouble since 1980Blog: http://weblogs.sqlteam.com/mladenpSpeed up SSMS development: www.ssmstoolspack.com <- version 1.1 out! |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2008-11-11 : 05:20:07
|
quote: Originally posted by spirit1 acctually the openrowset doesn't work for all system sprocs. sp_who is one of those if i remember correctly._______________________________________________Causing trouble since 1980Blog: http://weblogs.sqlteam.com/mladenpSpeed up SSMS development: www.ssmstoolspack.com <- version 1.1 out!
It works for meMay be not supported in 2000?MadhivananFailing to plan is Planning to fail |
 |
|
|
lionofdezert
Aged Yak Warrior
885 Posts |
Posted - 2008-11-11 : 05:31:13
|
| CREATE TABLE #TMPtable ( PKTABLE_QUALIFIER VARCHAR(100) , PKTABLE_OWNER VARCHAR(100), PKTABLE_NAME VARCHAR(100), PKCOLUMN_NAME VARCHAR(100), FKTABLE_QUALIFIER VARCHAR(100), FKTABLE_OWNER VARCHAR(100), FKTABLE_NAME VARCHAR(100), FKCOLUMN_NAME VARCHAR(100), KEY_SEQ VARCHAR(100), UPDATE_RULE VARCHAR(100), DELETE_RULE VARCHAR(100), FK_NAME VARCHAR(100), PK_NAME VARCHAR(100), DEFERRABILITY VARCHAR(100) )INSERT INTO #TMPtableEXEC sp_fkeys'transactions.intiqal'SELECT PKTABLE_NAME,FK_NAME,PK_NAME FROM #TMPtableDROP TABLE #TMPtable |
 |
|
|
spirit1
Cybernetic Yak Master
11752 Posts |
Posted - 2008-11-11 : 05:36:14
|
quote: Originally posted by madhivanan
quote: Originally posted by spirit1 acctually the openrowset doesn't work for all system sprocs. sp_who is one of those if i remember correctly._______________________________________________Causing trouble since 1980Blog: http://weblogs.sqlteam.com/mladenpSpeed up SSMS development: www.ssmstoolspack.com <- version 1.1 out!
It works for meMay be not supported in 2000?MadhivananFailing to plan is Planning to fail
ahh it was sp_who2_______________________________________________Causing trouble since 1980Blog: http://weblogs.sqlteam.com/mladenpSpeed up SSMS development: www.ssmstoolspack.com <- version 1.1 out! |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2008-11-11 : 05:58:21
|
quote: Originally posted by spirit1
quote: Originally posted by madhivanan
quote: Originally posted by spirit1 acctually the openrowset doesn't work for all system sprocs. sp_who is one of those if i remember correctly._______________________________________________Causing trouble since 1980Blog: http://weblogs.sqlteam.com/mladenpSpeed up SSMS development: www.ssmstoolspack.com <- version 1.1 out!
It works for meMay be not supported in 2000?MadhivananFailing to plan is Planning to fail
ahh it was sp_who2_______________________________________________Causing trouble since 1980Blog: http://weblogs.sqlteam.com/mladenpSpeed up SSMS development: www.ssmstoolspack.com <- version 1.1 out!
sp_who2 returns two columns with same name (SPID) and thats why it doesnt workMadhivananFailing to plan is Planning to fail |
 |
|
|
spirit1
Cybernetic Yak Master
11752 Posts |
Posted - 2008-11-11 : 06:05:53
|
yeah... kind of figured that now. thanx. _______________________________________________Causing trouble since 1980Blog: http://weblogs.sqlteam.com/mladenpSpeed up SSMS development: www.ssmstoolspack.com <- version 1.1 out! |
 |
|
|
|