Showing posts with label connection. Show all posts
Showing posts with label connection. Show all posts

Monday, March 26, 2012

How to get the log file with /logger option

Hi,

I want to get the log for the below command.

DTExec /FILE "C:\Test.dtsx" /CONNECTION DestinationConnectionFlatFile;"c:\test.csv" /CONNECTION SourceConnectionOLEDB;"Data Source=test;User ID=user;Initial Catalog=DATA_CONV;Provider=SQLNCLI;Auto Translate=false;PASSWORD=password" /MAXCONCURRENT " -1 " /CHECKPOINTING OFF /REPORTING EWCDI /logger "DTS.LogProviderTextFile;log.txt" /Set "\package.Connections[log.txt].Properties[ConnectionString];c:\log.txt"

But I got the error as below. Please advise.

Error: 2006-10-10 09:57:21.07
Code: 0xC001000E
Source: Test
Description: The connection "log.txt" is not found. This error is thrown by C
onnections collection when the specific connection element is not found.
End Error
Error: 2006-10-10 09:57:21.10
Code: 0xC001000E
Source: Test
Description: The connection "log.txt" is not found. This error is thrown by Connections collection when the specific connection element is not found.
End Error
Warning: 2006-10-10 09:57:21.14
Code: 0x8001F02F
Source: Test
Description: Cannot resolve a package path to an object in the package ".Connections[log.txt].Properties[ConnectionString]". Verify that the package path is valid.
End Warning
Warning: 2006-10-10 09:57:21.17
Code: 0x80012017
Source: Test
Description: The package path referenced an object that cannot be found: "\package.Connections[log.txt].Properties[ConnectionString]". This occurs when an attempt is made to resolve a package path to an object that cannot be found.
End Warning
DTExec: Could not set \package.Connections[log.txt].Properties[ConnectionString]
value to c:\log.txt.

Are you using dtexecui.exe to build the command line? If not, please do that, as it will build properly formed dtexec parameter set.

If you want to add a logger from the command line, it must reference a pre-existent connection manager in the package. So add a file connection manager to the package.

Now if you want a logger without a pre-existent connection manager, and you don't mind coding, create your own LogProvider by creating a subclass of LogProviderBase and overriding of meaning of the ConfigString, when generally points to a connection manager in stock loggers.

Two custom log providers with source code are available in the SQL 2005 samples available at http://www.microsoft.com/downloads/details.aspx?FamilyID=E719ECF7-9F46-4312-AF89-6AD8702E4E6E&displaylang=en

Wednesday, March 21, 2012

How to get the current User when using a general connection user

I have a VB.Net app and a SQL Server 2005 database. Users must login to use
the application, and I have an Employee table to store their details.
However, I use a common user ID to connect to the database (for reasons I
won't go into here).
My problem is, some of my triggers need to know who the current user is, and
of course I can't use the current connection information to get this as I
always get the common user ID.
Does anyone have a technique to solve this dilema? Maybe some way to set a
variable or something when I connect so that I can determine which user has
initiated the connection?You can use application roles to achieve that. Works something like this:
a) Every user has a Windows account using Windows Authentication
b) When they run the application you enable the application role
c) Inside the application's session you can look at what the username is,
including in triggers, using suser_sname()
Hope this helps,
Ben Nevarez, MCDBA, OCP
Database Administrator
"David" wrote:

> I have a VB.Net app and a SQL Server 2005 database. Users must login to us
e
> the application, and I have an Employee table to store their details.
> However, I use a common user ID to connect to the database (for reasons I
> won't go into here).
> My problem is, some of my triggers need to know who the current user is, a
nd
> of course I can't use the current connection information to get this as I
> always get the common user ID.
> Does anyone have a technique to solve this dilema? Maybe some way to set a
> variable or something when I connect so that I can determine which user ha
s
> initiated the connection?
>

How to get the count of connection?

Can we use Sql Profile to get the count of connections to SQLServer?No, but you can get that data from System Monitor [perfmon.exe]
(MSSQL:General Statistics | User Connections) or simply by querying the
server. In SQL 2000 you would query the master.dbo.sysprocesses system
table (or better yet execute system procs sp_who or sp_who2) like this:
select * from master.dbo.sysprocesses;
go
exec sp_who;
go
exec sp_who2;
go
In SQL 2005 you would query the sys.dm_exec_sessions or
sys.dm_exec_connections dynamic management views (which gives you
similar info) like this:
select * from sys.dm_exec_sessions;
go
select * from sys.dm_exec_connections;
go
Hope this helps.
*mike hodgson*
http://sqlnerd.blogspot.com
ad wrote:

>Can we use Sql Profile to get the count of connections to SQLServer?
>
>sql

How to get the count of connection?

Can we use Sql Profile to get the count of connections to SQLServer?This is a multi-part message in MIME format.
--010700040007010304020809
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
No, but you can get that data from System Monitor [perfmon.exe]
(MSSQL:General Statistics | User Connections) or simply by querying the
server. In SQL 2000 you would query the master.dbo.sysprocesses system
table (or better yet execute system procs sp_who or sp_who2) like this:
select * from master.dbo.sysprocesses;
go
exec sp_who;
go
exec sp_who2;
go
In SQL 2005 you would query the sys.dm_exec_sessions or
sys.dm_exec_connections dynamic management views (which gives you
similar info) like this:
select * from sys.dm_exec_sessions;
go
select * from sys.dm_exec_connections;
go
Hope this helps.
--
*mike hodgson*
http://sqlnerd.blogspot.com
ad wrote:
>Can we use Sql Profile to get the count of connections to SQLServer?
>
>
--010700040007010304020809
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
<tt>No, but you can get that data from System Monitor [perfmon.exe]
(MSSQL:General Statistics | User Connections) or simply by querying the
server. In SQL 2000 you would query the master.dbo.sysprocesses system
table (or better yet execute system procs sp_who or sp_who2) like this:<br>
</tt>
<blockquote><tt>select * from master.dbo.sysprocesses;</tt><br>
<tt>go</tt><br>
<tt>exec sp_who;</tt><br>
<tt>go</tt><br>
<tt>exec sp_who2;</tt><br>
<tt>go</tt><br>
</blockquote>
<tt>In SQL 2005 you would query the sys.dm_exec_sessions or
sys.dm_exec_connections dynamic management views (which gives you
similar info) like this:<br>
</tt>
<blockquote><tt>select * from sys.dm_exec_sessions;<br>
go</tt><tt><br>
</tt><tt>select * from sys.dm_exec_connections;<br>
go<br>
</tt></blockquote>
<tt><br>
Hope this helps.<br>
</tt>
<div class="moz-signature">
<title></title>
<meta http-equiv="Content-Type" content="text/html; ">
<p><span lang="en-au"><font face="Tahoma" size="2">--<br>
</font></span> <b><span lang="en-au"><font face="Tahoma" size="2">mike
hodgson</font></span></b><span lang="en-au"><br>
<font face="Tahoma" size="2"><a href="http://links.10026.com/?link=http://sqlnerd.blogspot.com</a></font></span>">http://sqlnerd.blogspot.com">http://sqlnerd.blogspot.com</a></font></span>
</p>
</div>
<br>
<br>
ad wrote:
<blockquote cite="miduWZevOvJGHA.2696@.TK2MSFTNGP14.phx.gbl" type="cite">
<pre wrap="">Can we use Sql Profile to get the count of connections to SQLServer?
</pre>
</blockquote>
</body>
</html>
--010700040007010304020809--

How to get the count of connection?

Can we use Sql Profile to get the count of connections to SQLServer?
No, but you can get that data from System Monitor [perfmon.exe]
(MSSQL:General Statistics | User Connections) or simply by querying the
server. In SQL 2000 you would query the master.dbo.sysprocesses system
table (or better yet execute system procs sp_who or sp_who2) like this:
select * from master.dbo.sysprocesses;
go
exec sp_who;
go
exec sp_who2;
go
In SQL 2005 you would query the sys.dm_exec_sessions or
sys.dm_exec_connections dynamic management views (which gives you
similar info) like this:
select * from sys.dm_exec_sessions;
go
select * from sys.dm_exec_connections;
go
Hope this helps.
*mike hodgson*
http://sqlnerd.blogspot.com
ad wrote:

>Can we use Sql Profile to get the count of connections to SQLServer?
>
>

Monday, March 19, 2012

How to get source IP address of a database connection

Hi,
Is there a way to find out the source IP address of a database connection?
In trace there are only netbios names available, while I need to log the IP
addresses that connect to the database.
Thx,
Jacek Skaznik
We store the MAC address in sysprocesses while the connection is there. If
you query master..sysprocesses you'll see it, but we don't map the MAC to
an IP.
Thanks,
Kevin McDonnell
Microsoft Corporation
This posting is provided AS IS with no warranties, and confers no rights.

How to get source IP address of a database connection

Hi,
Is there a way to find out the source IP address of a database connection?
In trace there are only netbios names available, while I need to log the IP
addresses that connect to the database.
Thx,
Jacek SkaznikWe store the MAC address in sysprocesses while the connection is there. If
you query master..sysprocesses you'll see it, but we don't map the MAC to
an IP.
Thanks,
Kevin McDonnell
Microsoft Corporation
This posting is provided AS IS with no warranties, and confers no rights.

Friday, February 24, 2012

how to get just a single value from an sql database and show it in a table.

I would like to get single values from a huge sql server and put it into a table. let's say 4 by 4. How do I do that?

I have a connection string with a select statement that will only return a value. But, I do not know how to put that value into a table.

Thank you.

Hi,

You want to display data from a SQL Server database on a page having a 4 x 4 Table right? Trying reading a bit about using GridView Control, or give me a bit more detail

|||

Dearmic_lch

If you only want to display value. I think gridview is the best solution. Can u give me more information about your table ?, which fields do you want to display?

|||

I understand about GridView and I think it's great. However, I am having problems showing an N * N gridview.

For example, I wanted to create Year vs Age Matrix, but, Gridview functionality is limited. Can I do that with gridview?

|||

Hi, mic_lch,

I'm not quite sure what kind of result you need to get. Could you give us an example of the output?

Thanks!

how to get into my msn

My msn doesntwork. It sayz that they are not able to find
the SOCKS proxy server. Check the name of the server on
the connection tab. My question is that... WHAT DOES THIS
MEAN"qaasid" <anonymous@.discussions.microsoft.com> wrote in message
news:409401c3e429$02482360$a301280a@.phx.gbl...
quote:

> My msn doesntwork. It sayz that they are not able to find
> the SOCKS proxy server. Check the name of the server on
> the connection tab. My question is that... WHAT DOES THIS
> MEAN

You've posted to a newsgroup dedicated to SQL Server security. Perhaps MSN
support could help you.
Steve