﻿<?xml version='1.0' encoding='UTF-8'?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>SQLServerCentral / SQL Server 2008 / T-SQL (SS2K8)  / Problem with inserting the data into temp table / Latest Posts</title><generator>InstantForum.NET v2.9.0</generator><description>SQLServerCentral</description><link>http://www.sqlservercentral.com/Forums/</link><webMaster>notifications@sqlservercentral.com</webMaster><lastBuildDate>Mon, 20 May 2013 16:07:48 GMT</lastBuildDate><ttl>20</ttl><item><title>RE: Problem with inserting the data into temp table</title><link>http://www.sqlservercentral.com/Forums/Topic1404610-392-1.aspx</link><description>[quote][b]John Mitchell-245523 (1/9/2013)[/b][hr]The your first statement should start IF NOT EXISTS, should it not?  In any case, please post the results of the following query:[code="sql"]SELECT * FROM tempdb.INFORMATION_SCHEMA.COLUMNSWHERE TABLE_NAME LIKE '#temp%'[/code]John[/quote]Ooppss.....My Apologies.</description><pubDate>Wed, 09 Jan 2013 03:45:40 GMT</pubDate><dc:creator>Shadab Shah</dc:creator></item><item><title>RE: Problem with inserting the data into temp table</title><link>http://www.sqlservercentral.com/Forums/Topic1404610-392-1.aspx</link><description>The your first statement should start IF NOT EXISTS, should it not?  In any case, please post the results of the following query:[code="sql"]SELECT * FROM tempdb.INFORMATION_SCHEMA.COLUMNSWHERE TABLE_NAME LIKE '#temp%'[/code]John</description><pubDate>Wed, 09 Jan 2013 03:23:48 GMT</pubDate><dc:creator>John Mitchell-245523</dc:creator></item><item><title>RE: Problem with inserting the data into temp table</title><link>http://www.sqlservercentral.com/Forums/Topic1404610-392-1.aspx</link><description>[quote][b]John Mitchell-245523 (1/9/2013)[/b][hr]The error is occurring in the stored procedure itself.  Do you get the same error if you run just the EXEC line?John[/quote]No, it is not giving me the error it is actually giving me the result of sp_spaceused</description><pubDate>Wed, 09 Jan 2013 02:44:50 GMT</pubDate><dc:creator>Shadab Shah</dc:creator></item><item><title>RE: Problem with inserting the data into temp table</title><link>http://www.sqlservercentral.com/Forums/Topic1404610-392-1.aspx</link><description>The error is occurring in the stored procedure itself.  Do you get the same error if you run just the EXEC line?John</description><pubDate>Wed, 09 Jan 2013 02:29:35 GMT</pubDate><dc:creator>John Mitchell-245523</dc:creator></item><item><title>Problem with inserting the data into temp table</title><link>http://www.sqlservercentral.com/Forums/Topic1404610-392-1.aspx</link><description>Hi all,I am trying to stored the output of sp_spaceused into a temp table as follow.[code="sql"]if exists (select 1 from sys.objects where object_id=OBJECT_ID(N'#TEMP'))create table #temp (name nvarchar(50),rows nvarchar(50),reserved nvarchar(50),data nvarchar(50),index_size nvarchar(50),unused nvarchar(50))insert into #temp exec sp_spaceused 'dbo.Emp'[/code]i am getting the  error as below[code="sql"]Msg 8114, Level 16, State 1, Procedure sp_spaceused, Line 178Error converting data type varchar to int.[/code]Now if we observed closely in my temp table there isn't any column with datatype as int.So i am not able to figure it out, why is it trying to convert the column to int when it can stored it nvarchar.</description><pubDate>Wed, 09 Jan 2013 02:24:24 GMT</pubDate><dc:creator>Shadab Shah</dc:creator></item></channel></rss>