|
database
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Need to do the following...any suggestions?i need to be able to run the following code
SELECT NULL, 'N/A', 0 UNION EXEC spListSubgroupsByGroupID @param Basically, I need to add an additonal row to the results that enters a null value. I cannot change the spListSubgroupsByGroupID stored procedure. any suggestions? thanks. I think the only way to do this is to use a table.
Create a table that matches the result set returned by the stored procedure. INSERT ThatTable VALUES(NULL, 'N/A', 0) INSERT ThatTable EXEC spListSubgroupsByGroupID @param SELECT * FROM ThatTable Roy Harvey Beacon Falls, CT On Wed, 3 May 2006 12:30:02 -0700, Ben <ben_1_ AT hotmail DOT com> wrote: Show quote >i need to be able to run the following code > >SELECT NULL, 'N/A', 0 >UNION >EXEC spListSubgroupsByGroupID @param > >Basically, I need to add an additonal row to the results that enters a null >value. I cannot change the spListSubgroupsByGroupID stored procedure. > >any suggestions? >thanks. Thank you for the repsonces. They both worked.
Show quote "Roy Harvey" wrote: > I think the only way to do this is to use a table. > > Create a table that matches the result set returned by the stored > procedure. > > INSERT ThatTable VALUES(NULL, 'N/A', 0) > > INSERT ThatTable > EXEC spListSubgroupsByGroupID @param > > SELECT * FROM ThatTable > > Roy Harvey > Beacon Falls, CT > > On Wed, 3 May 2006 12:30:02 -0700, Ben <ben_1_ AT hotmail DOT com> > wrote: > > >i need to be able to run the following code > > > >SELECT NULL, 'N/A', 0 > >UNION > >EXEC spListSubgroupsByGroupID @param > > > >Basically, I need to add an additonal row to the results that enters a null > >value. I cannot change the spListSubgroupsByGroupID stored procedure. > > > >any suggestions? > >thanks. > CREATE TABLE #foo
( col1 datatype, col2 VARCHAR(whatever), col3 INT ); INSERT #foo EXEC spListSubgroupsByGroupID @param; SELECT col1 = NULL, col1 = 'N/A', col1 = 0 UNION SELECT col1,col2,col3 FROM #foo; DROP TABLE #foo; Show quote "Ben" <ben_1_ AT hotmail DOT com> wrote in message news:9889B10F-1F27-4B20-982F-781B6DBD326F@microsoft.com... >i need to be able to run the following code > > SELECT NULL, 'N/A', 0 > UNION > EXEC spListSubgroupsByGroupID @param > > Basically, I need to add an additonal row to the results that enters a > null > value. I cannot change the spListSubgroupsByGroupID stored procedure. > > any suggestions? > thanks. |
|||||||||||||||||||||||