April 28, 2008 at 2:48 am
Hi team i am trying to fill #table form sp and i don't know , the following my statement:
the sp returned the columns in the #table.
create TABLE #TestTable (FunctionalityID int, PageCode nvarchar(250), NameE nvarchar(250), ControlType nvarchar(250), ControlName nvarchar(250))
INSERT INTO #TestTable(FunctionalityID , PageCode , NameE , ControlType , ControlName )
SELECT (execute [spNavigation_GetUnAuthorizedFunctionalities] 55)
thanx in advance
April 28, 2008 at 2:57 am
Hi
Whats it that you want to know
"Keep Trying"
April 28, 2008 at 3:01 am
i am but really i need help 🙁
April 28, 2008 at 3:17 am
We know that, but we don't know what help you need. Was the query you posted successful? If not, in what way was it not? Did it produce an error message, or did it not insert all the rows into the table that you expected?
John
April 28, 2008 at 3:23 am
Chandrachurh Ghosh (4/28/2008)
a #table has a local scope, so it will not work.....
Not true. A temp table will persist until it is dropped or the user connection terminates. There's no reason the query shouldn't work, unless the table is wrongly defined or the stored procedure produces more than one result set.
John
April 28, 2008 at 3:30 am
my temp table name is #TestTable
create TABLE #TestTable (FunctionalityID int, PageCode nvarchar(250), NameE nvarchar(250), ControlType nvarchar(250), ControlName nvarchar(250))
INSERT INTO #TestTable(FunctionalityID , PageCode , NameE , ControlType , ControlName )
(SELECT execute spNavigation_GetUnAuthorizedFunctionalities 55)
DROP TABLE #TestTable
in the previous statment i got the following error msg:
Incorrect syntax near the keyword 'execute'.
Incorrect syntax near ')'.
the statement sound good logically but its not working
April 28, 2008 at 3:33 am
Yes, I should have spotted this the first time. Just get rid of the SELECT and it should work.
If you ever get a syntax error message, your first port of call should be Books Online to check the syntax of the command you are using.
John
April 28, 2008 at 3:51 am
You cannot use -
INSERT INTO #TestTable(FunctionalityID , PageCode , NameE , ControlType , ControlName )
SELECT (execute [spNavigation_GetUnAuthorizedFunctionalities] 55)
You have to use -
INSERT INTO #TestTable(FunctionalityID , PageCode , NameE , ControlType , ControlName )
execute [spNavigation_GetUnAuthorizedFunctionalities] 55
and it will work only if the no. of columns and the data types are same.
Chandrachurh Ghosh
DBA – MS SQL Server
Ericsson India Global Services Limited
Quality is not an act, it is a habit.
April 28, 2008 at 4:06 am
yes its working now
thank u 🙂
Viewing 9 posts - 1 through 8 (of 8 total)
You must be logged in to reply to this topic. Login to reply