473,395 Members | 1,941 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

How to store the result set in temp table

rsrinivasan
221 100+
Hi all,

When i run below statement, i get some result set. But i want to store the results sets in some temp table. How can i store it?

Expand|Select|Wrap|Line Numbers
  1. DBCC SHOWCONTIG ('table_name') WITH TABLERESULTS
Thanks,
Aug 20 '08 #1
5 5253
ck9663
2,878 Expert 2GB
You might need to get the info you need from one of the system tables or system views.

-- CK
Aug 20 '08 #2
rsrinivasan
221 100+
You might need to get the info you need from one of the system tables or system views.

-- CK
So what to do for this to store this result in some temp table. I do not have any idea to implement this. please suggest some way to do this.
Aug 21 '08 #3
JinxT
9
Hi,

Take a look at this link :
http://www.sqlservercentral.com/Forums/Topic550007-5-1.aspx

J.
Aug 21 '08 #4
ck9663
2,878 Expert 2GB
JinxT is right, it can be done :)

Check sample E from here

specifically, the lines:

Expand|Select|Wrap|Line Numbers
  1. BEGIN
  2. -- Do the showcontig of all indexes of the table
  3.    INSERT INTO #fraglist 
  4.    EXEC ('DBCC SHOWCONTIG (''' + @tablename + ''') 
  5.       WITH FAST, TABLERESULTS, ALL_INDEXES, NO_INFOMSGS')
  6.    FETCH NEXT
  7.       FROM tables
  8.       INTO @tablename
  9. END

-- CK
Aug 21 '08 #5
rsrinivasan
221 100+
JinxT is right, it can be done :)

Check sample E from here

specifically, the lines:

Expand|Select|Wrap|Line Numbers
  1. BEGIN
  2. -- Do the showcontig of all indexes of the table
  3.    INSERT INTO #fraglist 
  4.    EXEC ('DBCC SHOWCONTIG (''' + @tablename + ''') 
  5.       WITH FAST, TABLERESULTS, ALL_INDEXES, NO_INFOMSGS')
  6.    FETCH NEXT
  7.       FROM tables
  8.       INTO @tablename
  9. END

-- CK
Thanks for it. It is working fine.
Aug 25 '08 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

11
by: Surajit Laha | last post by:
I am firing a query like: SELECT TaskName, StartDate FROMTasks WHERE StartDate >= '01-Aug-2003' Now the result comes as: TaskName StartDate -------------------------- Task1 ...
3
by: thirdman | last post by:
I'm trying to write a SQL that stores a result from a stored-procedure into a temporary table. Is there any way of doing this?
1
by: Alessandro | last post by:
Hi, here is the problem... I must create a store procedure that do the following... 1. select id_name,...'some other field' from table 'data' where 'criteria' = @parameter 2. use the result...
1
by: Karl.Auer | last post by:
Hello group! i have a table "group_code" wich relates the names of nt-(domain)-groups to codes. now i want use the stored procedure xp_logininfo (asking for the group-membership of the current...
8
by: gacuna | last post by:
i want to insert into a temporal table the result of a store procedure. on sql server the sentence would look like this (already working) INSERT INTO #SHIPINFO exec TESTDTA.S59RSH05 @SCBILLTO,...
9
by: serge | last post by:
/* Subject: How to build a procedure that returns different numbers of columns as a result based on a parameter. You can copy/paste this whole post in SQL Query Analyzer or Management Studio...
4
by: ipez75 | last post by:
Hello everyone, I have a web application written in asp 6.0, my problem is that I execute a sql server store procedure and I get an empty recordset, while executing the same sp on query anlyzer I...
0
by: Mark C. Stock | last post by:
"Mark C. Stock" <mcstockX@Xenquery .comwrote in message news:... | | "Berend" <Berend.Brinkhuis@evatone.comwrote in message | news:bdd9ac20.0401271301.22cdb65e@posting.google.com... | | I am...
13
by: tekinalp67 | last post by:
hi, i am trying to implement a B+ tree. There is no specification in the implementation so i am using arrays to implement the B+ tree. However, there is a problem that i encountered which is I...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.