June 12, 2012 at 11:52 pm
Is there a way to open a .sql file in SSMS always towards a particular sql server instance.
because, when i open a new .sql file, by default it assumes a connection which i was working with a previous .sql file.
this some times prone to mistakes in fetching wrong data (like SELECTed from DEV instead PROD).
Appreciating your help always.
June 13, 2012 at 2:49 am
SQL Tab Magic from Red Gate remembers the connection and database name...:-D
gsc_dba
June 13, 2012 at 3:04 am
Not quite what you're after, but right click over the toolbar in SSMS and select Customize. On the Commands tab select File. There is an option Open File with New Connection which you can drag on to the toolbar.
June 13, 2012 at 10:10 am
SQL Mad Rafi (6/12/2012)
Is there a way to open a .sql file in SSMS always towards a particular sql server instance.because, when i open a new .sql file, by default it assumes a connection which i was working with a previous .sql file.
this some times prone to mistakes in fetching wrong data (like SELECTed from DEV instead PROD).
Appreciating your help always.
If you go to File/New/Project and add a SQL Server Scripts project, scripts held in this will be associated with a connection. Is this more or less what you're looking for?
June 13, 2012 at 11:32 am
David Atkinson (6/13/2012)
SQL Mad Rafi (6/12/2012)
Is there a way to open a .sql file in SSMS always towards a particular sql server instance.because, when i open a new .sql file, by default it assumes a connection which i was working with a previous .sql file.
this some times prone to mistakes in fetching wrong data (like SELECTed from DEV instead PROD).
Appreciating your help always.
If you go to File/New/Project and add a SQL Server Scripts project, scripts held in this will be associated with a connection. Is this more or less what you're looking for?
Yes. Great.
Thanks a lot David.
This is what i looked for, that the .sql file that i added under 'Queries' folder remembers the connection which i set with it once. when i am opening the project again, each script file opens with its own connection which i set.
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply