Showing posts with label mysql. Show all posts
Showing posts with label mysql. Show all posts

Tuesday, March 27, 2012

accessing mapped drive via xp_cmdshell

Hello,
I'm having problems accessing a mapped network drive. Basically, I
need to be able to access the g:\ drive from SQL Server (i.e.
master..xp_cmdshell 'dir g:\')
I created a share on my server (\\MyServer\ShareName) and mapped the
network drive G to this. So, from my machine I can do a "start, run",
and type in g:\, and get what I want to see.
However, when I run:
master..xp_cmdshell 'dir g:\
I get a message "The system cannot find the path specified."
I have the MSSQLSERVER account on this server setup to login as me.
Shouldn't this take care of any issues?
I would like to use a UNC share, but unfortunately I can't do that at
this time.
Much appreciate any ideas!
SylviaTry specifying the UNC path instead of a mapped drive:
EXEC master..xp_cmdshell 'DIR \\MyServer\ShareName'
Hope this helps.
Dan Guzman
SQL Server MVP
"Sylvia" <sylvia@.vasilik.com> wrote in message
news:1133830852.921653.231970@.g49g2000cwa.googlegroups.com...
> Hello,
> I'm having problems accessing a mapped network drive. Basically, I
> need to be able to access the g:\ drive from SQL Server (i.e.
> master..xp_cmdshell 'dir g:\')
> I created a share on my server (\\MyServer\ShareName) and mapped the
> network drive G to this. So, from my machine I can do a "start, run",
> and type in g:\, and get what I want to see.
> However, when I run:
> master..xp_cmdshell 'dir g:\
> I get a message "The system cannot find the path specified."
> I have the MSSQLSERVER account on this server setup to login as me.
> Shouldn't this take care of any issues?
> I would like to use a UNC share, but unfortunately I can't do that at
> this time.
> Much appreciate any ideas!
> Sylvia
>|||Thanks for the reply. Unfortunately using a UNC path is not an option
at this point, as I mentioned above (some hard-coded stuff already
written, can't change right now).
Any other options? Does a network share mapped to a drive just not
work?
Thanks,
Sylvia|||> Thanks for the reply. Unfortunately using a UNC path is not an option
> at this point, as I mentioned above (some hard-coded stuff already
> written, can't change right now).
Sorry, I didn't understand that from your original post.
> Any other options? Does a network share mapped to a drive just not
> work?
A mapped drive can work but it is a kludge. One thing you might try is
establishing a persistent mapped drive. I expect you'll only need to do
this once, unless you change the SQL Server service account or unmap the
drive for that user.
EXEC master..xp_cmdshell 'NET USE L: \\MyServer\ShareName /PERSISTENT:YES'
--
Hope this helps.
Dan Guzman
SQL Server MVP
"Sylvia" <sylvia@.vasilik.com> wrote in message
news:1133845592.917117.66320@.g43g2000cwa.googlegroups.com...
> Thanks for the reply. Unfortunately using a UNC path is not an option
> at this point, as I mentioned above (some hard-coded stuff already
> written, can't change right now).
> Any other options? Does a network share mapped to a drive just not
> work?
> Thanks,
> Sylvia
>|||That did it! Thanks much - it's just the kludge I needed to get past
this.

Accessing lower level members

Hi All,

I have used .Children function to retrieve members of dimension at one
level below the current level of dimension. For example (using FoodMart
2000 and AS 2000)

Select NON EMPTY ( { [Measures].[Unit Sales] } ) ON COLUMNS,
NON EMPTY ( [Customers].[Country].[USA].Children ) on rows

>From sales

This query returns me Children of member Country which is USA. It
returns all members of State Provinces which have USA as its parent.

Can I access or retrieve all members of City with Country member being
USA?

I am building a web application where user applies filters. This is
necessary because if user wants to view sales data about City which
belongs to country USA.

Many thanks in advance.

Raghu

Hi Raghu. Yes, you can retrieve members of City where the Country is USA. Use the MDX DESCENDANTS() function. Change your query to the following:

Select NON EMPTY ( { [Measures].[Unit Sales] } ) ON COLUMNS,
NON EMPTY ( DESCENDANTS([Customers].[Country].[USA], [Customers].[City]) ) on rows

From sales

Here's a link to the BOL description of the DESCENDANTS() function:

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

Good luck - Paul Goldy

|||

Thanks Paul.

This solved it.

Raghu

Accessing local temporary tables

I've been able to get the local temporary table name from sysobjects, but I still can't select from it.

for example, the following select statement won't work
select * from #temptable_____00015
It says invalid object name.

I've even stored the temp table name in a variable and tryed to execute dynamic sql to get to it--no luck.

I need this technique to handle two support situations: A user freezes during data entry to a temp table, I want to capture the data before they reboot, so they don't have to reenter.

Temp tables are used among several stored procedures and then crunched into other tables. I'm getting incorrect results and want to see the raw data in the temp tables to assist me in figuring out what's going on.Local temporary tables are connection based in scope so only the connection that created it may use it. Depending on your use you may need to use global temporary tables.|||Originally posted by rnealejr
Local temporary tables are connection based in scope so only the connection that created it may use it. Depending on your use you may need to use global temporary tables.

They exist on the hard drive. Maybe if I changed the status value in sysobjects, I could select from them?|||Please define in detail the issue you are trying to solve.

Accessing linked servers dynamically

We have a view in one database that consists of the union of all the
rows in a set of tables located on a number of remote linked servers.
If I hard-code the remote server names in the view, it will fail if
any of the remote servers is unavailable. To make this more robust, I
would like it to only query those servers which are available. So I am
maintaining a list of available servers in a table in my main
database. My idea then is to replace the view with a function that
returns a table variable. This function will query all the remote
servers that are available, inserting rows into the table variable.
So within the function I have to generate a piece of dynamic SQL (in
the format 'SELECT ... FROM server.database.dbo.table') to access the
linked server. This works fine, but I can't find a way to get the
results of this query into my table variable. If I run a piece of
dynamic SQL with 'INSERT INTO @.tablevariable' it won't work because
the scope of the dynamic SQL is outside the scope of the function. And
if I use a temporary table I'll get concurrency problems. I have tried
using OPENQUERY and OPENROWSET, but it seems you can't pass string
variables as the parameters to either of these, so effectively I'm
back to hard-coding the server names.
So my question is (finally!): Does anyone know of a way to access a
linked server whose name I have in a string without using dynamic SQL?
Or is there a better way to achieve this?
Thanks in advance!James,
variable would not qualify as table name in a query, whether that variable
represents a local or linked server.
A way around for your situation may be using global temp table. It's not
that much different from a variable, in some situation offers more and in
others less advantage.
hth
Quentin
"James Bosworth" <james.bosworth@.triadgroup.plc.uk> wrote in message
news:1967a78c.0307250500.68dc377e@.posting.google.com...
> We have a view in one database that consists of the union of all the
> rows in a set of tables located on a number of remote linked servers.
> If I hard-code the remote server names in the view, it will fail if
> any of the remote servers is unavailable. To make this more robust, I
> would like it to only query those servers which are available. So I am
> maintaining a list of available servers in a table in my main
> database. My idea then is to replace the view with a function that
> returns a table variable. This function will query all the remote
> servers that are available, inserting rows into the table variable.
> So within the function I have to generate a piece of dynamic SQL (in
> the format 'SELECT ... FROM server.database.dbo.table') to access the
> linked server. This works fine, but I can't find a way to get the
> results of this query into my table variable. If I run a piece of
> dynamic SQL with 'INSERT INTO @.tablevariable' it won't work because
> the scope of the dynamic SQL is outside the scope of the function. And
> if I use a temporary table I'll get concurrency problems. I have tried
> using OPENQUERY and OPENROWSET, but it seems you can't pass string
> variables as the parameters to either of these, so effectively I'm
> back to hard-coding the server names.
> So my question is (finally!): Does anyone know of a way to access a
> linked server whose name I have in a string without using dynamic SQL?
> Or is there a better way to achieve this?
> Thanks in advance!

Accessing linked server

Is there any way to access a linked server without using four-part naming?

My problem is that I am trying to find a way to connect to an access database on a 64 bit system (there is no 64 Jet OleDb provider) and I have to run in a 64 bit process so no WoW solutions will work for me .
I am looking into trying to use a Sql Linked server but am trying to find a workaround without having to re-write all our queries to use four-part naming.
Is there someway to configure a connectionstring to default to executing against a linked server?

Any help or suggestions would be welcomed.

You can create a synonym (if your server is SQL 2005) for a four-part name.
See CREATE SYNONYM.|||Brilliant thanks for that Anton,
Had a bit of a play and it seems to work nicely. I guess I will run into trouble if any of the queries contain VBA expressions but that gets me a long way.
I am going to make a dumby Sql Database that contains no objects only the synonyms for the tables and views that I need in the Access database, then I can create a connection to that dumby database for any of the Jet work I need to do.

As a thought: I guess given that the synonyms are entities of the Sql database then preprossing will occur at the Sql Server, therefore it is unlikely that you could configure seemless passthrough style execution (in terms of the Sql dialect to use) to the Jet Linked server because Sql will always want its own dialect rather than the Jet dialect.
For example if I wanted a PIVOT/Cross Tab query, I would need to decide to send a request to a precompiled Jet query that contained a 'TRANSFORM' statement or send a Sql String with the Sql Server Style 'PIVOT....FOR...' Statement. Would this be right?

Thanks
Simon

Accessing Linked Excel Server

I created a linked Excel server that is stored in a SQL2000 database.

I can run the following from the SQL server with no problem.

Select * From CSCNEDI...EDI$

When I try and run the select from my WinXP computer I get the following from both SQL2000 Query Analyzer or SQL2005 Management Studio (these are configured for client access)

[OLE/DB provider returned message: Unspecified error]

OLE DB error trace [OLE/DB Provider 'Microsoft.Jet.OLEDB.4.0' IDBInitialize::Initialize returned 0x80004005: ].

Msg 7399, Level 16, State 1, Line 1 OLE DB provider 'Microsoft.Jet.OLEDB.4.0' reported an error.

Thanks

David Davis

Schuette Inc.

Hi, David,

The error above simply indicates a failure of the Provider to open a "connection", in this case - the MDB file. Unfortunately, this is quite generic. How are you connecting to the SQL Server? Are you using SQL or NT Authentication? Is your Excel file local on the SQL box or is it on a file share? What we might be facing here seems to be an authentication problem. Here're a couple of ideas:

== If the Excel file is on a share, try to put it locally on the SQL box (reconfigure the linked server) and try the query from the workstation again

== If you are using NT authentication, try using SQL authentication to see if this changes the effect

== To confirm if this is an authentication/permission issue, use FileMon tool (http://www.microsoft.com/technet/sysinternals/FileAndDisk/Filemon.mspx) and capture the file activity when you get the failure (a good idea is to recycle SQL Server and capture the first attempt). Check the log for your excel file name and for error like "Access Denied".

HTH,

Jivko Dobrev - MSFT
--
This posting is provided "AS IS" with no warranties, and confers no rights.

Accessing jobs in EM

Hello!
I would like to allow non-admin users seeing all jobs (including ones
they do now own) in Enterpise Manager.SQL Profiler displays execution of
exec msdb..sp_help_job when querying job list. According to BOL: ' A user
who is not a member of the sysadmin fixed role can use sp_help_job to view
only the jobs he/she owns.'. I suppose xp_sqlagent_proxy_account wouldn't be
of any help in this case. Is this possible for non-admin users to see all
jobs?
Thanks,
IgorThere is no supported way to do this with Enterprise
Manager. The proxy account doesn't really come in to play
here. The system stored procedures involved in displaying
the job info in Enterprise Manager have checks for job owner
or sysadmin server role membership.
-Sue
On Fri, 21 Jan 2005 14:46:12 -0800, "Igor Marchenko"
<igormarchenko@.hotmail.com> wrote:

>Hello!
>
> I would like to allow non-admin users seeing all jobs (including ones
>they do now own) in Enterpise Manager.SQL Profiler displays execution of
>exec msdb..sp_help_job when querying job list. According to BOL: ' A user
>who is not a member of the sysadmin fixed role can use sp_help_job to view
>only the jobs he/she owns.'. I suppose xp_sqlagent_proxy_account wouldn't b
e
>of any help in this case. Is this possible for non-admin users to see all
>jobs?
>
>Thanks,
>Igor
>|||Thanks,Sue. I have found another way:
1.. Grant access to MSDB
2.. Add users to the member of TargetServerRole.
Regards,
Igor
"Sue Hoegemeier" <Sue_H@.nomail.please> wrote in message
news:lvnav0d2r3c3n64s620e9me5o0o7t1pdl6@.
4ax.com...
> There is no supported way to do this with Enterprise
> Manager. The proxy account doesn't really come in to play
> here. The system stored procedures involved in displaying
> the job info in Enterprise Manager have checks for job owner
> or sysadmin server role membership.
> -Sue
> On Fri, 21 Jan 2005 14:46:12 -0800, "Igor Marchenko"
> <igormarchenko@.hotmail.com> wrote:
>
>|||Okay but just remember it's not supported though and how
this works with this role depends on what service pack you
are on.
-Sue
On Tue, 25 Jan 2005 10:39:09 -0800, "Igor Marchenko"
<igormarchenko@.hotmail.com> wrote:

>Thanks,Sue. I have found another way:
> 1.. Grant access to MSDB
> 2.. Add users to the member of TargetServerRole.
>Regards,
>Igor
>"Sue Hoegemeier" <Sue_H@.nomail.please> wrote in message
> news:lvnav0d2r3c3n64s620e9me5o0o7t1pdl6@.
4ax.com...
>|||Thanks a lot,Sue.
"Sue Hoegemeier" <Sue_H@.nomail.please> wrote in message
news:5f5dv0d14fq7ajas3r6qq577is20d0gn57@.
4ax.com...
> Okay but just remember it's not supported though and how
> this works with this role depends on what service pack you
> are on.
> -Sue
> On Tue, 25 Jan 2005 10:39:09 -0800, "Igor Marchenko"
> <igormarchenko@.hotmail.com> wrote:
>
>

Accessing Java within SQL Server

have a Java Class that I want to be able to access from within a SQL Server Stored procedure. I know we can access C# and other .NET Framework code, but how can you access a Java Class?

How would you access a Java class from "normal" .NET code?

Niels

Accessing Initiating Event + Data From Existing External DB

Hello,
I have been exploring NS and I would like to use it as a rudimentary transfer tool. I have an existing database table from where I would to transfer a record to subscribers and then possibly move the records out of that table.

1. How do I set up the ..\SubscriptionClasses\SubscriptionClass\EventRules\EventRule so that it reads from another database? The TSQL Statement should probably work accross databases?

2. As I scroll through the sample ADFs I would think that ..\Providers\HostedProvider should also change too to another type.

Thank you very much,

Lubomir

Hi Lubomir -

Using the SQL Server Event Provider, you can collect events from tables in other databases or even other instances of SQL Server.

Configure the HostedProvider node to use the SQL Server Event Provider. Use the EventsQuery element to enter the T-SQL code that you will use to recognize new rows (or events of interest) in the table. Here's a sample.

<HostedProvider>
<ProviderName>SqlPrEP</ProviderName>
<ClassName>SQLProvider</ClassName>
<SystemName>%_NSSystem_%</SystemName>
<Schedule>
<Interval>P0DT00H00M60S</Interval>
</Schedule>
<Arguments>
<Argument>
<Name>EventsQuery</Name>
<Value>SELECT rowId, col1, col2, col3 FROM AnotherDb.dbo.vwCurrentRows WHERE rowId NOT IN (SELECT rowId FROM MyChron)</Value>
</Argument>
<Argument>
<Name>EventClassName</Name>
<Value>PressRelease</Value>
</Argument>
</Arguments>
</HostedProvider>

Next you can use the EventRule node of the SubscriptionClass to define your match rule; that is to write the T-SQL code that matches the events that you've collected to those subscribers who are interested in your events.

You EventRule would look something like this.

<EventRule>
<EventClassName>PressRelease</EventClassName>
<RuleName>PrEventRule</RuleName>
<Action>
INSERT INTO PrNotifications(
SubscriberId,
DeviceName,
SubscriberLocale,
col1,
col2)
SELECT
s.SubscriberId,
s.SubscriberDeviceName,
s.SubscriberLocale,
e.col1,
e.col2
FROM
PressRelease e,
PrSubscription s
WHERE
e.col3 = s.col3
</Action>
<ActionTimeout>P0DT00H00M45S</ActionTimeout>
</EventRule>

HTH...

Joe

Accessing Index Server from SQL Server on different system

Hi
I have SQL Server and Index Server running on 2 different system.
How can I call Index server from SQL Server (store procedure) in such
case.
Regards

> Hi
> I have SQL Server and Index Server running on 2 different system.
> How can I call Index server from SQL Server (store procedure) in such
> case.
> Regards
You can connect use the OLE DB Provider for Microsoft Indexing Service to
connect to the remote Index Server. More info:
http://msdn.microsoft.com/library/de...us/acdata/ac_8
_qd_12_0h0l.asp
Eric Crdenas
Support professional
This posting is provided "AS IS" with no warranties, and confers no rights.

Accessing Index Server from SQL Server on different system

Hi
I have SQL Server and Index Server running on 2 different system.
How can I call Index server from SQL Server (store procedure) in such
case.
Regards
> Hi
> I have SQL Server and Index Server running on 2 different system.
> How can I call Index server from SQL Server (store procedure) in such
> case.
> Regards
--
You can connect use the OLE DB Provider for Microsoft Indexing Service to
connect to the remote Index Server. More info:
http://msdn.microsoft.com/library/d...-us/acdata/ac_8
_qd_12_0h0l.asp
Eric Crdenas
Support professional
This posting is provided "AS IS" with no warranties, and confers no rights.

Accessing Index Server from SQL Server on different system

Hi
I have SQL Server and Index Server running on 2 different system.
How can I call Index server from SQL Server (store procedure) in such
case.
Regards> Hi
> I have SQL Server and Index Server running on 2 different system.
> How can I call Index server from SQL Server (store procedure) in such
> case.
> Regards
--
You can connect use the OLE DB Provider for Microsoft Indexing Service to
connect to the remote Index Server. More info:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/acdata/ac_8
_qd_12_0h0l.asp
--
Eric Cárdenas
Support professional
This posting is provided "AS IS" with no warranties, and confers no rights.

accessing image files stored as binary data

Hi

When images are uploaded and stored directly into a sql database as binary data (eg in the club starter kit) how can those images be accessed and displayed.

When I open the images table in VWD and select display data, the cells holding the image data hold a <binary data> tag. What I want to be able to do is get at that data, or actually get at the image so that it is displayed. My reason is this, at the moment the only way to access the images in the sql database after they have been uploaded is to log into the website and view them as an administrator of the site. It would be much simpler if I could access the database directly and view the contents of the images table.

Any ideas?

Thanks

If you're trying to displaying the image stored in sql server from a grid view, perhaps you should read the following post:

http://forums.asp.net/thread/1337670.aspx

Hope that helps

|||This is the same post you made here:http://forums.asp.net/thread/1337011.aspx. Please do not post the same question multiple times.

Accessing HttpContext.Current from code section in report

I am trying to access HttpContext.Current in my report code section (report properties) since I have to look at a cookie. However, HttpContext.Current is always null. Has anyone managed to access HttpContex.Current from a report?

Thanks in advance.

Ok, it was security permission problem with the code section. After deploying the report I got the #Error when trying to access HttpContext.Current. I modified the rssrvpolicy.config (location c:\Program Files\Microsoft SQL Server\MSSQL.3\Reporting Services\ReportServer\) to FullTrust for the Code section and then it started working.

<CodeGroup class="UnionCodeGroup" version="1" PermissionSetName="FullTrust"

Name="Report_Expressions_Default_Permissions" Description="This code group grants default permissions for code in report

expressions and Code element. ">

instead of

<CodeGroup class="UnionCodeGroup" version="1" PermissionSetName="Execution"

Name="Report_Expressions_Default_Permissions" Description="This code group grants default permissions for code in report

expressions and Code element. ">

Probably not recommended but for now I am just testing. Will move the code to an assembly later and give that assembly FullTrust instead.

Accessing grouped values "inside" fields

Hello,
I'm struggling to make operations on results obtained from grouping by
specific dimensions. To be more specific, I'd like to substract value of
e.g. sales for some product for one year from values from the preceding
year.
I'd like to somehow access the resulting recordset from grouping and make
some operations on these values, just like the SUBTOTAL function does.
Thanks in advance for any help.
Best wishes,
Marek T³uczekOne correction to my question:
> I'd like to somehow access the resulting recordset from grouping and make
> some operations on these values, just like the SUBTOTAL function does.
I meant not recordset, but set of fields.
> Thanks in advance for any help.
> Best wishes,
> Marek T³uczek
>
>

Accessing Global Cursor

hi friends,

Here is the stored procedures that I used.

--------------------------
create procedure globalCursor
AS
DECLARE abc CURSOR GLOBAL FOR
select * from sales
OPEN abc

create procedure globalCursorTest
AS
DECLARE @.sdate datetime
DECLARE @.sperson varchar(15)
DECLARE @.sregion varchar(15)
DECLARE @.sales int
EXECUTE globalCursor
FETCH NEXT FROM abc INTO @.sdate, @.sperson, @.sregion, @.sales
print @.sdate
print @.sperson
print @.sregion
print @.sales
--------------------------

When I execute globalCursorTest using SQL Query Analyser, it says

--------------------------
Server: Msg 16915, Level 16, State 1, Procedure globalCursor, Line 4
A cursor with the name 'abc' already exists.
Server: Msg 16905, Level 16, State 1, Procedure globalCursor, Line 5
The cursor is already open.
--------------------------

how to solve this? or in other words, how to simply create the procedure in the database without executing it, as i can see the execution of the first procedure globalCursor causes this problem.

JakeLooks like the abc cursor is not closed/deallocated. Does either one of the procedures perform these actions?|||Ummm...

Do you have an Oracle background?

To my knowledge it doesn't work that way, though I'll go test it out...

And yes, as Kaiowas points out you need to

CLOSE ABC
DEALLOCATE ABC

But still, it looks like you're trying to mimic reference CURSORs like Oracle has...|||hi brett,

I'm new to database and doing DB2 to SQL server migration tool project.
In DB2, one procedure can access the cursors opened by another procedure, after calling it. The called procedure will not return the cursor and it will not even have the cursor as the output parameter. But it will just open the cursor at the end of the procedure and the cursor is specially declared with the clause 'WITH RETURN TO CALLER/CLIENT'.

The calling procedure just allocate cursors to the result sets opened by the called procedure, in the order.

I thought I can achieve this using Global cursor in sql server, but i'm not sure. That's what I am trying.

Yes, I agree that I missed to put CLOSE abc & DEALLOCATE abc at the end of the second procedure.
but that will not solve my problem.
I like to know how to just create the procedure in the sql server database without executing it, as i can guess the cause of the problem 'cursor already opened' is due to the execution of the first procedure while I try to create it in the database.

Appreciate your he
Jake

Originally posted by Brett Kaiser
Ummm...

Do you have an Oracle background?

To my knowledge it doesn't work that way, though I'll go test it out...

And yes, as Kaiowas points out you need to

CLOSE ABC
DEALLOCATE ABC

But still, it looks like you're trying to mimic reference CURSORs like Oracle has...|||anybody know about this....

Originally posted by Jake K
hi brett,

I'm new to database and doing DB2 to SQL server migration tool project.
In DB2, one procedure can access the cursors opened by another procedure, after calling it. The called procedure will not return the cursor and it will not even have the cursor as the output parameter. But it will just open the cursor at the end of the procedure and the cursor is specially declared with the clause 'WITH RETURN TO CALLER/CLIENT'.

The calling procedure just allocate cursors to the result sets opened by the called procedure, in the order.

I thought I can achieve this using Global cursor in sql server, but i'm not sure. That's what I am trying.

Yes, I agree that I missed to put CLOSE abc & DEALLOCATE abc at the end of the second procedure.
but that will not solve my problem.
I like to know how to just create the procedure in the sql server database without executing it, as i can guess the cause of the problem 'cursor already opened' is due to the execution of the first procedure while I try to create it in the database.

Appreciate your he
Jake|||"In DB2, one procedure can access the cursors opened by another procedure, after calling it."

Sounds like a recipe for scope disaster to me. As if cursors weren't bad enougth to begin with.|||I guess my best suggestion would be to rewrite your cursor procedure as a table function.|||hi,

it's definitely not scope disaster!!! By default, the cursors opened in a procedure could not be accessed from another procedure. If one wants this kind of feature, the cursor has to be specially declared with the option "WITH RETURN TO CALLER/CLIENT". It's like Sequel's local & global cursor concept. In global cursor, the cursor can be accessed from outside where it is declared.

Jake

Originally posted by blindman
"In DB2, one procedure can access the cursors opened by another procedure, after calling it."

Sounds like a recipe for scope disaster to me. As if cursors weren't bad enougth to begin with.|||thanks for your suggestion. as of now, i don't know about table function. I will try it out...
but i have another way of achieving this. the procedure that i attached in the starting mail is working fine, of course after including close & disallocate stmts at the end of the second procedure, globalCursorTest.
previously i used SQL Query Analyser GUI which will compile & execute the procedure at one shot. Thus the globalCursor procedure executed twice, which caused the 'cursor already opened' error.
As I mentioned in my earlier mails, i search for a mechanism which will only compile & create the procedure into the db without executing it. I find isql command line tool creates the procedure into the db without executing it.
After creating both the procedures, i executed second procedure, globalCursorTest. It works fine.

friends, Thanks for your time.

Jake

Originally posted by blindman
I guess my best suggestion would be to rewrite your cursor procedure as a table function.

Accessing FTP site from sql server

How to create DTD compatible XML file from result set returned from a query.

Can we access FTP site and upload this xml ?

Is it possible to do from Tsql?

I suggest that you might use CLR stored procedures to accomplish what you desire. You can write C# code to extend the functionality of SQL Server and have the client call a custom stored procedure to execute that C# code. This should enable you to populate a document in any format from data stored in the server and connect over FTP to upload the file.

Hope this helps,

John

|||

http://msdn2.microsoft.com/en-US/library/aa197263(SQL.80).aspx

Maybe this site can help you with witing the extended store procedure to accomplish what you want to do.
Please that DTD is deprecated , you may want to look into using XSD.

Accessing FTP site from sql server

How to create DTD compatible XML file from result set returned from a query.

Can we access FTP site and upload this xml ?

Is it possible to do from Tsql?

I suggest that you might use CLR stored procedures to accomplish what you desire. You can write C# code to extend the functionality of SQL Server and have the client call a custom stored procedure to execute that C# code. This should enable you to populate a document in any format from data stored in the server and connect over FTP to upload the file.

Hope this helps,

John

|||

http://msdn2.microsoft.com/en-US/library/aa197263(SQL.80).aspx

Maybe this site can help you with witing the extended store procedure to accomplish what you want to do.
Please that DTD is deprecated , you may want to look into using XSD.

accessing from T-SQL a database on another DBMS

tHi
I want to build a trigger to modify data in a table in a database that is
running on another Database Engine in may LAN. I don' t know if that is
possible. If it is, how will I make the connection to that database?
Thanks in advance - WaldoYou would have to set up the other instance as a "linked server". But what you want to do requires a
distributed transaction (with DTC running and all that jazz) so I would re-think the approach if
possible.
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://sqlblog.com/blogs/tibor_karaszi
"wvandenbroeck" <wvandenbroeck@.discussions.microsoft.com> wrote in message
news:2A416FD1-02F9-427D-9748-7F2CE4E08CDD@.microsoft.com...
> tHi
> I want to build a trigger to modify data in a table in a database that is
> running on another Database Engine in may LAN. I don' t know if that is
> possible. If it is, how will I make the connection to that database?
> Thanks in advance - Waldo|||I concur. Consider some form of asynchronous mechanism where by you put the
requisite information in a queing table and pull from the other db engine to
do the updates.
You can get DTC to do what you need however, but it is often a PITA. :)
--
Kevin G. Boles
TheSQLGuru
Indicium Resources, Inc.
"Tibor Karaszi" <tibor_please.no.email_karaszi@.hotmail.nomail.com> wrote in
message news:eh02e1bLIHA.4684@.TK2MSFTNGP06.phx.gbl...
> You would have to set up the other instance as a "linked server". But what
> you want to do requires a distributed transaction (with DTC running and
> all that jazz) so I would re-think the approach if possible.
> --
> Tibor Karaszi, SQL Server MVP
> http://www.karaszi.com/sqlserver/default.asp
> http://sqlblog.com/blogs/tibor_karaszi
>
> "wvandenbroeck" <wvandenbroeck@.discussions.microsoft.com> wrote in message
> news:2A416FD1-02F9-427D-9748-7F2CE4E08CDD@.microsoft.com...
>> tHi
>> I want to build a trigger to modify data in a table in a database that is
>> running on another Database Engine in may LAN. I don' t know if that is
>> possible. If it is, how will I make the connection to that database?
>> Thanks in advance - Waldo
>

accessing from T-SQL a database on another DBMS

tHi
I want to build a trigger to modify data in a table in a database that is
running on another Database Engine in may LAN. I don' t know if that is
possible. If it is, how will I make the connection to that database?
Thanks in advance - Waldo
I concur. Consider some form of asynchronous mechanism where by you put the
requisite information in a queing table and pull from the other db engine to
do the updates.
You can get DTC to do what you need however, but it is often a PITA.
Kevin G. Boles
TheSQLGuru
Indicium Resources, Inc.
"Tibor Karaszi" <tibor_please.no.email_karaszi@.hotmail.nomail.com> wrote in
message news:eh02e1bLIHA.4684@.TK2MSFTNGP06.phx.gbl...
> You would have to set up the other instance as a "linked server". But what
> you want to do requires a distributed transaction (with DTC running and
> all that jazz) so I would re-think the approach if possible.
> --
> Tibor Karaszi, SQL Server MVP
> http://www.karaszi.com/sqlserver/default.asp
> http://sqlblog.com/blogs/tibor_karaszi
>
> "wvandenbroeck" <wvandenbroeck@.discussions.microsoft.com> wrote in message
> news:2A416FD1-02F9-427D-9748-7F2CE4E08CDD@.microsoft.com...
>