Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 Other SQL Server Topics (2005)
 I hate new management studio for 1 reason...

Author  Topic 

dev2dev
Starting Member

48 Posts

Posted - 2007-12-27 : 03:20:14
...and it is because...
when i drag and drop my script file into query window unlike query analyzer which selects the current database, new MSSMS selects the users 'default' database.

we maintain 1 script file for each sp/function and ddl/views groupe related stuff in 1 or more files

in query analyzer I just have to select DB where i want to deploy scripts and drag and drop the files from explorer and then then
1) press F5 (to run)
2) press CTL + F4 (to close window)
3) repeat till all scripts are deployed

and now in MSSMS

1) select db (this step is really painful especially when i have to deploy more than 1 script/file)
2) press F5
3) press CTL + F4
4) repeat

is there any settings that could change the behavior of SMS2K5 like old QA2K?

well what i cant do here is change default db to the tartget db before deploying and switch back after deploying (but not a true solution)

thanks in advance

elancaster
A very urgent SQL Yakette

1208 Posts

Posted - 2007-12-27 : 04:24:24
how about saving your scripts as a project so you only set the db connection once?

Em
Go to Top of Page

dev2dev
Starting Member

48 Posts

Posted - 2007-12-27 : 07:13:21
hmmmm, not sure what to do after creating a project

my existing scripts are in hierarchy folder structure
when i added them to project all of them are showing in one single branch

now I don't know how to run all of them in a specific sequence one after one
Go to Top of Page

spirit1
Cybernetic Yak Master

11752 Posts

Posted - 2007-12-27 : 09:47:44
every script should have a Use DbName on top of it anyway.

_______________________________________________
Causing trouble since 1980
blog: http://weblogs.sqlteam.com/mladenp
SSMS Add-in that does a few things: www.ssmstoolspack.com <- new version out
Go to Top of Page

nr
SQLTeam MVY

12543 Posts

Posted - 2007-12-27 : 10:40:45
Concatenate the scripts into a single script?

==========================================
Cursors are useful if you don't know sql.
DTS can be used in a similar way.
Beer is not cold and it isn't fizzy.
Go to Top of Page

blindman
Master Smack Fu Yak Hacker

2365 Posts

Posted - 2007-12-27 : 13:32:18
quote:
Originally posted by dev2dev
I hate new management studio for 1 reason...

You simply have not used it long enough. Soon, you will uncover many more reasons to hate it.

e4 d5 xd5 Nf6
Go to Top of Page

eyechart
Master Smack Fu Yak Hacker

3575 Posts

Posted - 2007-12-27 : 14:56:26
i hate SSMS because I can no longer multi-select objects and script them out.



-ec
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2007-12-27 : 15:04:58
quote:
Originally posted by spirit1

every script should have a Use DbName on top of it anyway.



I disagree. If you have deployment scripts like we do, then USE dbName at the top of each script would cause unwanted effects. We pass the name of the database to osql/sqlcmd as the database can change between environments. Anything that can change should not be included in the scripts.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/
Go to Top of Page

nr
SQLTeam MVY

12543 Posts

Posted - 2007-12-27 : 15:18:43
quote:
Originally posted by eyechart

i hate SSMS because I can no longer multi-select objects and script them out.
-ec



This will do the same thing as enterprise manager
Just put it in a .vbs file and run it then pick the objects you want.
This is for tables but easy to change.

To concatenate to a single script from dos (or a .bat file)
type *.TAB > mydb.sql


dim svr
dim db
Dim tbl
set svr = createobject("SQLDMO.SQLServer")
svr.loginsecure = true
svr.Connect "myserver\myinstance"
Set db = svr.Databases("mydatabase")
For Each tbl In db.Tables
if tbl.SystemObject = 0 then
tbl.script 69, "Tables\" & tbl.Name & ".TAB"
end if
Next
svr.disconnect
set svr = nothing

the script format may change betweem v2000 and 2005.

==========================================
Cursors are useful if you don't know sql.
DTS can be used in a similar way.
Beer is not cold and it isn't fizzy.
Go to Top of Page

dev2dev
Starting Member

48 Posts

Posted - 2007-12-28 : 00:33:23
quote:

every script should have a Use DbName on top of it anyway.



This works only for three dbs out of 5 dbs we have
two dbs keeps changing

quote:

Concatenate the scripts into a single script?



that we are doing some times just before full deployment only but we cannot, but we cannot maintain them in 1 single script file permanetly, so merging process in extra burden on us

quote:

USE dbName at the top of each script would cause unwanted effects. We pass the name of the database to osql/sqlcmd as the database can change between environments



i tried this some time back, but i have to create a batch file for this and maintain this as well when ever i add/remove scripts, so extra burden. more importantly, the main reason why i avoided it because we might over see errors that could occur. but using the -o option might help us tracing the errors after deploymet

any way those all are workarounds, so there is no way we can set the option for old behavior :(

quote:
You simply have not used it long enough. Soon, you will uncover many more reasons to hate it.


lol

thanks for all discussion
Go to Top of Page
   

- Advertisement -