Showing posts with label management. Show all posts
Showing posts with label management. Show all posts

Sunday, March 25, 2012

Changing the default stored procedure template (In MS-SQLSMStudio)

Well, the topic says it all, really.

I edit my stored procedures in Microsoft SQL Management Studio 9.00.2047, but whenever I click 'New Stored Procedure..' it coughs up some default and useless thing.

So I started looking how to change this but I can't find the -right- place. I have found a couple of files on my disk called 'Create Stored Procedure (New Menu).sql' - however altering these files does nothing for the default SP.

The template explorer happily lets me EDIT the same file, sadly the edits don't actually have any effect either.

Anyone?

i can edit the Template and add a new template in my scenario.... Just go to the template Press Right Button Select Edit do the modification as u want press the save button and close it...

Madhu

|||

Sadly, that doesn't work.

I can edit the template from the template explorer, sure. But saves don't affect the template my system actually uses. Useless.

I found my own solution though, although not as elegant. I edited the file:

C:\Program Files\Microsoft SQL Server\90\Tools\Binn\VSShell\Common7\IDE\sqlworkbenchprojectitems\Sql\Stored Procedure\Create Stored Procedure (New Menu).sql

And Presto.

sql

Changing the default database

I have a large number of databases on my localhost. Whenever I open up
Management Studio, there is one database that is selected by default
(under Available Databases). But this is not the database that I use
regularly. Everytime I run a query, I have to make sure that the
database is changed.
Is there a way to change the default database selected in the
Available Databases drop down?
ThanksHow do you open the query window? The exact steps for opening the query window determines what steps
you need to take to make this your default database.
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://sqlblog.com/blogs/tibor_karaszi
"spdude" <sandeshmeda@.gmail.com> wrote in message
news:1178132157.841268.133800@.y80g2000hsf.googlegroups.com...
>I have a large number of databases on my localhost. Whenever I open up
> Management Studio, there is one database that is selected by default
> (under Available Databases). But this is not the database that I use
> regularly. Everytime I run a query, I have to make sure that the
> database is changed.
> Is there a way to change the default database selected in the
> Available Databases drop down?
> Thanks
>|||On May 2, 2:55 pm, spdude <sandeshm...@.gmail.com> wrote:
> I have a large number of databases on my localhost. Whenever I open up
> Management Studio, there is one database that is selected by default
> (under Available Databases). But this is not the database that I use
> regularly. Everytime I run a query, I have to make sure that the
> database is changed.
> Is there a way to change the default database selected in the
> Available Databases drop down?
> Thanks
Have you tried setting the default database for the login you use?|||Thanks for the replies.
How do I set the default database for the login?
I open the query window by clicking on the "New Query" button. I like
this method because its just one click away.
On May 2, 2:49 pm, tcappelle...@.gmail.com wrote:
> On May 2, 2:55 pm,spdude<sandeshm...@.gmail.com> wrote:
> > I have a large number of databases on my localhost. Whenever I open up
> > Management Studio, there is one database that is selected by default
> > (under Available Databases). But this is not the database that I use
> > regularly. Everytime I run a query, I have to make sure that the
> > database is changed.
> > Is there a way to change the default database selected in the
> > Available Databases drop down?
> > Thanks
> Have you tried setting the default database for the login you use?|||Look at sp_defaultdb in Books Online. You can also use:
ALTER LOGIN sa WITH DEFAULT_DATABASE = [master];
--
Aaron Bertrand
SQL Server MVP
http://www.sqlblog.com/
http://www.aspfaq.com/5006
"spdude" <sandeshmeda@.gmail.com> wrote in message
news:1178286625.150157.211740@.h2g2000hsg.googlegroups.com...
> Thanks for the replies.
> How do I set the default database for the login?
> I open the query window by clicking on the "New Query" button. I like
> this method because its just one click away.
> On May 2, 2:49 pm, tcappelle...@.gmail.com wrote:
>> On May 2, 2:55 pm,spdude<sandeshm...@.gmail.com> wrote:
>> > I have a large number of databases on my localhost. Whenever I open up
>> > Management Studio, there is one database that is selected by default
>> > (under Available Databases). But this is not the database that I use
>> > regularly. Everytime I run a query, I have to make sure that the
>> > database is changed.
>> > Is there a way to change the default database selected in the
>> > Available Databases drop down?
>> > Thanks
>> Have you tried setting the default database for the login you use?
>

Monday, March 19, 2012

Changing SQL Server Management Studio "My Projects" path

Hi,

I want to change the default "My Projects" save location from "My Documents\SQL Server Management Studio\Projects" to somewhere else. I didn't see the My Projects path in the SQL Server Management Studio Options.

How can I change the path?

Thanks,

Mike

One way is to use Regedit, and search for 'SQL Server Management Studio\Projects'.

You will find the location for NewProjects, DefaultProjects, NewProjItems, DefaultProjItems -and a few other things you might like to know about.

As always, with editing the registry, use caution.

|||I have the same question/issue. I've looked for a registry entry like 'SQL Server Management Studio\Projects' but have not been able to locate anything that even comes close. Running under Windows Vista Enterprise. Can you give the full path to the registry key? TIA|||

On my computer, Windows Server 2003, I found it in two locations:

HKEY_CURRENT_USER\Software\Microsoft\Microsoft SQL Server\90\Tools\Shell

AND

HKEY_USERS\{My SID}\Software\Microsoft\Microsoft SQL Server\90\Tools\Shell

The values to find and change are:

DefaultNewProjectLocation

MyDocumentsLocation

Both need to be 'Expandable String Value' data

Again, the RegEdit search was for: [SQL Server Management Studio\Projects]

(no square brackets)

|||For SQL Server Express the location within the registry is:

HKEY_CURRENT_USER\Software\Microsoft\Microsoft SQL Server\90\Tools\ShellSEM

and the search item to use is:

"SQL Server Management Studio Express\Projects"

Changing SQL Server Management Studio "My Projects" path

Hi,

I want to change the default "My Projects" save location from "My Documents\SQL Server Management Studio\Projects" to somewhere else. I didn't see the My Projects path in the SQL Server Management Studio Options.

How can I change the path?

Thanks,

Mike

One way is to use Regedit, and search for 'SQL Server Management Studio\Projects'.

You will find the location for NewProjects, DefaultProjects, NewProjItems, DefaultProjItems -and a few other things you might like to know about.

As always, with editing the registry, use caution.

|||I have the same question/issue. I've looked for a registry entry like 'SQL Server Management Studio\Projects' but have not been able to locate anything that even comes close. Running under Windows Vista Enterprise. Can you give the full path to the registry key? TIA|||

On my computer, Windows Server 2003, I found it in two locations:

HKEY_CURRENT_USER\Software\Microsoft\Microsoft SQL Server\90\Tools\Shell

AND

HKEY_USERS\{My SID}\Software\Microsoft\Microsoft SQL Server\90\Tools\Shell

The values to find and change are:

DefaultNewProjectLocation

MyDocumentsLocation

Both need to be 'Expandable String Value' data

Again, the RegEdit search was for: [SQL Server Management Studio\Projects]

(no square brackets)

Thursday, February 16, 2012

Changing Filegroup for Text/Image Data SQL 2005

I have created a new filegroup to store text/image data for a couple of
tables, but when I try to change the filegroup in management studio it always
changes back to the default filegroup. Any suggestions?
Thanks,
AdrewCan you be more specific on what you mean by try to change it? In order for
the LOBs to be stored on a specific Filegroup you need to specify that when
you create the table, not afterwards. And if you are in SQL2005 you should
be looking at using the new MAX datatypes and not Text & Image.
--
Andrew J. Kelly SQL MVP
Solid Quality Mentors
"chabotwvu" <chabotwvu@.discussions.microsoft.com> wrote in message
news:2688797F-1B5D-447D-AC5E-E79AF175ADF5@.microsoft.com...
>I have created a new filegroup to store text/image data for a couple of
> tables, but when I try to change the filegroup in management studio it
> always
> changes back to the default filegroup. Any suggestions?
> Thanks,
> Adrew

Changing field props in SQL Management Studio

Hi,
I have average database with something like 15M records. I have to change
some fields property of tables with average 4M records. On smaller tables I
can change one field at time and save design would be successful but on
larger tables I got timeout something like 25 seconds after pressing OK.
Where I can change timeout period or disable it?
Tried to put 0 on Connection window, changed to 0 remote query timeout, but
it does not change anything.
Thanks
RobertI strongly encourage you to do these changes using ALTER TABLE instead of the GUI since the GUI can
be quite clumsy regarding the SQL it generates.
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://sqlblog.com/blogs/tibor_karaszi
"Piasecznik" <WYpiasecznikWAL@.op.pl> wrote in message news:frdfec$1gmi$1@.news2.ipartners.pl...
> Hi,
> I have average database with something like 15M records. I have to change some fields property of
> tables with average 4M records. On smaller tables I can change one field at time and save design
> would be successful but on larger tables I got timeout something like 25 seconds after pressing
> OK.
> Where I can change timeout period or disable it?
> Tried to put 0 on Connection window, changed to 0 remote query timeout, but it does not change
> anything.
> Thanks
> Robert
>

Changing Fail-safe operator in SQL Server Management Studio

I have designated an operator as the fail-safe operator in SQL Server Management Studio (SSMS). I now wish to change the fail-safe operator to be a different operator. SSMS allows me to make the changes, but after selecting "OK" and re-opening the SQL Server Agent Properties in SSMS, the changes have not been made. Any idea how to change the fail-safe operator? As far as I can tell, there are no stored procedures available, and as I understand it SSMS is already using SMO. Any help would be greatly appreciated.

Thanks

John

Thanks for taking time to report this. I have opened a bug on this.

You can SMO to perform this operation or use SP_MSsetalertinfo .

Thanks,

Gops Dwarak

Tuesday, February 14, 2012

Changing default folder for saving query text

When I save a query (not a query result) in SSMS, the default root folder is
My Documents\SQL Server Management Studio\Projects
Is there any way to change this default and make it persist beyond the current session?

Hello,

Yes it is possible for you to set the default folder to your prefered location. Open Microsoft SQL Server 2005 Management Studio.

From the Menu select Tools -> Options. Select Query Results noted and enter your prefered location where you want to save your queries in the "Default locations for saving query results" text box.

Thanks

|||Yes, I'm well aware that this setting is available for query results, but I'm asking about the query text itself - how do I change the default save path for the query text?

Sunday, February 12, 2012

changing date formats

Hello. I am using Microsoft SQL Server Management Studio (SQL Server 2005). When I select a date column from a table, the date is displayed in "mm/dd/yyyy hh:mm:ss" format. Is there a way i can change this date format so that it shows "dd/mm/yyyy hh:mm:ss" permanently? Thanks.If u're using VB then it can be done.
say its a DateTimePicker so...
Format(dtp.Value, "d/M/yyyy")
|||If you want to do it in SQL Server check out the CONVERT function.
It takes three parameters (for dates)
eg. SELECT CONVERT(varchar, GetDate(), 121)
Check out BOL for possible values and a description of the last parameter, this defines the format.
hth