Showing posts with label working. Show all posts
Showing posts with label working. Show all posts

Friday, March 30, 2012

Return bottom 10 rows not working.

Ok so this is more then likely very easy for most. But for me it's hard. I have a stored proc that I've been able to get to retun just the top 10 rows and have been able to order it asending. But it will only return the top 10 and I need to bottom 10 of the selection.

set ANSI_NULLS ON
set QUOTED_IDENTIFIER ON
GO

ALTER proc [dbo].[proj_ListFiles](@.project_id int)
as
select top 10(@.project_id) id, project_id, filename, contenttype, length
from proj_file
where project_id=@.project_id

How can I make it return to bottom 10. On a side note about this, when it returns the recordset they all have the 'id' of the 'project_id' that I selected. Not that the side note really bothers me as it will not be returning the ID's to be visible.

Any help would be great,
Thanks
Tim

Hi,

To do this, you need to add an ORDER BY clause to your select statement and set it to be DESCENDING.

ALTER proc [dbo].[proj_ListFiles](@.project_id int)
as
select top 10(@.project_id) id, project_id, filename, contenttype, length
from proj_file
where project_id=@.project_id
order by project_id desc

Greetz,

Geert

Geert Verhoeven
Consultant @. Ausy Belgium

My Personal Blog

|||Hi,

in addition to Geert, be aware that TOP makes no sense without any order clause unless you want to get a set of (possible) random rows out of the database.

HTH; Jens K. Suessmeyer.

http://www.sqlserver2005.de|||

Ok I've added the order by project_id desc to the statement, but it's still only returning the same 10 rows is ascending order, it'a also changing the ID to the value I queried in this case 12. So it's sorting all of the as 12. I was looking at another and added something and it made it so my results flip around and sort ascending but are returning rows 2-11 not 1-10.

set ANSI_NULLS ON
set QUOTED_IDENTIFIER ON

GO
ALTER proc [dbo].[proj_ListFiles](@.project_id int = 0 )
as
select top 10(@.project_id) id, project_id, filename, contenttype, length
from proj_file
where project_id=@.project_id
or @.project_id = 0
order by project_id desc

Any ideas, what i'm trying to do is limit the results so that way only the last 10 entries of that same project_id will return and not all/the first 10. It will make for easier viewing for me.

By the way thanks for the help.
Tim

|||

Hi,

Since project_id is the same for all the records, you need to sort on a different field then that. For example if you want to have the 10 largest filenames, you perform an ORDER BY length DESC.

Greetz,

Geert

Geert Verhoeven
Consultant @. Ausy Belgium

My Personal Blog

|||

Well I figured it out with a little help from a co worker. Not sure if it needs it or not but I just set rowcount to 10 and removed the (@.project_id) from the top 10 command and it works like a dream (a really weird nerdy dream).

ALTER proc proj_ListFiles(@.project_id int)

as

set rowcount 10

select top 10 id, project_id, filename, contenttype, length

from proj_file

where project_id=@.project_id

order by id desc

Thanks for the help.

Tim

|||

The procedure mentioned above was wrong, it took the projectId as a static expression leading to the fact that it produced 10 time the number you put in as project id, e.g.

SELECT TOP 10(10) From sys.sysobjects

10
10
10
10
10
10
10
10
10
10

YOu will not have to set SET ROWCOUNT, just use the Top with either the syntax

select top 10 id, project_id, filename, contenttype, length

from proj_file

where project_id=@.project_id

order by id desc

(Which is only supported by SQL Server 2005 as backward compatibility)

or

select top (10) id, project_id, filename, contenttype, length

from proj_file

where project_id=@.project_id

order by id desc

Which is new in SQL Server 2005.

HTH, Jens K. Suessmeyer.

http://www.sqlserver2005.de

|||

Thank you very much for this reply, and yes you are correct I didn't have to use 'set rowcount 10' it was removed within minutes of my previous post. Another coworker that had helped me on it yesterday showed me that you did not have to use it. So the second I got home (10 minutes ago) I updated the stored proc and it worked perfect. Now I just hope the rest of them go easier than that.

Thanks again every one.
Tim

Friday, March 23, 2012

Retrieving XML Datatype to a Record Set

I'm sure this is a simple thing for you guru's out there. Working in SQL 2000

I have a datatype in a colunm that is I assume is XML. I need a way to parse this so that the output is in a normal table output. I then want to join the results with other record from the same table. The nodes are all the same.

Ultimately, the data will be analyzed in reporting services.

Here is a sample of the xml data saved in a field. Thanks for your time.

<interactions><interaction index="0" id="I0001-1" timestamp="2007-07-10T14:14:00" weighting="1" type="true-false" latency="PT3S" learner_response="true" result="correct" description="Tire center employees should know where to access."><objectives><objective index="0" id="I0001-1"/></objectives><corr_resps><corr_resp index="0" pattern="true"/></corr_resps></interaction><interaction index="1" id="I0002-1" timestamp="2007-07-10T14:14:02" weighting="1" type="true-false" latency="PT3S" learner_response="false" result="incorrect" description=" does not sell used tires or any tire that has previously been mounted on a rim and driven on."><objectives><objective index="0" id="I0002-1"/></objectives><corr_resps><corr_resp index="0" pattern="true"/></corr_resps></interaction><interaction index="2" id="I0003-1" timestamp="2007-07-10T14:14:05" weighting="1" type="choice" latency="PT3S" learner_response="Taken" result="incorrect" description="Tire center supplies should not be:"><objectives><objective index="0" id="I0003-1"/></objectives><corr_resps><corr_resp index="0" pattern="All_apply"/></corr_resps></interaction><interaction index="3" id="I0004-1" timestamp="2007-07-10T14:14:08" weighting="1" type="true-false" latency="PT3S" learner_response="false" result="correct" description="Employees have the option to wear a supplied uniform.&#xA;"><objectives><objective index="0" id="I0004-1"/></objectives><corr_resps><corr_resp index="0" pattern="false"/></corr_resps></interaction><interaction index="4" id="I0005-1" timestamp="2007-07-10T14:14:11" weighting="1" type="true-false" latency="PT2S" learner_response="false" result="incorrect" description="Uniform shirts should be tucked in and belts worn all times.&#xA;"><objectives><objective index="0" id="I0005-1"/></objectives><corr_resps><corr_resp index="0" pattern="true"/></corr_resps></interaction></interactions>

Does SQL 2000 have an XML datatype? I don't think so.

I think what it does support is the OPENXML row set provider so for instance to read out the attributes of the interaction elements you could use the following:

Code Snippet

DECLARE @.x nvarchar(2000);

SET @.x = '<interactions><interaction index="0" id="I0001-1" timestamp="2007-07-10T14:14:00" weighting="1" type="true-false" latency="PT3S" learner_response="true" result="correct" description="Tire center employees should know where to access."><objectives><objective index="0" id="I0001-1"/></objectives><corr_resps><corr_resp index="0" pattern="true"/></corr_resps></interaction><interaction index="1" id="I0002-1" timestamp="2007-07-10T14:14:02" weighting="1" type="true-false" latency="PT3S" learner_response="false" result="incorrect" description=" does not sell used tires or any tire that has previously been mounted on a rim and driven on."><objectives><objective index="0" id="I0002-1"/></objectives><corr_resps><corr_resp index="0" pattern="true"/></corr_resps></interaction><interaction index="2" id="I0003-1" timestamp="2007-07-10T14:14:05" weighting="1" type="choice" latency="PT3S" learner_response="Taken" result="incorrect" description="Tire center supplies should not be:"><objectives><objective index="0" id="I0003-1"/></objectives><corr_resps><corr_resp index="0" pattern="All_apply"/></corr_resps></interaction><interaction index="3" id="I0004-1" timestamp="2007-07-10T14:14:08" weighting="1" type="true-false" latency="PT3S" learner_response="false" result="correct" description="Employees have the option to wear a supplied uniform.&#xA;"><objectives><objective index="0" id="I0004-1"/></objectives><corr_resps><corr_resp index="0" pattern="false"/></corr_resps></interaction><interaction index="4" id="I0005-1" timestamp="2007-07-10T14:14:11" weighting="1" type="true-false" latency="PT2S" learner_response="false" result="incorrect" description="Uniform shirts should be tucked in and belts worn all times.&#xA;"><objectives><objective index="0" id="I0005-1"/></objectives><corr_resps><corr_resp index="0" pattern="true"/></corr_resps></interaction></interactions>';

DECLARE @.iDoc int;

EXEC sp_xml_preparedocument @.iDoc OUTPUT, @.x;

SELECT *

FROM OPENXML (@.iDoc, '/interactions/interaction', 1)

WITH (

[index] int,

[id] nvarchar(10),

[timestamp] datetime,

[weighting] int,

[type] nvarchar(10),

[latency] nvarchar(5),

[learner_response] nvarchar(5),

[result] nvarchar(10),

[description] nvarchar(30),

);

EXEC sp_xml_removedocument @.iDoc;

|||Thanks for the reply. I've looked at OPENXML, but a bit confused by it when the data alread resides in a field. The column name is 'CntItmPrgs_Interactions'. Do I set @.x = the column name? i.e. Set @.x = CntItmPrgs.CntItmPrgs_Interactions|||

Yes, I think you need to use

SET @.x = (SELECT columnname FROM tablename WHERE somecondition)

|||

Okay, this is what I have:

DECLARE @.x nvarchar(2000);
SET @.x =(Select CntItmPrgs_Interactions from CntItmPrgs Where CntItmPrgs_PK = 406560)
DECLARE @.iDoc int;
EXEC sp_xml_preparedocument @.iDoc OUTPUT, @.x;
SELECT *
FROM OPENXML (@.iDoc, '/interactions/interaction', 1)
WITH (
[index] int,
[id] nvarchar(10),
[timestamp] datetime,
[weighting] int,
[type] nvarchar(10),
[latency] nvarchar(5),
[learner_response] nvarchar(5),
[result] nvarchar(10),
[description] nvarchar(30))
EXEC sp_xml_removedocument @.iDoc;

But, I'm getting this error:

Server: Msg 279, Level 16, State 3, Line 2
The text, ntext, and image data types are invalid in this subquery or aggregate expression.

Any ideas?

|||I don't have SQL Server 2000 and don't have enough experience with it to answer without testing. Maybe someone else can help if you provide details on the type of the CntItmPrgs_Interactions column.sql

Retrieving XML data using OpenXML

Hello Everyone:
I have a piece of function that reads through the XML file and updates the
table with the contents.
I am working on to retrieve a specific elemental data, but am not able to do
so.
Below is my Code
CREATE PROCEDURE [dbo].[xmltest]
AS
BEGIN
--Local var for statement header/detail messages
DECLARE @.hDoc int --document handle
DECLARE @.Count int
DECLARE @.errNo int, @.doc nvarchar(4000) , @.Msgid varchar(20)
set @.doc = ' <VendorMasterData>
<VendorInfo>
<MessageId type="A">0000000018089158</MessageId>
<Date>2005-12-07</Date><Time zone="PST">05:02:31.000</Time>
<MessageType>C</MessageType>
<Sort type="SORT1">ABC</Sort>
<Sort type="SORT2">XYZ</Sort>
</VendorInfo>
</VendorMasterData>'
--Get the XML doc handle
EXEC sp_xml_preparedocument @.hDoc OUTPUT, @.doc
IF @.@.ERROR <> 0
BEGIN
return @.@.ERROR
END
SELECT * FROM OPENXML(@.hdoc, '/VendorMasterData/VendorInfo',3) WITH
([Sort] varchar(30),type varchar(30))
EXEC sp_xml_removedocument @.hdoc
RETURN (0)
END
GO
I would like to retrieve both the values of Sort (both Sort1 and Sort2
types). How can I do that. Right now I am able to retrieve only 1 value.
Thanks for you help.
Regards/Shriram.Hello shriram2977,

> I have a piece of function that reads through the XML file and updates
> the table with the contents.
> I would like to retrieve both the values of Sort (both Sort1 and Sort2
> types). How can I do that. Right now I am able to retrieve only 1
> value.
Does this give you what you were looking for?
SELECT * FROM OPENXML(@.hdoc, '/VendorMasterData/VendorInfo/Sort',2) WITH
([Sort] varchar(30) 'text()',type varchar(30) '@.type')
Thank you,
Kent Tegels
DevelopMentor
http://staff.develop.com/ktegels/|||Kent Tegels, Thanks much. It does.
Jus curious, what is this text() and where can you use them in OpenXML.
Thanks/Shriram.
"Kent Tegels" wrote:

> Hello shriram2977,
>
> Does this give you what you were looking for?
> SELECT * FROM OPENXML(@.hdoc, '/VendorMasterData/VendorInfo/Sort',2) WITH
> ([Sort] varchar(30) 'text()',type varchar(30) '@.type')
>
> Thank you,
> Kent Tegels
> DevelopMentor
> http://staff.develop.com/ktegels/
>
>|||Hello shriram2977,
text() is an xpath function that returns the lexical value of an element's
inner-text. You can use it (and some other functions) as what's known as
a metaproprety. This is covered in Books-On-Line.
Thank you,
Kent Tegels
DevelopMentor
http://staff.develop.com/ktegels/

Retrieving XML data using OpenXML

Hello Everyone:
I have a piece of function that reads through the XML file and updates the
table with the contents.
I am working on to retrieve a specific elemental data, but am not able to do
so.
Below is my Code
CREATE PROCEDURE [dbo].[xmltest]
AS
BEGIN
--Local var for statement header/detail messages
DECLARE @.hDoc int--document handle
DECLARE @.Count int
DECLARE @.errNo int, @.doc nvarchar(4000) , @.Msgid varchar(20)
set @.doc = ' <VendorMasterData>
<VendorInfo>
<MessageId type="A">0000000018089158</MessageId>
<Date>2005-12-07</Date><Time zone="PST">05:02:31.000</Time>
<MessageType>C</MessageType>
<Sort type="SORT1">ABC</Sort>
<Sort type="SORT2">XYZ</Sort>
</VendorInfo>
</VendorMasterData>'
--Get the XML doc handle
EXEC sp_xml_preparedocument @.hDoc OUTPUT, @.doc
IF @.@.ERROR <> 0
BEGIN
return @.@.ERROR
END
SELECT * FROM OPENXML(@.hdoc, '/VendorMasterData/VendorInfo',3) WITH
([Sort] varchar(30),type varchar(30))
EXEC sp_xml_removedocument @.hdoc
RETURN (0)
END
GO
I would like to retrieve both the values of Sort (both Sort1 and Sort2
types). How can I do that. Right now I am able to retrieve only 1 value.
Thanks for you help.
Regards/Shriram.
Hello shriram2977,

> I have a piece of function that reads through the XML file and updates
> the table with the contents.
> I would like to retrieve both the values of Sort (both Sort1 and Sort2
> types). How can I do that. Right now I am able to retrieve only 1
> value.
Does this give you what you were looking for?
SELECT * FROM OPENXML(@.hdoc, '/VendorMasterData/VendorInfo/Sort',2) WITH
([Sort] varchar(30) 'text()',type varchar(30) '@.type')
Thank you,
Kent Tegels
DevelopMentor
http://staff.develop.com/ktegels/
|||Kent Tegels, Thanks much. It does.
Jus curious, what is this text() and where can you use them in OpenXML.
Thanks/Shriram.
"Kent Tegels" wrote:

> Hello shriram2977,
>
> Does this give you what you were looking for?
> SELECT * FROM OPENXML(@.hdoc, '/VendorMasterData/VendorInfo/Sort',2) WITH
> ([Sort] varchar(30) 'text()',type varchar(30) '@.type')
>
> Thank you,
> Kent Tegels
> DevelopMentor
> http://staff.develop.com/ktegels/
>
>
|||Hello shriram2977,
text() is an xpath function that returns the lexical value of an element's
inner-text. You can use it (and some other functions) as what's known as
a metaproprety. This is covered in Books-On-Line.
Thank you,
Kent Tegels
DevelopMentor
http://staff.develop.com/ktegels/

Wednesday, March 21, 2012

Retrieving multiple Result Sets from within a stored procedure

A coworker of mine came to me with a question about a stored procedure he's working on. In this case, he has a stored procedure which invokes a second stored procedure. He wants that second stored procedure to return two result sets and then make use of both of them in the original stored procedure.

I know how to make a stored procedure return multiple result sets (just do two select statements), but how would you utilize those from the original stored procedure?

Thanks.

You can put the resultset in a temporary table with

INSERT INTO #TempTableName
EXEC SPName

or use a userdefined function rather than a stored procedure if applicable.

HTH, Jens SUessmeyer.

http://www.sqlserver2005.de

|||Right - that works great as long as the stored procedure being invoked only returns a single result set. How do you manage if it returns two result sets? That's what I'm most curious about.
|||

You could put the results in unique named global temporary tables. Passing the name to the procedure which then inserts the results and which can be then later used in the outer procedure.

HTH, Jens Suessmeyer.

http://www.sqlserver2005.de

|||

You could go the global temp route, but I think thats a ridiculous solution to what you have described. Multiple resultsets can be leveraged via stored procs, but usually through ADO (.nextResultset I believe). Dropping these into global temps is just a little overboard for me.
I would recommend just writing the second resultset in its own procedure, or using some variable to indicate which resultset you desire and executing it twice from the parent proc. Or, if theyre identical schemas, just return them with an additional column to indicate the original resultset.

Global temp should be last resort.

Heres an example of what I mean by using an additional column:

--
-- Create / populate 2 tables
--
create table dbo.A (Col1 varchar(10))
go
create table dbo.B (Col1 varchar(10))
go
insert into dbo.A
select 'TableA'
insert into dbo.B
select 'TableB'
go

--
-- Create Child proc that returns 2 resultsets
--
alter procedure [dbo].[p_Child]
as
set nocount on

select *, 'A' from dbo.A
select *, 'B' from dbo.B
go

--
-- Parent proc to call Child
--
alter procedure dbo.p_Parent
as
set nocount on

create table #temp (Col1 varchar(10), Location char(1))

insert into #temp
exec dbo.p_Child

-- return resultsets
select * from #temp where Location = 'A'
select * from #temp where Location = 'B'

drop table #temp
go


--
-- Execute parent to see multiple resultsets returned
--
exec dbo.p_Parent


--
-- cleanup
--
-- drop procedure dbo.p_Child
-- drop procedure dbo.p_Parent
-- drop table dbo.A
-- drop table dbo.B

|||No problem having multiple results sets of the same structure. There will be all the records in temp table as if they combined by union all, and error when recordsets are different.

Monday, March 12, 2012

Retrieving Database Names via C#

Hello,
I am trying to develop a desktop application by using C#.Net. I am working with .NET Framewrok 2.0.
I need to list the database names which are taking place in Anlaysis Services.
Actually, my application will work on the OLAP Cube which is going to be chosen by the user.
In order to do this, I have to retrieve the Cube names so the user can choose what cube he/she wants to work with!
any help appritiated.

thanks in advance.

best regards

Tunc OVACIK

Check out Analysis Management Objects (AMO).

http://msdn2.microsoft.com/en-us/library/ms124924.aspx

|||Thanks for the link which is very usefull and has good informations about the whole programming stuff of OLAP technology but I guess those classes are for Analysis Manager 2005.
I am using Analysis Manager 2000 and those classes do not support AM 2000 as far as I understand. Because I have tried to implement the sample codes given in the link but
it did not work out.
Do you have any documents or any other side which is explaining how to get database names and such stuff from Analysis Manager 2000.

thanks for your time
best regards

Tunc OVACIK|||

In that case, check out Decision Support Objects (DSO)

http://msdn2.microsoft.com/en-us/library/aa902639(sql.80).aspx

http://msdn2.microsoft.com/en-us/library/ms133828.aspx

retrieving data from database...

Hi all,

I am working on a project on PocketPC in which it is required to reteive data from database. I have created database on simulator as .sdf file. I want to retreive data from eVC++ code. How i can do so?

thanx

If you are trying to access a database using C++ code it sounds like the .Net Compact Framework isn't really involved. You might find better information in the Smart Devices Native C++ Development forum.

-Noah

.Net Compact Framework

Friday, March 9, 2012

Retrieving a list ot tables

Hello Everyone and thanks for your help in advance. I am working on an application that connects to SQL Server. I need to find out if there is any way (I know there is, not sure how) to retrieve a list of tables within a database and also, a way to retrieve a list of databases within a server. I am using VB.Net in a web application. Any help on this owuld be greatly appreciated.

you can use SQL helper procedures like

sp_tables for tables

and

sp_databases for databases

this is recommended way, you can also try to use system views to get this data but it is not recommended by Microsoft.

Thanks

|||

To retrieve a list of databases...

Select [name]as DBName,crdatefrommaster.dbo.sysdatabaseswherehas_dbaccess([name]) = 1andNOT( (DATABASEPROPERTY([name], N'isdetached') <> 0)or (DATABASEPROPERTY([name], N'isshutdown') <> 0)or (DATABASEPROPERTY([name], N'issuspect') <> 0)or (DATABASEPROPERTY([name], N'isoffline') <> 0)or (DATABASEPROPERTY([name], N'isinload') <> 0)or (DATABASEPROPERTY([name], N'isinrecovery') <> 0)or (DATABASEPROPERTY([name], N'isnotrecovered') <> 0))

And to retrieve the list of tables in database [DatabaseName]...

select table_catalog, table_schema, table_name,sysobjects.crdatefrom information_schema.tablesinnerjoinsysobjectsonsysobjects.type ='U'andsysobjects.name = information_schema.tables.table_namewhere table_type ='BASE TABLE'and table_catalog ='[DatabaseName]'

Wednesday, March 7, 2012

Retrieve the logical file name from a backup device

Hi,
I'm working on some "daemon" able to restore whatever come into a given
folder to a "stand-by" SQL Server (sort of log shipping, but also to restore
full backup and so on).
I'm now faing a problem : I can't put the logical name of the database from
the backup file to a variable.
Here a sample of what I 'm trying to do :
--
DECLARE @.Data_file nvarchar (256)
create table #result
(
LogicalName varchar(512),
PhysicalName varchar(512),
Type varchar(1),
FileGroupName nvarchar(50),
Size int,
Maxsize int
)
insert into #result EXEC (restore filelistonly from disk='X:\file.bak')
--
(please note that table declaration, variable delclaration, etc may be
weird, but it's purely test code to try validate my concept.
Each time I got the following error :
Server: Msg 156, Level 15, State 1, Line 1
Incorrect syntax near the keyword 'restore'.
Server: Msg 170, Level 15, State 1, Line 1
Line 1: Incorrect syntax near ')'.
As RESTORE filelistonly is, from BOL, returning a dataset, I was expecting
to be able to load into a table, or to be able to extract data from it
easily.
I do not know where to look at, any help will be welcome,
Thanks,
ChrisSee "RESTORE FILELISTONLY " in BOL.
AMB
"Chris V." wrote:

> Hi,
> I'm working on some "daemon" able to restore whatever come into a given
> folder to a "stand-by" SQL Server (sort of log shipping, but also to resto
re
> full backup and so on).
> I'm now faing a problem : I can't put the logical name of the database fro
m
> the backup file to a variable.
> Here a sample of what I 'm trying to do :
> --
> DECLARE @.Data_file nvarchar (256)
> create table #result
> (
> LogicalName varchar(512),
> PhysicalName varchar(512),
> Type varchar(1),
> FileGroupName nvarchar(50),
> Size int,
> Maxsize int
> )
> insert into #result EXEC (restore filelistonly from disk='X:\file.bak')
> --
> (please note that table declaration, variable delclaration, etc may be
> weird, but it's purely test code to try validate my concept.
> Each time I got the following error :
> Server: Msg 156, Level 15, State 1, Line 1
> Incorrect syntax near the keyword 'restore'.
> Server: Msg 170, Level 15, State 1, Line 1
> Line 1: Incorrect syntax near ')'.
>
> As RESTORE filelistonly is, from BOL, returning a dataset, I was expecting
> to be able to load into a table, or to be able to extract data from it
> easily.
> I do not know where to look at, any help will be welcome,
> Thanks,
> Chris
>
>|||Hi Alejandro,
That's what I;ve done, bout couldn't find the way to have the following
result :
SELECT @.DATE_FILE =SELECT LogicalName from EXEC(RESTORE FILELISTONLY from
DISK='File') where TYPE='D'
I'm desperate :)
Thanks,
Chris
"Alejandro Mesa" <AlejandroMesa@.discussions.microsoft.com> a crit dans le
message de news:99C7DE87-8022-4F37-A797-F99296625772@.microsoft.com...
> See "RESTORE FILELISTONLY " in BOL.
>
> AMB
> "Chris V." wrote:
>
restore
from
expecting|||Try,
use northwind
go
create table #t (
LogicalName sysname,
PhysicalName sysname,
Type char(1),
FileGroupName sysname null,
[Size] bigint,
[MaxSize] bigint
)
insert into #t
execute sp_executesql N'use master restore filelistonly from mydump'
select
*
from
#t
drop table #t
go
AMB
"Chris" wrote:

> Hi Alejandro,
> That's what I;ve done, bout couldn't find the way to have the following
> result :
> SELECT @.DATE_FILE =SELECT LogicalName from EXEC(RESTORE FILELISTONLY from
> DISK='File') where TYPE='D'
> I'm desperate :)
> Thanks,
> Chris
> "Alejandro Mesa" <AlejandroMesa@.discussions.microsoft.com> a écrit dans l
e
> message de news:99C7DE87-8022-4F37-A797-F99296625772@.microsoft.com...
> restore
> from
> expecting
>
>|||Works perfectly !
Thanks
"Alejandro Mesa" <AlejandroMesa@.discussions.microsoft.com> wrote in message
news:E686C7EB-957F-4A14-BEA2-6C86F80B1D3F@.microsoft.com...
> Try,
> use northwind
> go
> create table #t (
> LogicalName sysname,
> PhysicalName sysname,
> Type char(1),
> FileGroupName sysname null,
> [Size] bigint,
> [MaxSize] bigint
> )
> insert into #t
> execute sp_executesql N'use master restore filelistonly from mydump'
> select
> *
> from
> #t
> drop table #t
> go
>
> AMB
> "Chris" wrote:
>
from
le
given
database
disk='X:\file.bak')
be
it

Tuesday, February 21, 2012

Retrieve Data from Web Services Using DTS (SQL Server 2000)

The project I'm currently working on involves combining data from one SQL Server 2000 databases and XML returned from a web service into a 3rd SQL Server 2000 database.

This process must be scheduled to happen once a day. If it weren't for the Web Service, I'd say that this is a no-brainer and I'd use DTS. However, I'm not sure if I can even access a Web Service with DTS. Has anyone done this or have any tips?

Id try the microsoft.public.sqlserver.dts forum if I were you.

-Jamie