Benefit from a mission critical IT monitoring with Monitis Premium or get it FREE for your entry level monitoring needs.
-Over 200,000 users
-More than 300,000 websites monitored
-Used in 197 countries
-Recommended by 98% of users
if OBJECT_ID('tempdb..##tmpUserDBase') IS NOT NULL begin drop table ##tmpUserDBase end declare @dbase varchar(150) = 'testdbase' declare @ncode varchar(25) = 'DT10150' declare @period varchar(10) = 8 declare @year varchar(10) = 'C' declare @STR varchar(max) SET @STR =' SELECT '''+@dbase+''' as [DBASE] ,[DET_NOMINALDR] as [Nominal Code] ,[DET_DATE] as [Date] ,[DET_PERIODNUMBR] as [Period] ,[DET_YEAR] as [Year] ,[DET_DESCRIPTION] as [Narrative] ,[DET_NETT] as [D/C] FROM ' + @dbase + '.[dbo].[SL_PL_NL_DETAIL] WHERE [DET_NOMINALDR] = ''@ncode'' and [DET_PERIODNUMBR] = ''@period'' and [DET_YEAR] = ''@year'' ' create table ##tmpUserDBase (DBASE varchar(100) ,[Nominal Code] varchar(100) ,[Date] date ,[Period] varchar(100) ,[Year] varchar(1) ,[Narrative] varchar(250) ,[D/C] float) insert into ##tmpUserDBase exec (@STR) select * from ##tmpUserDBase
Add your voice to the tech community where 5M+ people just like you are talking about what matters.
Join the community of 500,000 technology professionals and ask your questions.