daily pastebin goal
83%
SHARE
TWEET

Untitled

a guest May 16th, 2018 102 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. exec DWH..create_views 'MRQuestionsWithoutAnswers'
  2.  
  3. ----------------------------------------------------------------------------------------
  4. -- Server dwhru221: Creating standard report
  5. ----------------------------------------------------------------------------------------
  6. begin try
  7.     -- begin transaction
  8.     delete from dwhru23.meta.dbo.ReportOnlyTables where tablename = 'MRQuestionsWithoutAnswers'
  9.     delete from dwhru23.meta.dbo.ReportOnlyParams where tablename = 'MRQuestionsWithoutAnswers'
  10.     delete from dwhru23.meta.dbo.ReportOnlyColumns where tablename = 'MRQuestionsWithoutAnswers'
  11.  
  12.     insert into dwhru23.meta.dbo.ReportOnlyTables(tablename, logicalpartition, accesspolicy,
  13.         defaultaggregate, enablemultiplierparameter, hasdaylevel, hasdetaillevel, project,
  14.         hashostcolumn, logstablename, islistbyenabled, insql, indruid, enabletarget)
  15.     select 'MRQuestionsWithoutAnswers', 1054, 'default', 'Sum', 0, 3, 0, 'OK', 0, 'MRQuestionsWithoutAnswers', 0, 3, 0, 0
  16.  
  17.  
  18.     insert into dwhru23.meta.dbo.ReportOnlyColumns (tablename, [column], pos) values ('MRQuestionsWithoutAnswers', 'h3_without_answer', '1')
  19.     insert into dwhru23.meta.dbo.ReportOnlyColumns (tablename, [column], pos) values ('MRQuestionsWithoutAnswers', 'h6_without_answer', '2')
  20.     insert into dwhru23.meta.dbo.ReportOnlyColumns (tablename, [column], pos) values ('MRQuestionsWithoutAnswers', 'h12_without_answer', '3')
  21.     insert into dwhru23.meta.dbo.ReportOnlyColumns (tablename, [column], pos) values ('MRQuestionsWithoutAnswers', 'h24_without_answer', '4')
  22.     insert into dwhru23.meta.dbo.ReportOnlyColumns (tablename, [column], pos) values ('MRQuestionsWithoutAnswers', 'h96_without_answer', '5')
  23.  
  24.     -- commit
  25.  
  26.     exec dwhru221.meta.dbo.etl_meta -- sync metadata
  27.     exec dwhru221.[dwh-charts].dbo.etl_standard_reports -- sync metadata
  28.     select * from dwhru221.meta.dbo.ReportOnlyTables where tablename = 'MRQuestionsWithoutAnswers'
  29.     select * from dwhru221.meta.dbo.ReportOnlyParams where tablename = 'MRQuestionsWithoutAnswers'
  30.     select * from dwhru221.meta.dbo.ReportOnlyColumns where tablename = 'MRQuestionsWithoutAnswers'
  31.  
  32. end try
  33. begin catch
  34.     if @@trancount > 0 begin
  35.         rollback transaction
  36.     end
  37. end catch
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top