Showing posts with label scripts. Show all posts
Showing posts with label scripts. Show all posts

Monday, March 19, 2012

How do i get the database that i am using in visual studio into my SQL server management s

How do i get the database that i am using in visual studio into my SQL server management studio?

i need to create some scripts to create stored procedures on a live server.

Take your .mdf file for the database that you are using in Visual Studio.NET and attach it to a database in MS SQL Server.

Good luck.

How do I get Management Studio to not reset the selected database to Master when I open a new qu

Hi there,

I often have to run multiple SQL scripts against a single database. SQL Server Management Studio always reverts the selected database to Master whenever I open a different SQL file. This requires me to re-select the correct database, and if I forget, I end up running the script against the Master database. SQL 2000's query analyzer "remembered" your selected database and did not force you to re-connect each time.

Is there any way to make SQL Server Management Studio act this way?

Thanks!

Kiron

Kiron,

You could set the default database for the sql login. so that the default DB will be selected automatically.

To set default databasefor a sql login, In Object Explorer, expand Security -> Logins

right click on login , properties, set the default database

After setting default DB for the SQL login, if you open up new query with the above mentioned login, you would see the default database selected

If you feel that the above solution does not meet your requirements, Please log a feature request in connect web site

https://connect.microsoft.com/SQLServer/Feedback

Thanks
Sethu Srinivasan, Software Design Engineer, SQL Server Manageability
--
This posting is provided "AS IS" with no warranties, and confers no rights.
Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm.

|||

Hi Sethu -

thanks for the response. Unfortunately, this will reset the default database, as opposed to having the new query session just "remember" the database that was selected for other open query sessions. Ideally, I would want the same behavior as in Query Analyzer from 2000 - you connect once to the database and from then on, all query windows are assumed to be related to the same database.

As part of my work, I often have to open multiple SQL scripts and execute them against the same database - the database is never the same, hence, the default database approach will merely shift the issue from "master" to some other database. What I would need is an option to tell Management Studio to pick the database that is used by all open query windows as the default when a new query window is opened vs. picking the user's default database.

I'll log a feature request as suggested!

Thanks again!

Kiron

How do I get Management Studio to not reset the selected database to Master when I open a ne

Hi there,

I often have to run multiple SQL scripts against a single database. SQL Server Management Studio always reverts the selected database to Master whenever I open a different SQL file. This requires me to re-select the correct database, and if I forget, I end up running the script against the Master database. SQL 2000's query analyzer "remembered" your selected database and did not force you to re-connect each time.

Is there any way to make SQL Server Management Studio act this way?

Thanks!

Kiron

Kiron,

You could set the default database for the sql login. so that the default DB will be selected automatically.

To set default databasefor a sql login, In Object Explorer, expand Security -> Logins

right click on login , properties, set the default database

After setting default DB for the SQL login, if you open up new query with the above mentioned login, you would see the default database selected

If you feel that the above solution does not meet your requirements, Please log a feature request in connect web site

https://connect.microsoft.com/SQLServer/Feedback

Thanks
Sethu Srinivasan, Software Design Engineer, SQL Server Manageability
--
This posting is provided "AS IS" with no warranties, and confers no rights.
Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm.

|||

Hi Sethu -

thanks for the response. Unfortunately, this will reset the default database, as opposed to having the new query session just "remember" the database that was selected for other open query sessions. Ideally, I would want the same behavior as in Query Analyzer from 2000 - you connect once to the database and from then on, all query windows are assumed to be related to the same database.

As part of my work, I often have to open multiple SQL scripts and execute them against the same database - the database is never the same, hence, the default database approach will merely shift the issue from "master" to some other database. What I would need is an option to tell Management Studio to pick the database that is used by all open query windows as the default when a new query window is opened vs. picking the user's default database.

I'll log a feature request as suggested!

Thanks again!

Kiron

Friday, February 24, 2012

How do I do restore only SOME DTS scripts from msdb database?

I understand that I can backup my DTS scripts by backing up the msdb
database, but how do I restore only CERTAIN DTS scripts from the database?
If I restore 'msdb' I might be overwriting DTS scripts, etc. that are
related to other databases that I might NOT want to restore.
TIA,
Larry WoodsIf you want to move DTS from one server to another try with this.
Save DTS as Structured Storage File. Then copy it to the
destination server and in EM right click Data Transformation Services and
Open. Choose your file. Click Package then Save AS and chose server in which
you want to save DTS.
I hope this help
Ana
"Larry Woods" wrote:
> I understand that I can backup my DTS scripts by backing up the msdb
> database, but how do I restore only CERTAIN DTS scripts from the database?
> If I restore 'msdb' I might be overwriting DTS scripts, etc. that are
> related to other databases that I might NOT want to restore.
> TIA,
> Larry Woods
>
>|||I would perhaps do another install of sql server, restore ALL of the
Packages. Then save each of the packages you need as a flat file, then open
them on the correct server and save as SQl..
Good luck...
--
Wayne Snyder, MCDBA, SQL Server MVP
Mariner, Charlotte, NC
www.mariner-usa.com
(Please respond only to the newsgroups.)
I support the Professional Association of SQL Server (PASS) and it's
community of SQL Server professionals.
www.sqlpass.org
"Larry Woods" <larry@.NOSPAMlwoods.com> wrote in message
news:%23ewfQc7KFHA.244@.TK2MSFTNGP12.phx.gbl...
>I understand that I can backup my DTS scripts by backing up the msdb
> database, but how do I restore only CERTAIN DTS scripts from the database?
> If I restore 'msdb' I might be overwriting DTS scripts, etc. that are
> related to other databases that I might NOT want to restore.
> TIA,
> Larry Woods
>

How do I do restore only SOME DTS scripts from msdb database?

I understand that I can backup my DTS scripts by backing up the msdb
database, but how do I restore only CERTAIN DTS scripts from the database?
If I restore 'msdb' I might be overwriting DTS scripts, etc. that are
related to other databases that I might NOT want to restore.
TIA,
Larry WoodsIf you want to move DTS from one server to another try with this.
Save DTS as Structured Storage File. Then copy it to the
destination server and in EM right click Data Transformation Services and
Open. Choose your file. Click Package then Save AS and chose server in which
you want to save DTS.
I hope this help
Ana
"Larry Woods" wrote:

> I understand that I can backup my DTS scripts by backing up the msdb
> database, but how do I restore only CERTAIN DTS scripts from the database?
> If I restore 'msdb' I might be overwriting DTS scripts, etc. that are
> related to other databases that I might NOT want to restore.
> TIA,
> Larry Woods
>
>|||I would perhaps do another install of sql server, restore ALL of the
Packages. Then save each of the packages you need as a flat file, then open
them on the correct server and save as SQl..
Good luck...
Wayne Snyder, MCDBA, SQL Server MVP
Mariner, Charlotte, NC
www.mariner-usa.com
(Please respond only to the newsgroups.)
I support the Professional Association of SQL Server (PASS) and it's
community of SQL Server professionals.
www.sqlpass.org
"Larry Woods" <larry@.NOSPAMlwoods.com> wrote in message
news:%23ewfQc7KFHA.244@.TK2MSFTNGP12.phx.gbl...
>I understand that I can backup my DTS scripts by backing up the msdb
> database, but how do I restore only CERTAIN DTS scripts from the database?
> If I restore 'msdb' I might be overwriting DTS scripts, etc. that are
> related to other databases that I might NOT want to restore.
> TIA,
> Larry Woods
>

How do I do restore only SOME DTS scripts from msdb database?

I understand that I can backup my DTS scripts by backing up the msdb
database, but how do I restore only CERTAIN DTS scripts from the database?
If I restore 'msdb' I might be overwriting DTS scripts, etc. that are
related to other databases that I might NOT want to restore.
TIA,
Larry Woods
If you want to move DTS from one server to another try with this.
Save DTS as Structured Storage File. Then copy it to the
destination server and in EM right click Data Transformation Services and
Open. Choose your file. Click Package then Save AS and chose server in which
you want to save DTS.
I hope this help
Ana
"Larry Woods" wrote:

> I understand that I can backup my DTS scripts by backing up the msdb
> database, but how do I restore only CERTAIN DTS scripts from the database?
> If I restore 'msdb' I might be overwriting DTS scripts, etc. that are
> related to other databases that I might NOT want to restore.
> TIA,
> Larry Woods
>
>
|||I would perhaps do another install of sql server, restore ALL of the
Packages. Then save each of the packages you need as a flat file, then open
them on the correct server and save as SQl..
Good luck...
Wayne Snyder, MCDBA, SQL Server MVP
Mariner, Charlotte, NC
www.mariner-usa.com
(Please respond only to the newsgroups.)
I support the Professional Association of SQL Server (PASS) and it's
community of SQL Server professionals.
www.sqlpass.org
"Larry Woods" <larry@.NOSPAMlwoods.com> wrote in message
news:%23ewfQc7KFHA.244@.TK2MSFTNGP12.phx.gbl...
>I understand that I can backup my DTS scripts by backing up the msdb
> database, but how do I restore only CERTAIN DTS scripts from the database?
> If I restore 'msdb' I might be overwriting DTS scripts, etc. that are
> related to other databases that I might NOT want to restore.
> TIA,
> Larry Woods
>