How To Get A Result Set Fron One Server To Another

Jun 10, 2008

Hi,

I would like to know what are the possibilities if I want to:

- run a query on the tables of the server S1
- load a result set to the server S2

On the server S2, I have a linked server for S1, but it takes much more time to execute the query on S2 via linked server than on S1 . I would prefer something like the code would be executed on S1 and (only) the result set would be transferred to S2.

I already have seen a code somewhere in which a procedure on S2 called another procedure on S1 to execute a code, and (only) the result was transferred to S2.
The problem is I dont have an example of such a code, and also that I dont have rights to create procedures on S1.

If somebody has experience on this, or knows some good links/sources about this, it would be a great help.

Thanks
Katarina

View 11 Replies


ADVERTISEMENT

Conv Fron Int To Date

Apr 27, 2000

Hi,
How can I convert a 4-digit date(INT type) to datetime type....
I know we have to use an implicit conversion....but does anyone have an idea how to do the same..
Bindu

View 1 Replies View Related

Recover Master Database Fron Only MDF File

Jul 20, 2005

I have SQL server 2000 which recently crashed. I try to recover it andfound out that the Master database is corrupt. I never backup myserver using inline sql backup nor any third party backup program thataware to SQL server. But I have full system backup of volume c on tape(using NTBackup), which includes old version of Master database. Myquestions are:1. How can I recover this file into SQL server?2. If so, it is not risky to recover Master database from two weeksago?Thanks in advance!

View 1 Replies View Related

Tramsfer Data Fron Acces(ABC.mdb) Sorce To Oledb Destination Using Dataflow Task..

Feb 12, 2008



Hi,
I m totally new in SSIS Programming.
I want to transfer ABC.mdb table to my oit_imp_temp table.
Can you send me refrence with (above requiments) code that wroks for u !
thanks a lot !



View 3 Replies View Related

Tramsfer Data Fron Acces(ABC.mdb) Sorce To Oledb Destination Using Dataflow Task..

Feb 12, 2008



Hi,
I m totally new in SSIS Programming.
I want to transfer ABC.mdb table to my oit_imp_temp table.
Can you send me refrence with (above requiments) code that wroks for u !
thanks a lot !

View 1 Replies View Related

Set Variable Based On Result Of Procedure OR Update Columns Fromsproc Result

Jul 20, 2005

I need to send the result of a procedure to an update statement.Basically updating the column of one table with the result of aquery in a stored procedure. It only returns one value, if it didnt Icould see why it would not work, but it only returns a count.Lets say I have a sproc like so:create proc sp_countclients@datecreated datetimeasset nocount onselect count(clientid) as countfrom clientstablewhere datecreated > @datecreatedThen, I want to update another table with that value:Declare @dc datetimeset @dc = '2003-09-30'update anothertableset ClientCount = (exec sp_countclients @dc) -- this line errorswhere id_ = @@identityOR, I could try this, but still gives me error:declare @c intset @c = exec sp_countclients @dcWhat should I do?Thanks in advance!Greg

View 4 Replies View Related

Problem Assigning SQL Task Result To A Variable - Select Count(*) Result From Oracle Connection

Dec 26, 2007



I have an Execute SQL Task that executes "select count(*) as Row_Count from xyztable" from an Oracle Server. I'm trying to assign the result to a variable. However when I try to execute I get an error:
[Execute SQL Task] Error: An error occurred while assigning a value to variable "RowCount": "Unsupported data type on result set binding Row_Count.".

Which data type should I use for the variable, RowCount? I've tried Int16, Int32, Int64.

Thanks!

View 5 Replies View Related

Table-valued User-defined Function: Commands Completed Successfully, Where Is The Result? How Can I See Output Of The Result?

Dec 11, 2007

Hi all,

I copied the following code from Microsoft SQL Server 2005 Online (September 2007):
UDF_table.sql:

USE AdventureWorks;

GO

IF OBJECT_ID(N'dbo.ufnGetContactInformation', N'TF') IS NOT NULL

DROP FUNCTION dbo.ufnGetContactInformation;

GO

CREATE FUNCTION dbo.ufnGetContactInformation(@ContactID int)

RETURNS @retContactInformation TABLE

(

-- Columns returned by the function

ContactID int PRIMARY KEY NOT NULL,

FirstName nvarchar(50) NULL,

LastName nvarchar(50) NULL,

JobTitle nvarchar(50) NULL,

ContactType nvarchar(50) NULL

)

AS

-- Returns the first name, last name, job title, and contact type for the specified contact.

BEGIN

DECLARE

@FirstName nvarchar(50),

@LastName nvarchar(50),

@JobTitle nvarchar(50),

@ContactType nvarchar(50);

-- Get common contact information

SELECT

@ContactID = ContactID,

@FirstName = FirstName,

@LastName = LastName

FROM Person.Contact

WHERE ContactID = @ContactID;

SELECT @JobTitle =

CASE

-- Check for employee

WHEN EXISTS(SELECT * FROM HumanResources.Employee e

WHERE e.ContactID = @ContactID)

THEN (SELECT Title

FROM HumanResources.Employee

WHERE ContactID = @ContactID)

-- Check for vendor

WHEN EXISTS(SELECT * FROM Purchasing.VendorContact vc

INNER JOIN Person.ContactType ct

ON vc.ContactTypeID = ct.ContactTypeID

WHERE vc.ContactID = @ContactID)

THEN (SELECT ct.Name

FROM Purchasing.VendorContact vc

INNER JOIN Person.ContactType ct

ON vc.ContactTypeID = ct.ContactTypeID

WHERE vc.ContactID = @ContactID)

-- Check for store

WHEN EXISTS(SELECT * FROM Sales.StoreContact sc

INNER JOIN Person.ContactType ct

ON sc.ContactTypeID = ct.ContactTypeID

WHERE sc.ContactID = @ContactID)

THEN (SELECT ct.Name

FROM Sales.StoreContact sc

INNER JOIN Person.ContactType ct

ON sc.ContactTypeID = ct.ContactTypeID

WHERE ContactID = @ContactID)

ELSE NULL

END;

SET @ContactType =

CASE

-- Check for employee

WHEN EXISTS(SELECT * FROM HumanResources.Employee e

WHERE e.ContactID = @ContactID)

THEN 'Employee'

-- Check for vendor

WHEN EXISTS(SELECT * FROM Purchasing.VendorContact vc

INNER JOIN Person.ContactType ct

ON vc.ContactTypeID = ct.ContactTypeID

WHERE vc.ContactID = @ContactID)

THEN 'Vendor Contact'

-- Check for store

WHEN EXISTS(SELECT * FROM Sales.StoreContact sc

INNER JOIN Person.ContactType ct

ON sc.ContactTypeID = ct.ContactTypeID

WHERE sc.ContactID = @ContactID)

THEN 'Store Contact'

-- Check for individual consumer

WHEN EXISTS(SELECT * FROM Sales.Individual i

WHERE i.ContactID = @ContactID)

THEN 'Consumer'

END;

-- Return the information to the caller

IF @ContactID IS NOT NULL

BEGIN

INSERT @retContactInformation

SELECT @ContactID, @FirstName, @LastName, @JobTitle, @ContactType;

END;

RETURN;

END;

GO

----------------------------------------------------------------------
I executed it in my SQL Server Management Studio Express and I got: Commands completed successfully. I do not know where the result is and how to get the result viewed. Please help and advise.

Thanks in advance,
Scott Chang

View 1 Replies View Related

Saving Query Result To A File , When View Result Got TLV Error

Feb 13, 2001

HI,
I ran a select * from customers where state ='va', this is the result...

(29 row(s) affected)
The following file has been saved successfully:
C:outputcustomers.rpt 10826 bytes

I choose Query select to a file
then when I tried to open the customer.rpt from the c drive I got this error message. I am not sure why this happend
invalid TLV record

Thanks for your help

Ali

View 1 Replies View Related

End Result Is Main Query Results Ordered By Nested Result

May 1, 2008

As the topic suggests I need the end results to show a list of shows and their dates ordered by date DESC.
Tables I have are structured as follows:

SHOWS
showID
showTitle

SHOWACCESS
showID
remoteID

VIDEOS
videoDate
showID

SQL is as follows:

SELECT shows.showID AS showID, shows.showTitle AS showTitle,
(SELECT MAX(videos.videoFilmDate) AS vidDate FROM videos WHERE videos.showID = shows.showID)
FROM shows, showAccess
WHERE shows.showID = showAccess.showID
AND showAccess.remoteID=21
ORDER BY vidDate DESC;

I had it ordering by showTitle and it worked fine, but I need it to order by vidDate.
Can anyone shed some light on where I am going wrong?

thanks

View 3 Replies View Related

CASE Function Result With Result Expression Values (for IN Keyword)

Aug 2, 2007

I am trying to code a WHERE xxxx IN ('aaa','bbb','ccc') requirement but it the return values for the IN keyword changes according to another column, thus the need for a CASE function.

WHERE GROUP.GROUP_ID = 2 AND DEPT.DEPT_ID = 'D' AND WORK_TYPE_ID IN ( CASE DEPT_ID WHEN 'D' THEN 'A','B','C' <---- ERROR WHEN 'F' THEN 'C','D ELSE 'A','B','C','D' END )

I kept on getting errors, like

Msg 156, Level 15, State 1, Line 44Incorrect syntax near the keyword 'WHERE'.
which leads me to assume that the CASE ... WHEN ... THEN statement does not allow mutiple values for result expression. Is there a way to get the SQL above to work or code the same logic in a different manner in just one simple SQL, and not a procedure or T-SQL script.

View 3 Replies View Related

Return Subquery Result For Only First Row In Result

Apr 7, 2015

I'm using a subquery to return a delivery charge line as a column in the result set. I want to see this delivery charge only on the first line of the results for each contract. Code and results are below.

declare @start smalldatetime
declare @end smalldatetime
set @start = '2015-03-22 00:00' -- this should be a Sunday
set @end = '2015-03-28 23:59' -- this should be the following Saturday

select di.dticket [Contract], di.ddate [Delivered], di.item [Fleet_No], di.descr [Description], dd.min_chg [Delivery_Chg], dd.last_invc_date [Delivery_Invoiced],

[code]....

In this example, I only want to see the delivery charge of 125.00 for the first line of contract HU004377. For simplicity I have only shown the lines for 1 contract here, but there would normally be many different contracts with varying numbers of lines, and I only want to see the delivery charge once for each contract.

View 6 Replies View Related

Strange Result - Minus Result -1

Mar 2, 2008

help strange result whan i do this



Code Snippet
SELECT unit_date, unit, ISNULL(NULLIF ((unit + DATEDIFF(mm, GETDATE(), unit_date)) % 4, 0), 4) AS new_unit
FROM dbo.empList




i try to get next unit value to next month
why i get this -1
on date




01/01/2008
1
-1

unit_date unit new_unit



01/02/2008
2
1

01/02/2008
1
4

01/01/2008
1
-1

01/02/2008
1
4

21/01/2008
1
-1

21/01/2008
1
-1

01/02/2008
1
4


TNX

View 3 Replies View Related

How To Extract Data From SQL Server With The Index Server Search Result?

Jan 14, 2006

I am developing a Recruitment Agency WebsiteI am using MS SQL Server in which I have a table called CV_Details which stores all the details of different Job Seekers. I have stored all the Word and PDF docs of the Job seekers in a 'mycatalog' using Index Server and stored the path in the CV_Details table along with rest of the cv details. Basically I want to download the cv's which i get after making a search in the doc's. I am able to get the filename, Path, Filesize by using Index Server Query.Is it anyway possible to extract all the CV Details data by matching the path.I want the cv details from the SQL Server of all the Related Paths at the same time not one at a time. Is it possible.I tried alot but i'm going nowhere. I'm giving my code below. Can anyone help me please.Thank you very much in Advance
            string strCatalog = "TestCatalog", strsearchstrings="";            string strQuery="";             strsearchstrings = txtsearch.Text;
            strQuery = "Select Filename,PATH from Scope() where FREETEXT('" +strsearchstrings+ "')";            // TextBox1.Text is the word that you type in the text box to query by using Indexing Service.            string connstring = "Provider=MSIDXS.1;Integrated Security .='';Data Source="+strCatalog;
            System.Data.OleDb.OleDbConnection conn = new System.Data.OleDb.OleDbConnection(connstring);            conn.Open();                                   System.Data.OleDb.OleDbCommand objcmd = new System.Data.OleDb.OleDbCommand(strQuery, conn);            System.Data.OleDb.OleDbDataReader objRdr;
            objRdr = objcmd.ExecuteReader();            DataGrid1.DataSource=objRdr;            DataGrid1.DataBind();            objRdr.Close();            conn.Close();

View 1 Replies View Related

Limiting Result Set From MS SQL Server Query

Jul 23, 2005

Hello,I am running SQL Server 2000. I would like to know whetherMicrosoft Transact-SQL has a method for limiting the resultset from a query in a way analogous to MySQL's LIMIT keyword,so that, for instance, if the result set contains 10,000 rows,then only the first 10 rows from the record set are output.Thank you,Best Regards,Neil

View 2 Replies View Related

Copy Result Set To Another Server From Within A Sproc?

Jun 4, 2007

I've got a stored procedure that selects some rows. These rows need to be placed in a table on another SQL Server.



Currently, I'm using some C#/ADO.NET code to execute the stored procedure, grab the results, connect up to the other server, and dump them there.



Is there a way that I can cut my little program out of the picture? Could I somehow copy the selected rows and insert them into the appropriate table on the other server, from within this stored procedure? I suspect this is way outside the scope of T-SQL (and hence my little program), no?

View 3 Replies View Related

Transact SQL :: How To Get Row Values For Result Set In Server

Jun 16, 2015

I have written this query

select name,number,city from student where name='abcd'
now name='abcd' is not there in student table so result is no record.

I need record for this query, all the columns as null or empty. how to do this one? Because am using this query in report so this query as null or empty i will replace as 0 for rows.

View 8 Replies View Related

SQL Server Stored Procedure&#39;s Result Columns

Aug 4, 1999

How can I find the result columns from code? Visual J++ Seems to be able to do that. ADO doesn't want to do it for me, neither does ODBC's SQLProcedureColumns().

Any solutions?

View 1 Replies View Related

Inconsistent Result Of Sybase Linked Server

May 4, 2008

help...


i successfully linked the sybase database to sqlserver. at first i can select a record, after i execute the same statement the result become different. i was looking for answer in the web but i can't find one. can somebody help me...

i suspect that sqlserver cache the result.. so i try to create a view for sybase database table. when i select the view it gave me the complete result but when i rerun the statement again it became inconsistent.

is there a cache or something in sqlserver. if there is how can i clear it.. so i will always get the fresh copy of the result.

View 6 Replies View Related

SQL Server 2008 :: Sum Result Type Character?

Feb 1, 2015

i need result from '(1000/3)+(15/100)'. try exec() by failed.

View 5 Replies View Related

SQL Server 2012 :: Result Export To EXCEL

Apr 27, 2015

using below query to compare columns in two tables.

SELECT
Col1 = ISNULL(a.name,b.name),
Col2 =
CASE
WHEN ISNULL(a.name,'') = '' THEN 'Table B'
WHEN ISNULL(b.name,'') = '' THEN 'Table A'

[code]...

How to export the result to EXCEL from SQL Server 2008 R2.

View 7 Replies View Related

SQL Server 2008 :: Removing Null From Result Set

Aug 25, 2015

I want to remove the nulls from the result set so the result is 1 line. Code and results are below:

SELECT
CustomerNumber,
(case when yearseq = 2012 then isnull(sum(mainPower),0)+isnull(sum(sidePower),0)+isnull(Sum(leftPower),0)
+isnull(Sum(netappPower),0)+isnull(Sum(rightPower),0)+isnull(Sum(lowerPower),0) end) as '2012',
(case when yearseq = 2013 then

[Code] ....

What can I do to my code to remove the Nulls to the entire result is just 1 line?

View 2 Replies View Related

Linked Server Problem With Exec @result=myproc

Jan 31, 2002

I'm having some weird problems with calling remote stored procedures.

Two servers, both windows 2000 sp2, both running sql 7 version 7.00.961.

Server A is actually a cluster, but server B is a development server and not a cluster.

First off, server B can link to server A, but server A can't link to server B. We get a can't create connection error. We've used the client network utility to specify tcp/ip for both. I'm using the link settings as SQL Server connection (rather than an odbc connection) mapped to the sa user id and password. The password is blank on server B though.

I can run a remote stored procedure on server A from server B fine. I get the proper response back too. I can select anything from any database on A from B without trouble.

But here's my problem: If I use exec @result=ServerA.MyDB.dbo.myproc from server B, @result is always null. If I run MyDB.dbo.myproc from server A directly, @result comes back with the proper value.

I tried using an OUTPUT argument but it has the identical results. If I run it on server A, it works. If I run it from server B, the output argument is null.

Just for grins, I tried setting the @result value to 0 before calling MyProc. It didn't come back null, but it came back as the same value I set it before calling the procedure.

I verified that the sqlagent user has full permissions to the temp directory. TMP and TEMP both point to the same ..localemp directory, and it has full permissions in that directory.

Does anyone have any idea of things I can try? Is there a known bug with cluster services? I don't think this is happening when server B links to another server that isn't clustered.

View 1 Replies View Related

SQL Server 2012 :: Updating A Field Based On Result Set

Feb 21, 2014

I am trying to update records based on the results of a query with a subquery.

The result set being produced shows the record of an item number. This result produces the correct ItemNo which I need to update. The field I am looking to update is an integer named Block.

When I run the update statement all records are updated and not the result set when I run the query by itself.

Below you will find the code I am running:

create table #Items
(
ItemNovarchar (50),
SearchNo varchar (50),
Historical int,
Blocked int

[Code] ....

Below is the code I am using in an attempt to update the block column but it updates all records and not the ones which I need to have the Blocked field set to 1.

Update #items set Blocked = 1
Where Exists
(
SELECT ItemNo=MAX(CASE rn WHEN 1 THEN ItemNo END)
--,SearchNo
--,COUNT(*)

[Code] ...

Why is the update changing each record? How can I change the update to choose the correct records?

View 6 Replies View Related

SQL Server 2012 :: Comma Separated In A Single Result

May 30, 2014

I have the following table

CREATE Table #Table1
(
ID INT, Name VARCHAR(50), Class VARCHAR(10)
)
INSERT INTO #Table1
Select 1, 'name1', 'a' UNION ALL
Select 2, 'name1', 'a' UNION ALL

[Code] ....

Is it possible to have each name and its corresponding class in a single line separated by commas to give a result like the one below in #table2 ?

CREATE Table #Table2
(
ID INT, CommaSeparated VARCHAR(100)
)
INSERT INTO #Table2
Select 1, 'name1, a' UNION ALL

[Code] ...

What I have

Select * FROM #Table1

Final Result
Select * FROM #Table2

Note that I still want to see all the IDs regardless.

If that is not possible to see all the IDs, I think the results below in #Table3 should suffice.

CREATE Table #Table3
(
CommaSeparated VARCHAR(100)
)
INSERT INTO #Table3
Select 'name1, a' UNION ALL
Select 'name2, b, c, d' UNION ALL
Select 'name3, e, f'
Select * FROM #Table3

View 3 Replies View Related

SQL Server 2012 :: CTE To Remove Overlaps And Produce Result

Aug 7, 2014

I am having problems building a CTE. I have a table:

declare @tbl table ( ID int, S time(0), E time(0) )

with the following data:

insert@tbl ( ID, S, E )
values ( 1, '03:00', '05:00' ),
( 1, '04:00', '06:30' ),
( 1, '22:00', '23:00' ),
( 1, '23:00', '23:40' ),
( 1, '23:30', '23:45' )

I need to build a CTE that will eliminate overlaps and produce the following result:

ID S E
-- --------- ---------
1 03:00:00 06:30:00
1 22:00:00 23:45:00

View 1 Replies View Related

SQL Server 2012 :: Query Result For Sequential Range

Aug 9, 2014

I wanted to know the best way to achieve the following results. I have a table that I need output sequential range of vouchers in a table. For instance I have the following data in a column called vouchers. The output will consist of a years worth of vouchers, so voucher numbers may contain gaps and so the need to have a sequential range that has a From and To output. The query needs to know the min and max within that numerical range and then output the next min and max range until it gets to the end.

The data looks like:
ABCD-001869202
ABCD-001869203
ABCD-001869204
ABCD-001869205
ABCD-001869209
ABCD-0018692010
ABCD-0018692011
ABCD-001869309
ABCD-001869310
ABCD-001869311
ABCD-001869312
ABCD-001869313
ABCD-001869314

Desired out put:

From To
ABCD-001869202 ABCD-001869205
ABCD-001869209 ABCD-0018692011
ABCD-001869309 ABCD-001869314

I have tried the following, but it does not quite do what I need it to do, so not sure if I am taking the right approach:

SELECT voucher vouchers,right(voucher, charindex('-', voucher) + 3) voucher
INTO #tempVoucher
FROM LEDGERJOURNALTRANS
where TRANSDATE between '10/1/2013' and '7/31/2014' and VOUCHER like 'APIN%'

[Code] ...

View 6 Replies View Related

SQL Server 2012 :: Replace A Result Value Based On Value Of Another Field?

May 7, 2015

I would like to replace the value in the Select query of CO OWNER with a space ' ' or NULL if the ORDINAL value = 0.

The CO OWNER name is stored in the CARDNAME table, and the OWNER name is stored in the NAME table. I can not change the db structure.

JEAN is the ACCOUNT owner and BILL is CO OWNER of two cards.

Current Select Results:

ACCOUNT CARD ORDINAL CO OWNER OWNER
200500 9999999999999100 2 BILL JEAN
200500 9999999999999101 1 BILL JEAN
200500 9999999999999102 0 BILL JEAN

Desired Select Results:

ACCOUNT CARD ORDINAL CO OWNER OWNER
200500 9999999999999100 2 BILL JEAN
200500 9999999999999101 1 BILL JEAN
200500 9999999999999102 0 NULL JEAN

Current SQL Select statement:

SELECT DISTINCT
CARD.PARENTACCOUNT AS ACCOUNT,
CARD.NUMBER AS CARD,
CARD.ORDINAL,
CARD.STATUS,
CARDNAME.FIRST AS CO_OWNER,

[code]....

View 9 Replies View Related

SQL Server 2012 :: Creating A Pivot Like Table Result?

May 20, 2015

I have 2 tables (#raw1 & #raw2). Each has a year (yr) and month (mnth) and a count (cnt1 / cnt2) field. I need a table created as follows:

2013 2014 2015
cnt1 cnt2 cnt1 cnt2 cnt1 cnt2
jan 5 77 77 8 88
etc....

Normally, I would ask about a pivot but since it is months down one side and year and columns on the top, I don't know if a pivot will work.

create table #raw1 ([yr] int, [mnth] int, [cnt1] int)
insert into #raw1 values
(2013, 1, 5)
, (2013, 2, 5)
, (2013, 3, 5)
, (2013, 4, 5)
, (2013, 5, 5)
, (2013, 6, 5)

[code]....

View 1 Replies View Related

SQL Server 2012 :: How To Exclude Row From Result Set Based On Condition

Sep 15, 2015

Lets say I have a set of columns as follows:

Table.Name - Table.ID - Table.Code

I want to write a query that will cycle through the results and if it comes across another record that has a matching Table.ID I want to exclude that row from the result set.

I am not all too familiar with how to use either a Case or If..Else Statement within a Sql statement that would accomplish this.

View 7 Replies View Related

SQL Server 2012 :: Add Columns To Result That Don't Exist In Table?

Oct 7, 2015

I am trying to produce a query result that will be using a Case statement to determine values based on scores in a table for each row. The result needs to be exported to be used to upload to a state reporting website. My problem is that the state requires in the CSV file that is uploaded a lot of fields that we do not actually have in the database table we are creating the result set from. After I receive my result set using the Case statement, is there a way to add additional columns that don't actually exist in a table so I can export directly from SQL?

View 6 Replies View Related

Using StoredProc With Multiple Result(or Datatable) In Server Reports

Sep 17, 2007

Hi guys,

I've been doing some LOCAL reports on my current application until recently there's has been a case that I really need to do SERVER reports.

Usually when I design my local reports, I create a XSD file, so I usually have one dataset with multiple tables in it. I just pass the dataset to report with a single procedure call that returns multiple result sets or data table.

From what I understood server reports are binded to database objects only, like stored procedures. Now I used the same stored procedure that I used in my local report to my server report. But the thing is only the first result set in the stored procedure is recognized. Are there anyway that I can bind the server report to a single stored procedure that return multiple result sets?

Thanks.

View 2 Replies View Related

Linked Server Unable To Insert Result Into A Table

Jul 12, 2007

I have a 2000 machine which calls a stored procedure on another 2000 machine via a linked server. The results come back and insert into a temporary table.



When I use the same code executing the from the 2000 machine over to 2005 machine via a linked server I cannot insert into the table. But I am able to see the data if I remove the insert statement.



I have tried to place the data into a permanent table without success. I have also checked to be sure the linked server properties are the same.



Any help on this would be appreciated. Below is the code. It is very simple and returns only one value but the bigger procedure that is ran returns several records and mutliple columns. This seems to easy but doesn't work.



DECLARE @retval AS INT

DECLARE @value AS INT



SET @value = 4



CREATE TABLE #TempTable (Value DECIMAL(19, 10) NULL)



INSERT INTO #TempTable

EXEC @RetVal = Server.Database.dbo.testproc @value



SELECT * FROM #TempTable

DROP TABLE #TempTable

View 6 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved