Setting Passwords In Connections Using Script Task

Feb 23, 2006

I have a situation where I have to read an encrypted password from a table and set the password and userID for the connections. I wrote functions to retrieve the data from a table, decrypt the password and UserID, and set the connection string for the connection. What happens, though, is that the connection string I wrote to the connection gets changed when reading it back so that the password is no longer included. Also, in testing the connection, it fails, telling me login fails. Can anyone shed any light on this? Does anyone have sample code to show the setting of a password for a connection in a script task? All of the examples I find are for Integrated security.

View 13 Replies


ADVERTISEMENT

Setting Up Data Connections

Aug 16, 2007

Hi, I am new to MS visual web developer but i do not have any coding experience and i need some help please.Using Microsoft Visual Web Developer I clicked on create my personal website but the problem is I've created the database but do not know how to connect it to the log in wizard or createNewUser wizard.Is there a way to connecting them using drag and drops or setting it from the properties? If not what would be a sample code for it? Thank you in advanced

View 7 Replies View Related

Setting Up Trusted Connections

Dec 5, 2007

Hi,

How does one go about setting up a trusted connection to sqlserver 2005 so I don't have to put the username/password in the web.config file?

Are there any other adv/disadv. with doing this?

View 6 Replies View Related

Setting Up An Sql Server To Allow Remote Connections To It

May 5, 2008

I have a database on my computer with a series of tables in it.
I have sql server management studio express 2005 handling them.
How would I make it so I can access the database remotely, over the internet (a non-local network)

View 6 Replies View Related

SQL 2005 Passwords, Can It Be Configured To Accept Case-insensitive Passwords???

Jul 7, 2006

Users were able tolog on to our SQL 2000 servers with their passwords being case-insensitive.

Now with SQL 2005 some users can't logon because SQL 2005 passwords are case-sensitive.

Can SQL 2005 be configured so that passwords are NOT case sensitive???

Thanks!

View 6 Replies View Related

The Script Files Failed To Load In Script Task When Setting A Breakpoint In The Task On Vista

Mar 15, 2007

I cannot set a breakpoint in a Script task and have it complete successfully. I am running Vista 32-bit and only the workstation tools for SQL Server 2005 SP2. The steps to recreate are:

1) Create a new SSIS project/package.
2) Add a Script Task.
3) Set a breakpoint in the Script Task.
4) Run the package.

When I remove the breakpoint, the script task succeeds. When I put it back the task fails. The execution results say "Error: The script files failed to load." I completely uninstalled all SQL Server 2005-related entries using the Programs and Features control panel, rebooted, reinstalled the Workstation Tools, then applied a freshly-downloaded SQL Server 2005 SP2 and rebooted. If I change "RecompileScriptIntoBinaryCode" to false the script fails whether there's a breakpoint or not. If it's true (the default), the script only fails when a breakpoint is set. I would like to be able to set a breakpoint to assist in debugging the package. For the time being, I can move the package to a different (non-Vista) OS, where it works fine, but I would like to be able to develop and debug on Vista.

View 4 Replies View Related

Accessing Package Connections In A Script Task

Mar 24, 2008

I'm trying to access data from within a Script Task. I need to create a dynamic IN statement based on the data within a table in my database. Basically, I want to connect to this table, lop through the rows and create the IN statement for use in another query.

I have a SQL Connection in the package using Native OleDB. Can someone walk me through the best way to use this connection to select data from a table within the Script Task?

Thanks for your help!

View 4 Replies View Related

Setting FTP Task To Ascii

Aug 17, 2004

I have an file I FTP onto the server using a FTP task in my DTS package. The problem I'm having is the FTP task downloads using binary format, whereas I need it to download using ascii format. Binary is causing characters in the file to change, and my import is failing.

Any idea on how to set it to download as ascii?

View 2 Replies View Related

Setting Column Value In Script Task

Oct 2, 2006

This should be simple. I have a package which reads a flat file into a data flow. One of the columns (RefNumber) needs to be parsed and split into 2 distinct values. So in the dataflow I add the 2 new columns (ID1 & ID2) in a derived column transformation, and then call a script task.

In the script task, RefNumber is readonly, ID1 & ID2 are readwrite.

Here's a cut-down version of the script task with the boring stuff removed;

Public Overrides Sub Parser_ProcessInputRow(ByVal Row As ParserBuffer)
Dim narrative As String = Row.RefNumber.Trim()

If (String.IsNullOrEmpty(narrative)) Then
Return
End If

'lots of stuff happening here not relevant to the question so snipped

If ((IsNumeric(narrative)) And (narrative.Length = 16)) Then
Row.ID1 = Int32.Parse(narrative.Substring(0, 8))
Row.ID2 = Int32.Parse(narrative.Substring(8))
Return
End If
End Sub


Looking at a data viewer after the script task, the values aren't being set. I also stuck some MsgBoxes into the script task and the Row values are being properly in the script.

I know I'm missing something obvious ... any ideas?

Thanks,

Greg.

View 2 Replies View Related

Problems With Connections And Analysis Service Processing Task In SSIS

May 30, 2008

Hi everybody,

I'm fairly new to the SSAS/SSIS world (though not new on databases, etc.) and I'm having some problems with the SSIS packages in our Cube environment.

Currently in our SSAS/SSIS project, we have two major connection managers, one to the database we use for loading the Cube, and the other connector for the cube itself. To load the data from the database to the cube, we wrote some SSIS packages and used the Analysis Service Processing tasks to process all the dimensions and measures. This works pretty good, so no problems here.

The real problem starts, when I try to change the connection parameters, e.g. because the server changed, or the database has been renamed.
As soon as the connection managers points to another (existing) cube, regardless if the structure is exactly the same as the one of the old cube, the tasks lose all the assigned objects from their lists. It is really annoying to add all these exactly same objects to the task again. I tried experimenting with the DelayValidation attribute so the Development Studio doesn't destroy my work every time, but when I deploy the package the Cube breaks. Obviously some kind of deeper connection is destroyed when I change the connection string.

Is there a way to prevent the package from breaking/losing objects, without me having to sacrifice 15 minutes every time I change the connection parameters?

Regards,
Tris

View 4 Replies View Related

Setting Global Variables In A Script Task, HOW?

Jan 3, 2007

I'm playing (and trying to learn)...

I have an FTP task in a for each containter and am setting the RemotePath using an expression (works great). Thought I could use this to start learning some of the scripting funtionality in SSIS (in a script task) so found some code in this forum (thanks Original Posters!) and tried my hand at some coding... Intent was to create a variable and then dynamically overwrite the Expression in the FTP Task from the script (I know I don't need to do this, I just wanted to use it for learning purposes)....

I have a variable named varFTPDestPathFileName (string) and want to set it to the value of varFTPDestPath (string) + varFTPFileName (string). Note: all variables are scoped at the package level (could this be the problem?). I did not assign any of the variables to ReadOnly or ReadWrite on the Script Task Editor page (seems to me that doing this in the code is a whole lot cleaner [and self documenting] than on the Task Editor page)...

I keep getting the following error:
"The element cannot be found in a collection. This error happens when you try to retrieve an element from a collection on a container during execution of the package and the element is not there."

Here is the script:

Public Sub Main()
Dim vars As Variables
' Lock for Read/Write the variables we are going to use
Dts.VariableDispenser.LockForRead("User::varFTPDestPath")
Dts.VariableDispenser.LockForRead("User::varFTPFileName")
Dts.VariableDispenser.LockForWrite("User::varSourcePathFileName")
Dts.VariableDispenser.GetVariables(vars)

' Set Value of varSourcePathFileName <<--- ERROR OCCURS HERE
vars("User::varSourcePathFileName").Value = _
Dts.Variables("User::varFTPDestPath").Value.ToString + _
Dts.Variables("User::varFTPFileName").Value.ToString

vars.Unlock()

Dts.TaskResult = Dts.Results.Success

End Sub

I would also like to be able to loop through the Dts.VariableDispensor to see the contents of the variables and their values.

Somthing like

For each ??? in vars
msgbox(???.Value)
Next

One other question... Do we always have to preface the variable with "User::" or "System::", if so can you explain why?

Any help would be much appreciated....

View 17 Replies View Related

Execute Package Task: Setting Child Variables

Feb 13, 2007

Hi,
Let's say I have a package taking as parameter "InvoiceID". I want to execute this package as a child in another package. The parent package gets the list of invoices to produce and calls the child package for each entry of the list.

How do I pass the InvoiceID to the child? I know I can use the parent's variables from the child but I don't want the child package to be dependant on the parent package. For example, I might want to execute the "child" package as a stand-alone in development (providing it with a predefined InvoiceID). I might also want to call the same child package from another parent package with other variable names.

What I would like to do is "push" the value instead of "pulling" it. I know it's possible using the command line and the /SET option (ex.: /SET Package.Variables[InvoiceID].Value;' 184084)... Is it possible using the Execute Package Task?

Thanks

View 4 Replies View Related

Error When Using Configuration File For Source And Destination Connections In A Data Flow Task

Mar 7, 2008

Hi all,

I have a package that does simple exporting from an excel sheet to a table.
I used a Dataflow task with Excel Source and OLEDB Destination Components.
And i created Package configurations for Source and Destination Components.
After than when i execute the package i get the following error.


Information: 0x40016041 at ProductDetails_Import: The package is attempting to configure from the XML file "D:TEST_ETLLPL_Config2.dtsConfig".

Information: 0x40016041 at ProductDetails_Import: The package is attempting to configure from the XML file "D:TEST_ETLDBCon2.dtsConfig".

SSIS package "ProductDetails_Import.dtsx" starting.

Information: 0x4004300A at Data Flow Task, DTS.Pipeline: Validation phase is beginning.

Error: 0xC0202009 at ProductDetails_Import, Connection manager "Excel Connection Manager": SSIS Error Code DTS_E_OLEDBERROR. An OLE DB error has occurred. Error code: 0x80040E21.

An OLE DB record is available. Source: "Microsoft OLE DB Service Components" Hresult: 0x80040E21 Description: "Multiple-step OLE DB operation generated errors. Check each OLE DB status value, if available. No work was done.".

Error: 0xC020801C at Data Flow Task, Excel Source [1]: SSIS Error Code DTS_E_CANNOTACQUIRECONNECTIONFROMCONNECTIONMANAGER. The AcquireConnection method call to the connection manager "Excel Connection Manager" failed with error code 0xC0202009. There may be error messages posted before this with more information on why the AcquireConnection method call failed.

Error: 0xC0047017 at Data Flow Task, DTS.Pipeline: component "Excel Source" (1) failed validation and returned error code 0xC020801C.

Error: 0xC004700C at Data Flow Task, DTS.Pipeline: One or more component failed validation.

Error: 0xC0024107 at Data Flow Task: There were errors during task validation.

SSIS package "ProductDetails_Import.dtsx" finished: Failure.

The program '[2416] ProductDetails_Import.dtsx: DTS' has exited with code 0 (0x0).

I have been trying to troubleshoot the error message given below from last evening.


I have been trying to troubleshoot the error from last morning.
Counld not figure out what is causing this error to occur.

Please help!!!!
Any pointersSuggestions would be highly appreciated.

Thanks & Regards

View 3 Replies View Related

Execute DTS 2000 Package Task: Invalid GUID When Setting PackageId Via Expression

May 24, 2007

Hi there,

I'm creating an SSIS package that will execute legacy dts packages. The package to be executed is decided at runtime using a sql query task.

Executing a dts package statically works fine, but when I try to set the details of the dts to be run via expressions, I get the error below.

To make it dynamic, I created a variable of type string, and put the package name in here. I also have a string variable for the packageid. Then I set up an expression on the Execute DTS 2000 Package Task that sets the PackageName & PackageID property to this variable.

The PackageId is a string variable I've retrieved using:

select top 1 name,
cast(id AS varchar(50)) id,
cast(versionid AS varchar(50)) versionid
from sysdtspackages
where name = @PackageName
order by createdate desc

When I use the task to set the package id it works find (by selecting a dts, then changing the name), but when I try to provide the package id I get this message:


Error: 0x0 at Execute DTS 2000 Package Task: System.Runtime.InteropServices.COMException (0x8004040E): Invalid GUID specified.
at DTS.PackageClass.LoadFromSQLServer(String ServerName, String ServerUserName, String ServerPassword, DTSSQLServerStorageFlags Flags, String PackagePassword, String PackageGuid, String PackageVersionGuid, String PackageName, Object& pVarPersistStgOfHost)
at Microsoft.SqlServer.Dts.Tasks.Exec80PackageTask.PackageUtils.LoadDTS8Package(String pkgSrc, String sourceUser, String sourcePwd, Int32 srcType, Boolean bUseTrustedConnection, String packageName, String packagePassword, String packageID, String packageVersionGUID)
at Microsoft.SqlServer.Dts.Tasks.Exec80PackageTask.Exec80PackageTask.LoadPackage()
at Microsoft.SqlServer.Dts.Tasks.Exec80PackageTask.Exec80PackageTask.ExecuteThread()
Task failed: Execute DTS 2000 Package Task

but the method signature specifies String PackageGuid, and it is a string..

any ideas??

i tried casting the variable like so:

(DT_GUID) @[User:TSPkgId], as the versionid is a uniqueidentifier on sysdtspackages.. It didn't like that at all (can't cast from type DT_WSTR to DT_GUID error code 0xC00470C2)

View 8 Replies View Related

Built In Limit Or Setting That Limits The Number Of Rows From An OLE DB Source Table In A Data Flow Task?

Feb 16, 2007

I have a table that I'm loading as part of a control flow that in turn is copied to a target table by using a data flow task. I am doing this because a different set of fields may be used from the source entry to create the target entry based on a field in the source table. That same field may indicate that multiple entries need to be created in the target table from one source table entry for which I use a multi-cast transformation.

The problem I'm having is that no matter how many entries there are in the source table, the OLE DB Source during execution only shows 7,532 entries being taken from the source table. If there are less than 7,532 entries in the source table, everything processes fine. More than 7,532 and the data flow task only takes 7,532 and then seems to hang. It also seems as though only one path of the multi-cast transformation is taken when the conditional split directs a source entry down that path.

Seems like a strange problem I know, but any insight anyone could provide is appreciated. Thanks.

View 1 Replies View Related

Unexpected Behavior When Setting A Script Task Breakpoint In Package W/ Multiple Script Tasks

Apr 16, 2006

I ran into a variety of problems trying to set a script task breakpoint in a package containing multiple script tasks. The debugger apparently treats the breakpoint as if it were set in ALL tasks in the package, not just the one in which it is actually set.

At best this results in hitting breakpoints in scripts where they are not set and at worst the debugger brings up the "Send error report" dialog and quits (while the package continues to run). The latter seems to happen most often when the script with the breakpoint has more lines than an earlier script and the breakpoint is set at a line number that exceeds the number of lines in the earlier script--it bombs when the earlier, shorter script starts.

To get the debugger to work under these circumstances I had to add some nonsense code like


While False
Dim i as Integer = 0
End While
to every script, at the same line number near the beginning of the script (line 40, for example). I then set a breakpoint on the middle statement in one of the scripts (doesn't matter which) to cause the debugger to open at runtime. It doesn't hit the breakpoint because the line is never executed. If the breakpoint is set on a line that can be executed in any script in the package, bad things tend to happen.
I then add a "stop" statement to the script that I want to debug. This only works if the debugger is already open, hence the dummy breakpoint above.
This workaround is usable, but I am debugging a package that has quite a few scripts and having to insert dummy code in all of them at a fixed line number is rather inconvenient. I would really like to see breakpoints work the way one would expect--only in the scripts where they are set.
Is there some other, easier way around this problem? Is there at least an easier way to get the debugger to open so that "stop" will work?

View 3 Replies View Related

Need Help - Converting OLEDB Connections To SQL Connections In Asp.net

May 17, 2005

Hi there,
        Here we have got a
asp.net application that was developed when database was
sitting on SQL server 6.5. Now client has moved all of their databases
to SQL server 2000. When the database was on 6.5 the previous
development team has used oledb connections all over. As the databases
have been moved to SQL server 2000 now i am in process of changing the
database connection part. As part of the process i have a login
authorization code.
Private Function Authenticate(ByVal username As String, ByVal password As String, ByRef results As NorisSetupLib.AuthorizationResult) As Boolean
Dim conn As IDbConnection = GetConnection()
Try
Dim cmd As IDbCommand = conn.CreateCommand()
Dim sql As String = "EDSConfirmUpdate" '"EDSConfirmUpdate""PswdConfirmation"
'Dim cmd As SqlCommand = New SqlCommand("sql", conn)

cmd.CommandText = sql
cmd.CommandType = CommandType.StoredProcedure
NorisHelpers.DBHelpers.AddParam(cmd, "@logon", username)
NorisHelpers.DBHelpers.AddParam(cmd, "@password", password)
conn.Open()
'Get string for return values
Dim ReturnValue As String = cmd.ExecuteScalar.ToString
'Split string into array
Dim Values() As String = ReturnValue.Split(";~".ToCharArray)
'If the return code is CONTINUE, all is well. Otherwise, collect the
'reason why the result failed and let the user know
If Values(0) = "CONTINUE" Then
Return True
Else
results.Result = Values(0)
'Make sure there is a message being returned
If Values.Length > 1 Then
results.Message = Values(2)
End If
Return False
End If
Catch ex As Exception
Throw ex
Finally
If (Not conn Is Nothing AndAlso conn.State = ConnectionState.Open) Then
conn.Close()
End If
End Try
End Function
''' -----------------------------------------------------------------------------
''' <summary>
''' Getting the Connection from the config file
''' </summary>
''' <returns>A connection object</returns>
''' <remarks>
''' This is the same for all of the data classes.
''' Reads a specific
connection string from the web.config file for the service, creates a
connection object and returns it as an IDbConnection.
''' </remarks>
''' -----------------------------------------------------------------------------
Private Function GetConnection() As IDbConnection
'Dim conn As IDbConnection = New System.Data.OleDb.OleDbConnection
Dim conn As IDbConnection = New System.Data.SqlClient.SqlConnection
conn.ConnectionString = NorisHelpers.DBHelpers.GetConnectionString(NorisHelpers.DBHelpers.COMMON)
Return conn
End Function
in the above GetConnection() method i
have commented out the .net dataprovider for oledb and changed it to
.net dataprovider for SQLconnection. this function works fine. But in
the authenticate method above at the line
Dim ReturnValue As String = cmd.ExecuteScalar.ToString

for some reason its throwing the below error.
Run-time exception thrown : System.Data.SqlClient.SqlException - @password is not a parameter for procedure EDSConfirmUpdate.
If i comment out the
Dim conn As IDbConnection = New System.Data.SqlClient.SqlConnection
and uncomment the .net oledb provider,
Dim conn As IDbConnection = New System.Data.OleDb.OleDbConnection
then it works fine.
I also have changed the webconfig file as  below.
<!--<add
key="Common" value='User ID=**secret**;pwd=**secret**;Data
Source="ESMALLDB2K";Initial Catalog=cj_common;Auto
Translate=True;Persist Security Info=False;Provider="SQLOLEDB.1";'
/>-->
<add key="Common" value='User ID=**secret**;pwd=**secret**;Data Source="ESMALLDB2K";Initial Catalog=cj_common;' />
 
Please help. Thanks in advance.
 

View 4 Replies View Related

Send Mail Task Problem Using A Combination Of ForEach Loop, Recordset Destination, Execute SQL Task And Script Task

Jun 21, 2007

OK. I give up and need help. Hopefully it's something minor ...



I have a dataflow which returns email addresses to a recordset.

I pass this recordset into a ForEachLoop configuring the enumerator as (Foreach ADO Enumerator). I also map the email address as a variable with index 0.



I then have a Execute SQL task which receives this email address as a varchar variable (parameter 0) which I then use in my SQL command to limit the rows returned. I have commented out the where clause and returned all rows regardless of email address to try to troubleshoot this problem. In either event, I then use a resultset to store the query result of type object and result name 0.



I then pass this resultset into a script variable to start parsing the sql rows returned as type object. ( I assume this is the correct way to do this from other prior posts ...).



The script appears to throw an exception at the following line. I assume it's because I'm either not passing in the values properly or the query doesn't return anything. However, I am certain the query works as it executes just fine at the command prompt.



Try

ds = CType(Dts.Variables("VP_EMAIL_RESULTS_RS").Value, DataSet)



My intent is to email the query results to each email address with the following type of data by passing the parsed data from the script to a send mail task. Email works fine and sends out messages but the content is empty. I pass the parsed data as string values to the messagesource and define the messagesourcetype as a variable in the mail task.



part number leadtime

x 5

y 9

....



Does anyone have any idea what I might be doing wrong?

thanks

John

View 5 Replies View Related

Passwords

Feb 5, 1999

Is there a way I can enable my end users to change
their own passwords within SQL 6.5 every 30 days to
something unique?

Currently, I don't see that they have the option to change
it anywhere.
Any thoughts?
Thanks!
Toni

View 1 Replies View Related

Passwords In SQL 6.5

Mar 24, 1999

I have to create some type of an sp that will force users to change
their passwords every 30 days. It sounds like I should be able to
create a simple table with the login and the password expiration date.
Then, I should create some type of function to check the expiration, get
the new password and run sp_password. Has anyone done this before?
Where would this table be created? In Master? Would that also be where
I should create this sp? Should this be an xp?

I'm fairly light on creating sp's. Can anyone suggest a starting point
for me or give any suggestions?
I would appreciate any help.
Thanks!
Toni E.

View 3 Replies View Related

Sql/nt Passwords

May 28, 1999

Does some one know of a way to use windows passwords in sql w/o having to enter them in? Like a program or sql statement?
As of now, we are having to enter them in ourselves , and would like to make our jobs easier....Thanks!!

View 2 Replies View Related

Need Help With Passwords

Feb 6, 2005

hey guyz
in the database, is there anyway to chnage the password field to * instead of showing what is inside?

View 5 Replies View Related

Passwords

Sep 30, 2007

Hi

I have SQL Server 2000 and in one of the databases we store the Application passwords as a Clear text. we would like to encrypt
these passwords so that we will pass the auditing.

Can some one please suggest a good way to encrypt these passwords.

Thanks

View 12 Replies View Related

[HELP]passwords

Jan 7, 2007

for example i will set the password as chicken

http://img515.imageshack.us/my.php?image=chickenqs6.gif

then i press ok and it seems like it works i open it right away and

http://img295.imageshack.us/my.php?image=notchickenao0.gif

^^clearly not chicken......

then,ontop of that when i open the login name is a query script its some 15 character password that everytime u open in script the code changes..

http://img401.imageshack.us/my.php?image=screenhunter04jan062317zu0.gif

any help would be greatly appreciated

View 3 Replies View Related

PGP Files And Passwords

May 2, 2001

I have a pgp file requiring a password that is emailed to me. Is it possible to set up a DTS package that will open the file (using the password), and insert the data into a table, file, etc.
TB

View 1 Replies View Related

User Passwords

Oct 8, 2001

Hello,

Is there a way to pull user id's and passwords from a database?

TIA,
Anita

View 3 Replies View Related

Changing Passwords

Dec 5, 2000

I have a problem where our developers would like to change the passwords of the SQL Logins without knowing the users old password.

The only way they can use the below syntax is that they must be a member of the SYSAdmin Server Role.

sp_password NULL, 'newpassword',Max

I need a way to allow them to change the passwords without making a user a member of the SYSAdmin Server Role.

Any thoughts would be greatly apprecitated. Thanks in advance.

Max

View 1 Replies View Related

Sqlserver Passwords

Dec 1, 2004

Hello all,

Is there anyway to tell in sqlserver when a users' password has been changed?

View 3 Replies View Related

User Passwords

Apr 27, 2004

Is there a way that I can prevent SQL Authenticated users from changing their passwords?

View 6 Replies View Related

Passwords For The Logins

Jun 1, 2004

Hi All,
Sql server 7

There are set of logins in sql server some are NT authentication and some are sql server authentication. How can i retrieve the passwords for both these logins.


TIA
Adil

View 1 Replies View Related

Users And Passwords

Apr 11, 2008

How can we change the passwords of users in 2005 and in 2000

View 2 Replies View Related

Passwords And Usernames

Mar 15, 2006

i have been reading many asp.net books

where is a good place to hold user name and password while the user is on your side in a cookie or applicaion user variable?

and if the user closes the navigator..what command removes the log in information ?

View 1 Replies View Related

Encrypting Passwords

Feb 22, 2006

A friend of my self asked me how he can save a password not as clear text. He wanted to encrypt the password and save the encrypted string in the database.

How can he do this? Maybe somebody can help me here.

Regards Markus

View 7 Replies View Related







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