April 14, 2016 at 1:01 pm
Hello All,
I have a situation where I have to pull data from many tables creating & merging multiple temp tables to create a final temp table in Sql Server 2008. The data is then copied to excel for analysis & reporting.
I want a solution using which I can create a table that can be used by multiple users for reporting and analytics on running the query everyday without actually having a DBA involved to create a permanent table in database?
Is this possible?
Also is it possible to extract the table from SQL server without having to copy in Excel as it is difficult to copy records greater than a million rows into excel?
Thanks.
April 14, 2016 at 1:12 pm
the public role has access to tempdb, so you could create a semi-permanent table that would exist until the sql service was stopped and started/server rebooted, by creating the table without the # sign.
CREATE TABLE tempdb.dbo.MyResults (ResultsId int,ResultsText varchar(30))
as far as extracting data, excel is a great tool, but even if it would handle ten million rows, you logically cannot review a million or more rows in it anyway, so leave it on the server and query/group the data instead.
don't export details at that level, would be the first thing i'd look at.
Lowell
April 14, 2016 at 1:14 pm
Thank you. Appreciate your help.
April 14, 2016 at 3:52 pm
I do not have the permissions to use tempdb.dbo.* for table name but # works. ANy work around it so that multiple sessions can use the temp table created.
Nikhil.
April 14, 2016 at 6:40 pm
Global temp tables will help ## instead of #.
Just keep in mind they will disappear with every sql service restart.
April 15, 2016 at 2:19 am
matak (4/14/2016)
Global temp tables will help ## instead of #.Just keep in mind they will disappear with every sql service restart.
And when the connection which created them closes and no one else is accessing the table.
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
April 15, 2016 at 11:21 am
Because of what GilaMonster brought up, get the DBA involved. Make a permanent table.
April 15, 2016 at 12:02 pm
And out of curiosity, why are you trying to back door the DBA? Not a good way to influence or make friends with a DBA.
April 15, 2016 at 12:14 pm
Lynn Pettis (4/15/2016)
And out of curiosity, why are you trying to back door the DBA? Not a good way to influence or make friends with a DBA.
Further on Lynn's question, why on earth would you do this knowing that any DBA would drop your login if caught in the act?
😎
Alternatively you could install SQL Express on your PC/Laptop/Tablet, load the data into it and work from there...
April 15, 2016 at 12:23 pm
Eirikur Eiriksson (4/15/2016)
Lynn Pettis (4/15/2016)
And out of curiosity, why are you trying to back door the DBA? Not a good way to influence or make friends with a DBA.Further on Lynn's question, why on earth would you do this knowing that any DBA would drop your login if caught in the act?
Where I work, this is the fastest way to a pink slip and a potential lawsuit. My employer is a big believer in database security and would fire anyone who didn't follow procedure, involve the DBAs, and get the job done correctly.
April 15, 2016 at 12:44 pm
Ask your DBA if she can create a special database for which you are the owner, so you can use it to create your tables and stage data for reporting purposes. Also, you could install and instance of SQL Server Express Edition either locally on your PC or somehwere on the network, and then coordinate with the DBA to grant other uers access to it. Express Edition is free and can support multiple users and up to 10 GB per database, which should be more than enough for staging small to medium sized datasets for reporting.
"Do not seek to follow in the footsteps of the wise. Instead, seek what they sought." - Matsuo Basho
Viewing 11 posts - 1 through 10 (of 10 total)
You must be logged in to reply to this topic. Login to reply