Showing posts with label inside. Show all posts
Showing posts with label inside. Show all posts

Friday, March 23, 2012

Name of running procedure

Is it possible in 2000 (or 2005) to get the name of the currently running
procedure, from inside the procedure?
I would like to write code to log procedure events, without having to change
the procedure name as I copy it from one procedure to another.
Thanks,
JayOn Tue, 18 Sep 2007 10:59:51 -0700, "Jay" <nospan@.nospam.org> wrote:
>Is it possible in 2000 (or 2005) to get the name of the currently running
>procedure, from inside the procedure?
Yes.
CREATE PROCEDURE testprocedure AS
SELECT @.@.PROCID AS 'ProcID',
OBJECT_NAME(@.@.PROCID) AS 'Procedure'
GO
EXEC testprocedure
GO
Roy Harvey
Beacon Falls, CT|||Thanks Roy.
"Roy Harvey (MVP)" <roy_harvey@.snet.net> wrote in message
news:t260f39s14nj0ph8k4iofg7i6furlusfi7@.4ax.com...
> On Tue, 18 Sep 2007 10:59:51 -0700, "Jay" <nospan@.nospam.org> wrote:
>>Is it possible in 2000 (or 2005) to get the name of the currently running
>>procedure, from inside the procedure?
> Yes.
> CREATE PROCEDURE testprocedure AS
> SELECT @.@.PROCID AS 'ProcID',
> OBJECT_NAME(@.@.PROCID) AS 'Procedure'
> GO
> EXEC testprocedure
> GO
> Roy Harvey
> Beacon Falls, CT

Wednesday, March 21, 2012

Name of current db in proc

Hi,
What's the best way to get the name of the current db (not filename, but db
name) from inside a sp '
I'm writing a general sp that has to be put into numerous db's, except one
Kr.
SorenHi,
DB_NAME() must be the way to go :)
Soren
"Soeren S. Joergensen" <nospam@.nodomain.com> skrev i en meddelelse
news:eska3MgtFHA.2328@.TK2MSFTNGP10.phx.gbl...
> Hi,
> What's the best way to get the name of the current db (not filename, but
> db name) from inside a sp '
> I'm writing a general sp that has to be put into numerous db's, except one
>
> Kr.
> Soren
>sql

Friday, March 9, 2012

MYSQL - DTS - MSSQL help needed Warning novice inside!

Hi,
**I appologise as this is posted in microsoft.public.sqlserver.dts
also**
Would anyone be so kind and point me in the rigth direction?
I have a mysql server and a MSSQL 2000 server.
MYSQL
Database name is Membership
Table is Users
Column is email_address.
I want to transfer the email_address data over to a column in an
existing MSSQL Database.
When I run the DTS wizard I can successfully connect to the MYSQL
database server, but the only option I get is to use a SQL Statement.
So this is what I have started with...
mysql_select_db('membership');
SELECT * FROM users WHERE email_address='"*"
If i try and preview I get an unexpected errror and if i run through
the wizard I get wrong systax at line 1.
I am a total novice at this and am stumbling around in the dark...
Any help much appreciated...
Thanks
Col
**Sorry this is posted in microsoft.public.sqlserver.dts also..**Sorry to add I need this to be automated which is why I am trying to
use DTS
Thanks
Col|||Do you want to transfer all email addresses?
If so, I think this is what you want to do
SELECT * FROM membership.users
Hilary Cotter
Director of Text Mining and Database Strategy
RelevantNOISE.Com - Dedicated to mining blogs for business intelligence.
This posting is my own and doesn't necessarily represent RelevantNoise's
positions, strategies or opinions.
Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602.html
Looking for a FAQ on Indexing Services/SQL FTS
http://www.indexserverfaq.com
"techcs" <colinsealeaf@.blueyonder.co.uk> wrote in message
news:1158045662.036499.225710@.e3g2000cwe.googlegroups.com...
> Hi,
> **I appologise as this is posted in microsoft.public.sqlserver.dts
> also**
> Would anyone be so kind and point me in the rigth direction?
>
> I have a mysql server and a MSSQL 2000 server.
>
> MYSQL
> Database name is Membership
> Table is Users
> Column is email_address.
>
> I want to transfer the email_address data over to a column in an
> existing MSSQL Database.
>
> When I run the DTS wizard I can successfully connect to the MYSQL
> database server, but the only option I get is to use a SQL Statement.
> So this is what I have started with...
>
> mysql_select_db('membership');
> SELECT * FROM users WHERE email_address='"*"
>
> If i try and preview I get an unexpected errror and if i run through
> the wizard I get wrong systax at line 1.
>
> I am a total novice at this and am stumbling around in the dark...
>
> Any help much appreciated...
>
> Thanks
> Col
> **Sorry this is posted in microsoft.public.sqlserver.dts also..**
>|||techcs wrote:
> Sorry to add I need this to be automated which is why I am trying to
> use DTS
> Thanks
> Col
>
Automation doesn't require DTS. If you can connect to mysql with DTS,
then you can connect with other components as well. Create a linked
server that points to the mysql instance, and then you can use a simple
SELECT statement to grab the data. The SELECT statement can then be
scheduled as an Agent job. Something like this:
SELECT email_address FROM linkedservername.Membership.dbo.Users
I don't know MySQL, so I'm not sure of the exact syntax, you might not
need the schema reference, i.e. "dbo".
Tracy McKibben
MCDBA
http://www.realsqlguy.com|||Thanks will have a look at that now... Sounds good...
Col

MYSQL - DTS - MSSQL help needed Warning novice inside!

Hi,
**I appologise as this is posted in microsoft.public.sqlserver.dts
also**
Would anyone be so kind and point me in the rigth direction?
I have a MYSQL server and a MSSQL 2000 server.
MYSQL
Database name is Membership
Table is Users
Column is email_address.
I want to transfer the email_address data over to a column in an
existing MSSQL Database.
When I run the DTS wizard I can successfully connect to the MYSQL
database server, but the only option I get is to use a SQL Statement.
So this is what I have started with...
mysql_select_db('membership');
SELECT * FROM users WHERE email_address='"*"
If i try and preview I get an unexpected errror and if i run through
the wizard I get wrong systax at line 1.
I am a total novice at this and am stumbling around in the dark...
Any help much appreciated...
Thanks
Col
**Sorry this is posted in microsoft.public.sqlserver.dts also..**Sorry to add I need this to be automated which is why I am trying to
use DTS
Thanks
Col|||Do you want to transfer all email addresses?
If so, I think this is what you want to do
SELECT * FROM membership.users
Hilary Cotter
Director of Text Mining and Database Strategy
RelevantNOISE.Com - Dedicated to mining blogs for business intelligence.
This posting is my own and doesn't necessarily represent RelevantNoise's
positions, strategies or opinions.
Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602.html
Looking for a FAQ on Indexing Services/SQL FTS
http://www.indexserverfaq.com
"techcs" <colinsealeaf@.blueyonder.co.uk> wrote in message
news:1158045662.036499.225710@.e3g2000cwe.googlegroups.com...
> Hi,
> **I appologise as this is posted in microsoft.public.sqlserver.dts
> also**
> Would anyone be so kind and point me in the rigth direction?
>
> I have a MYSQL server and a MSSQL 2000 server.
>
> MYSQL
> Database name is Membership
> Table is Users
> Column is email_address.
>
> I want to transfer the email_address data over to a column in an
> existing MSSQL Database.
>
> When I run the DTS wizard I can successfully connect to the MYSQL
> database server, but the only option I get is to use a SQL Statement.
> So this is what I have started with...
>
> mysql_select_db('membership');
> SELECT * FROM users WHERE email_address='"*"
>
> If i try and preview I get an unexpected errror and if i run through
> the wizard I get wrong systax at line 1.
>
> I am a total novice at this and am stumbling around in the dark...
>
> Any help much appreciated...
>
> Thanks
> Col
> **Sorry this is posted in microsoft.public.sqlserver.dts also..**
>|||techcs wrote:
> Sorry to add I need this to be automated which is why I am trying to
> use DTS
> Thanks
> Col
>
Automation doesn't require DTS. If you can connect to MySQL with DTS,
then you can connect with other components as well. Create a linked
server that points to the MySQL instance, and then you can use a simple
SELECT statement to grab the data. The SELECT statement can then be
scheduled as an Agent job. Something like this:
SELECT email_address FROM linkedservername.Membership.dbo.Users
I don't know MySQL, so I'm not sure of the exact syntax, you might not
need the schema reference, i.e. "dbo".
Tracy McKibben
MCDBA
http://www.realsqlguy.com|||Thanks will have a look at that now... Sounds good...
Col