October 21, 2019 at 2:50 pm
Hi,
Can you please give me Idea, how can i use stored procedure in SSIS with different database name in Dev, Test and Prod ?
In stored procedure, I am going to use source server as Phm_Dev ( Reading the data ) and load into Med_Dev (destination server)
So when I move my SSIS In test,, Database name will be Phm_Test and Load into MED_TEST.. same like production..
How can i make stored procedure dynamic ?
Thanks
B
October 21, 2019 at 3:26 pm
Yes,, Using SSIS - 2012.
How can i use stored procedure in Data flow task ?
Am i need to write dynamic SQL ? Is there any other option ?
Thanks
B
T
October 21, 2019 at 3:43 pm
Hi,
Can you please give me Idea, how can i use stored procedure in SSIS with different database name in Dev, Test and Prod ?
In stored procedure, I am going to use source server as Phm_Dev ( Reading the data ) and load into Med_Dev (destination server)
So when I move my SSIS In test,, Database name will be Phm_Test and Load into MED_TEST.. same like production..
How can i make stored procedure dynamic ?
Thanks
B
Are your Dev, Test and Prod databases all on the same SQL Server instance? If so, ... <Phil swallows his tongue>
If not, why do they have different names? Keep the same DB names, it makes everything simpler.
The absence of evidence is not evidence of absence
- Martin Rees
The absence of consumable DDL, sample data and desired results is, however, evidence of the absence of my response
- Phil Parkin
October 21, 2019 at 3:47 pm
How can i use stored procedure in Data flow task ?
I assume you mean as a source, like you would any other time you want to use SQL; with a SQL Statement: EXEC Schema.Procedure {Parameters}
.
Phil raises a good point about the same instance; I've assumed you at least have different instances. if you don't, you can still do this, but there's more work, and we therefore need to know if we need to include that information.
Thom~
Excuse my typos and sometimes awful grammar. My fingers work faster than my brain does.
Larnu.uk
October 21, 2019 at 4:49 pm
All Databases is on same Instant but instance are different as well.. This is requirement as per DBA.
So We have different instance for Dev, Test and prod & database name is different too..
Only Advantage is that, both database on same server for each Dev, test and Prod.
October 21, 2019 at 7:20 pm
one of the core caveats of the development life cycle is that the code is tested in dev, and is promoted UNCHANGED to the next layer for acceptance and testing.
if you have to modify procedures based on where they get deployed, your system is not following the rules.
the procedure should not care about database names. if it is making a cross database query, it should be from database [Phm].[dbo].[TargetTable] to [Med].dbo.[TargetTable]
So f you should have Three SQL instances, for DEV/QA and Prod., i would expect two identically named databases on
MyServer\SQL2012DEV
MyServer\SQL2012QA
MyServer\SQL2012Prod
of you have ONE SQL isntance, with six databases, you will need to create synonyms for the objects instead.
CREATE SYNONYM dbo.synTargetTable FOR [Phm].[dbo].TargetTable
then the procedure should target the synonym [synTargetTable] so the code never changes, but the underlying pointer/Synonym can be changes per environment.
Lowell
October 22, 2019 at 8:06 am
All Databases is on same Instant but instance are different as well.. This is requirement as per DBA.
Huh? A instance can't be the same instance and different instances. That's like saying "All Employees drive the Company's only company car, and drive their company car." How can they all drive their own, when the company only has one?
Which is it, many cars, or one car?
Thom~
Excuse my typos and sometimes awful grammar. My fingers work faster than my brain does.
Larnu.uk
October 22, 2019 at 11:00 am
Solution for Stored Procedures/View/Trigger/Function :
You can leverage the Synonyms. Instead of hard-coding the database name you can create the synonyms in each database and refer the synonyms instead of referring the actual table/stored procedure.
Read the below article to know more about Synonyms.
Solution for SSIS package :
October 31, 2019 at 11:49 am
Use project connection managers for your db connections in the SSIS package.
Deploy the SSIS from your development tool (e.g. Visual Studio) to Integration Services Catalog SSISDB in your dev environment.
Once dev is complete, deploy your SQL objects (tables, views, SP's etc) to your test environment - you have scripts for this, correct?
Then deploy the SSIS from the Dev SSISDB to Test SSISDB, and use Configure to change the connection managers in the project to the Test server/db.
When testing is complete, repeat to promote from Test to Prod.
One downside is that if you find the package needs to be changed while testing, you have to repeat the deployment process (tool to dev environment to test environment) so you know everything is still in sync.
November 1, 2019 at 4:48 pm
Thank you.
Viewing 11 posts - 1 through 10 (of 10 total)
You must be logged in to reply to this topic. Login to reply