Tuesday, March 27, 2012

Change in connection string

I have a SSIS Package which I developed on my own my database server.

But now the package is to deployed on 3-4 different computers pointing it to different databases.

I do not want to change the connection string for each and every instance because in future there may be more number of instances running.

I tried using the Configuration file and add that file in to the configuration window but that also did not work.

Please can anybody help me?
We're going to need more information here... You said you tried using a configuration file, "but that also did not work."

How did you set it up? What exactly happened that "did not work"? If running locally for testing, you'll have to get out of the package and reopen it for it to pick up the new configuration if that makes a difference.|||

Phil Brammer wrote:

We're going to need more information here... You said you tried using a configuration file, "but that also did not work."

How did you set it up? What exactly happened that "did not work"? If running locally for testing, you'll have to get out of the package and reopen it for it to pick up the new configuration if that makes a difference.

[Apologies for jumping in on this thread. If I get a reply then I'll delete it later.]

Phil,

Please could you email me - (jamieDOTthomsonATconchangoDOTcom). Just got something I want to ask you offline.

thanks

Jamie

|||I have file named dbConfig.dtsConfig. It had the following code in it

<DTSConfiguration>
<Configuration ConfiguredType="Property" Path="\Package.Connections[SERVERNAMEdbname].Properties[ConnectionString]" ValueType="String">
<ConfiguredValue>Data Source=Av-int-sj-db01\instance_b;Initial Catalog=AvaTaxAccount;User ID=avaservice;password=kennwort.2005;Provider=SQLNCLI.1;Persist Security Info=True;Auto Translate=False</ConfiguredValue>
</Configuration>
</DTSConfiguration>

While I double click the package exe the Execute Package Utility pop ups and in that I select the configuration option and add the above file in it.

Then try executing the package. Its gives an error message of the login not found.

Is this the right way to change the connection string while executing the package.

Change Image using parameter

I need to change the logo on my reports according to a parameter that I pass from VB.NET.

What is the best way to load the image into the report?

I have attempted to use a dataset:

I created a logo field in my dataset
I loaded the correct image in VB.NET
I then assigned the 'logo' field in the dataset to this image

My problem is that I don't know what the data type of the logo field should be - I have created the dataset manually and the images are not in a database.

This is my code:

'Load image into ByteArray
Dim fs As New System.IO.FileStream("C:\temp\test.jpg", IO.FileMode.Open)
Dim nBytes As Integer = fs.Length
Dim ByteArray(nBytes) As Byte
Dim nBytesRead As Integer = fs.Read(ByteArray, 0, nBytes)
fs.Read(ByteArray, 0, Convert.ToInt32(fs.Length.ToString(), 10) - 1)

'Set logo field to this image
Dim tbl As New mySchemas.myDataTable
Dim rw As DataRow = tbl.NewRow
rw("logo") = ByteArray 'AN ERROR OCCURS ON THIS LINE
tbl.Rows.Add(rw)
Dim ds As New DataSet
ds.Tables.Add(tbl)

Is this the best way to do load an image into crystal? If so what should the datatype of the logo field be in the dataset? I tried Byte but that did not work.

Thanks for any help
ElaineElaine,
I'll preface this by saying: I don't use CR10, and don't use .NET with CR.
From your code you are declaring a row object to hold the picture.
Shouldn't you be using a "field" object, or whatever the .NET equivalent is?
Field type should be OLE Object/BLOB(BinaryLargeOBject)/BitStream or similar.

Dave|||Thanks for your reply Dave. All sorted now.

The data type I needed turned out to be 'hexbinary'
Incase anyone has the same problem this is the solution:

Dim data As New DataSet()
Dim row As DataRow

data.Tables.Add("Images")
data.Tables(0).Columns.Add("img", System.Type.GetType("System.Byte[]"))

Dim fs As New FileStream("C:\test.jpg", FileMode.Open)
Dim br As New BinaryReader(fs)

row = data.Tables(0).NewRow()
row(0) = br.ReadBytes(br.BaseStream.Length)
data.Tables(0).Rows.Add(row)

br.close
fs.close

br = Nothing
fs = Nothing

' CrystalReport1 is a strongly typed report created in Visual Studio.
Dim cr As New CrystalReport1()
cr.SetDataSource(data)
CrystalReportViewer1.ReportSource = cr|||Are you using the version of crystal reports that came with visual net??
I create the typed dataset with a field hexBinary and load the pictur there but how can I put that picture in the report it shows as a number and no image apearssql

Change image properties at runtime

Hi,
I'm using Reporting Services for SQL2K. My report will need to dynamically
call a custom assembly for each row in a dataset, and then show the image
file that the custom assembly creates. I was thinking of using an Image
control in the report and then changing the path to the image file at
runtime. But I can not figure out how to access the image1.Value property.
Any tips on this or perhaps an alternative solution?
TIA
JonasI found the answer, and it was very easy ;-)
When the control is selected in the Report Designer, it it possible to edit
the properties as usual. The property for Value can also use an Expression,
and voila, this can point to a variable which contains a dynamically created
path.
Brgds
Jonas
"Jonas" <Jonas@.nospam.pl> wrote in message
news:%23z53z3cHGHA.240@.TK2MSFTNGP11.phx.gbl...
> Hi,
> I'm using Reporting Services for SQL2K. My report will need to dynamically
> call a custom assembly for each row in a dataset, and then show the image
> file that the custom assembly creates. I was thinking of using an Image
> control in the report and then changing the path to the image file at
> runtime. But I can not figure out how to access the image1.Value property.
> Any tips on this or perhaps an alternative solution?
> TIA
> Jonas
>
>

Change Image

I'm using Crystal Report 7 ,use storc prcdure n vb 6. my prblem : let say in my system have company and their staff. how can i display one company and their staffname+ their picture. e.g: company A and their staff photo will appear n for cmpny B their staff photo will appear. means that the staff photo will appear based on their company.tnkiu..I'm using Crystal Report 7 ,use storc prcdure n vb 6. my prblem : let say in my system have company and their staff. how can i display one company and their staffname+ their picture. e.g: company A and their staff photo will appear n for cmpny B their staff photo will appear. means that the staff photo will appear based on their company.tnkiu..

simple sort the data by company name|||I'm using Crystal Report 7 ,use storc prcdure n vb 6. my prblem : let say in my system have company and their staff. how can i display one company and their staffname+ their picture. e.g: company A and their staff photo will appear n for cmpny B their staff photo will appear. means that the staff photo will appear based on their company.tnkiu..

Just sort the data by company name|||what do you mean by sort data by company name?

Change Identity value

I changed a column on an existing table to be a Identity column but when I
try to insert a record I get an error that the id already exists. Is there a
way for me to change the value so identity returns a higher #?Are you passing the identity value?
AMB
"Joe" wrote:

> I changed a column on an existing table to be a Identity column but when I
> try to insert a record I get an error that the id already exists. Is there
a
> way for me to change the value so identity returns a higher #?
>
>|||You could use identity_insert to insert a row with the highest value
and then turn it off. Any inserts after that will increment sequentially.
ie.
create table test ( id int identity (1,1), col varchar(10) )
insert into test (col) values ('row1')
insert into test (col) values ('row2')
insert into test (col) values ('row3')
set identity_insert test on
insert into test (id, col) values (10,'row4')
set identity_insert test off
insert into test (col) values ('row5')
select * from test
"Joe" <J_no_spam@._no_spam_Fishinbrain.com> wrote in message
news:O5mJERHEFHA.2700@.TK2MSFTNGP14.phx.gbl...
> I changed a column on an existing table to be a Identity column but when I
> try to insert a record I get an error that the id already exists. Is there
a
> way for me to change the value so identity returns a higher #?
>|||Joe,
Look at the DBCC CHECKIDENT command in the Books Online. If your table
containing the identity column was called jobs,
DBCC CHECKIDENT (jobs, RESEED, 30)
would force the new value to 30.
On Fri, 11 Feb 2005 14:59:57 -0500, "Joe"
<J_no_spam@._no_spam_Fishinbrain.com> wrote:

>I changed a column on an existing table to be a Identity column but when I
>try to insert a record I get an error that the id already exists. Is there
a
>way for me to change the value so identity returns a higher #?
>

Change Identify/Primary Key Column Data Type?

Hi ...

I've

taken over a project where the tables were created with

identity/primary key columns of type DECIMAL(12,0). The latest addition

to the project is to replicate data down to Pocket PC applications.

Replication requires that identify/primary key columns be of type

INT/BIGINT.

I've attempted to ALTER TABLE xxx ALTER COLUMN yyy

BIGINT; and it fails. Failed due to all the foreign key constraints that have been created. While it didn't give any error messages associated with the the field being the PRIMARY KEY - I'm assuming I may get that error as well.

I then did an ALTER TABLE xxx NOCHECK CONSTRAINT

ALL; for every table in the system to disable checking of foreign keys

and then attempted to alter the column to a bigint and it still failed.

How

can I change the column from Decimal to BIGINT - or do I have to create

new tables, import all the data, get rid of the original tables? Please

tell me I don't have to do the latter.

Thanks ...Unfortunately the only way is to recreate the table or drop & recreate the column. This would require removing the existing constraints (PKs, FKs) and recreating them. Alternatively, you can create a view on the table(s) that does the conversion and replicate those. But this may or may not work depending on your replication scheme and you will have to ask in the Replication newsgroup.

Change how command runs

This should be an easy one. I want to change the command to use the
DBID number instead of the database name to run the process. The
current loop does not keep the order if you add or remove databases
beecuse i am using the min() function.
DECLARE @.sql varchar(4000)
DECLARE @.db varchar(64)
SET @.db=''
SELECT @.db=min(name)
FROM master.dbo.sysdatabases
WHERE dbid > 4 and name > @.db
WHILE @.db is not null
BEGIN
SET @.sql='use ' +@.db + ' exec dbo.sp_UD_RebuildIndexes 30, 100'
EXEC (@.sql)
SELECT @.db=min(name)
FROM master.dbo.sysdatabases
WHERE dbid > 4 and name > @.db
END
Thanks
-Matt-not sure what are you exactly looking for.
but if you want to loop through the databases on the basis of DBID rather
than database name , then you can try following procedural code.
DECLARE @.sql varchar(4000)
DECLARE @.db int
SELECT @.db=min(dbid)
FROM master.dbo.sysdatabases
WHERE dbid > 4
WHILE @.db is not null
BEGIN
select @.sql='use ' + name + ' exec dbo.sp_UD_RebuildIndexes 30, 100'
from master..sysdatabases where dbid =@.db
EXEC (@.sql)
SELECT @.db=min(dbid)
FROM master.dbo.sysdatabases
WHERE dbid > @.db
END
"MKruer@.gmail.com" wrote:

> This should be an easy one. I want to change the command to use the
> DBID number instead of the database name to run the process. The
> current loop does not keep the order if you add or remove databases
> beecuse i am using the min() function.
> DECLARE @.sql varchar(4000)
> DECLARE @.db varchar(64)
> SET @.db=''
> SELECT @.db=min(name)
> FROM master.dbo.sysdatabases
> WHERE dbid > 4 and name > @.db
> WHILE @.db is not null
> BEGIN
> SET @.sql='use ' +@.db + ' exec dbo.sp_UD_RebuildIndexes 30, 100'
> EXEC (@.sql)
> SELECT @.db=min(name)
> FROM master.dbo.sysdatabases
> WHERE dbid > 4 and name > @.db
> END
> Thanks
> -Matt-
>|||That was it. The Query is to run a stored procedure that auto reindex
the entire Database. The only problem with the stored procedure is that
it only works on the database that it was executed on. This is more or
a temporary work around. Ideally I want to be able to specify
individual indexes directly using a table.
Creating a Stored Procedure to collect DB information and then run
another Stored Procedure using that information
http://groups.google.com/group/micr...bdb43d49fed239e
Query for Database, Table, Index name all on one list.
http://groups.google.com/group/micr...17098a35404820c|||That was it. The Query is to run a stored procedure that auto reindex
the entire Database. The only problem with the stored procedure is that
it only works on the database that it was executed on. This is more or
a temporary work around. Ideally I want to be able to specify
individual indexes directly using a table.
Creating a Stored Procedure to collect DB information and then run
another Stored Procedure using that information
http://groups.google.com/group/micr...bdb43d49fed239e
Query for Database, Table, Index name all on one list.
http://groups.google.com/group/micr...17098a35404820csql