Showing posts with label default. Show all posts
Showing posts with label default. Show all posts

Wednesday, March 28, 2012

How can I change the default Save-As/Save directory

I am new to sql sever management studio express, but a long time query analyzer user. This is a very basic question.

I want to change the default directory in sql server management studio express so that when I go to save a query, it is already pointed to the correct one. Where do I change that?

Thanks,

Nanci

Goto [Tools], [Options], [Query Results]

There you will be able to change the default query results storage location.

|||

I have changed that setting, but it only works for the results of the query, not saving the query itself. Any other suggestions?

Nanci

sql

Monday, March 26, 2012

How can I change the default location of full text catalog?

Our current full text catalog default location is C:\Program Files\Microsoft SQL Server\MSSQL.5\MSSQL\FTData, we want change the default location to c:\data\MSSQL.5\FTData, so all the FT catalog will be created in this new location. Can anyone tell me how to do it?

Thanks

ShihChao

See SQL Server 2005 Books Online topic:

CREATE FULLTEXT CATALOG (Transact-SQL)

If you use T-SQL you can specify the path.

The topic states “IN PATH 'rootpath'

Is the root directory for the catalog. If rootpath is not specified, the new catalog will be located in the default directory specified at setup.”

Full-text catalogs must be created on a local hard disk drive associated with an instance of SQL Server. rootpath cannot be a relative path; it must reside on a drive on the same computer.

As you probably know you can specify the path when you use the UI. It does not default to any path.

|||

Also…you can use regedit at your own risk to change the default fulltext path

HKEY_LOCAL_MACHINE/Software/Microsoft/Microsoft SQL Server/MSSQL.x/MSSQLServer/FullTextDefaultPath – specify path

The restart SQL Server service

|||Thanks all all the replies

How can I change the default identity_range value in Merge replication

I have set up Merge Replication and everything is fine until a subscriber
goes offline for any length of time. The issue has to do with the setting of
the @.identity_range parameter for each article.
I am configuring the publication through the SQL Management Studio (server
is SQL 2005) and realise that I can run scripts and even alter the values
through the IDE.
What I want to do is change the default value that the IDE uses when it adds
the articles. The default seems to be 1000 which isn't really enough. We
would like to change the default to something like 10000
Does anybody know where SQL 2005 would store this value?
Thanks in advance,
Andrew Stanford
It is best that you not change meta data values in system tables. I'll
provide a way to change the indentiy range value for subscribers via the UI.
Since you already defined a merge publication, access the publication
properties by right clicking on the publication name under the
Replication:Local Publications node in SQL 2005 Management Studio. In the
left pane, select Articles. In the right pane, select the article you would
like to change the identity range values for. After highlighting the
article, use the Article Properties button. Scroll down to the identity
range management section and you should be able to change the Subscriber
Range Size value from 1000 to 10000. Hit OK, OK to confirm the changes.
Note that since you have an active merge publication already defined, the
subscriber will continue to use the old identity range values until they are
exhausted. The next time the merge agent requests a new ientitiy range from
the publisher, it will start using the new subscriber range value of 10000.
If you were to create a new publication, when you define the articles that
are in the publication you are able to drill into article properties and set
the subscriber range value to something other than 1000 up front.
Hope this helps,
Tom
This posting is provided "AS IS" with no warranties, and confers no rights.
"Andrew Stanford" <andrew.stanford@.bakertilly.co.uk> wrote in message
news:uUeZt4j2FHA.956@.TK2MSFTNGP10.phx.gbl...
>I have set up Merge Replication and everything is fine until a subscriber
>goes offline for any length of time. The issue has to do with the setting
>of the @.identity_range parameter for each article.
> I am configuring the publication through the SQL Management Studio (server
> is SQL 2005) and realise that I can run scripts and even alter the values
> through the IDE.
> What I want to do is change the default value that the IDE uses when it
> adds the articles. The default seems to be 1000 which isn't really enough.
> We would like to change the default to something like 10000
> Does anybody know where SQL 2005 would store this value?
>
> Thanks in advance,
> Andrew Stanford
>

Monday, March 19, 2012

How can default schema change in stored procedure ?

Hello,

How can default schema change in stored procedure ?

For Example:

There are two user 'User1', 'User2' in TestDb Database.
These users default schema is same name, like 'User1's default schema is 'User1', and 'User2's default schme is 'User2'.
And each users have 'Table1' table, like [User1].[Table1], [User2].[Table1]

In this enviroment,
query 'SELECT * FROM [Table1]' refer default schema of execute user.
like 'User1' execute 'SELECT * FROM [User1].[Table1]'.

But if dbo create a stored procedure below, default schema doesn't work.

CREATE PROCEDURE SelectTable1
AS
SET NOCOUNT ON
SELECT * FROM Table1
GO

When User1/User2 execute this stored procedure, error happend because Table1 not found.

So, I want to change default schema in stored procedure to current users default schema.
EXECUTE AS CALLER is change current user principal only, this doen't change default schema.

Regards,

This is not possible to do in TSQL right now without using dynamic SQL for the query inside the stored procedure. For EXECUTE AS CALLER the unqualified object names resolve against the schema for the owner of the SP and not the caller. This is known issue and there have been requests to provide the facility to resolve object name against the invoker of the SPs. Oracle for example allows you to specify this when creating PL/SQL SPs.

Friday, March 9, 2012

How are the aggregate details being calculated on a click through report?

Hi -

I need help figuring out what setting I need to tweak to get the correct calculations for the default aggregate attributes for the related entities of the one I am drilling into. Right now it is calculating the total across all for every row and not slicing by sub-customer.

Example:

I have a customer with a one-to-many relationship to incidents. Both have a count aggregate that is part of the default aggregates for the entity. There are 58 rows in my table. If I run a report with CustomerName and #Incidents, I correctly get different sub totals for each customer, totalling to 58 for the grand total. However, if I run a summary report on customers and drill into the customers using click through, the #Incidents is displayed but it is 58 for all customers - every row.

If I go into the defaultDetailAttributes of the Customer and add the #Incidents to it and run the previous test, then the correct number of incidents are shown for the customer, then the incorrect number of incidents follow (from getting the aggregates from the children).

The query generated is huge and I am sure it has something to do with my OptionalMany relationships between the tables, but I can't understand why...

Can anyone help me out?

Thanks in advance,

Toni Fielder

I had a similar issue from before. I'm assuming you are using multiple datasets in this one table? I really struggled to find another way to dish this stuff out correctly, but the only efficient way I could get what I wanted (the same thing you are looking for) was to create a giant stored procedure combining the tables I was planning on using. Another way I found (the less efficient way) was to create subreports for each subcategory and call the information into the subreports that each subcategory was grouped by. This way will really increase the amount of time your report will be rendering for, but if you cannot do a stored procedure then this may be your only choice. Hope I could help.|||

Thanks for the message - I think I have a bit of a different situation.... I am constrained by using models and report builder - but I think custom click-through reports might be the equivalent of what you had to do.... unfortunately this has to be a generic model that is sold to multiple customers so custom click through reports has to be my last choice....

I now have another question that is related. I used my smallest object to try and figure out how this stuff is working. I changed all it's relationships (incorrectly) to One-One so it had no many relationships (or optional) from which to grab other aggregates. And I am getting all manner of aggregates from different entities in my model that really have nothing to do with my base entity. It has to be getting them from some extended relationship (all entities are interrelated - like they all share the users table under the covers to get Insert/Update information) but I am thoroughly confused at the moment.

Thanks for the help everyone.

Wednesday, March 7, 2012

Hours/minutes in the Calendar date time prompt

Is there any way to get teh date time prompt to display hours & minutes? For example, if I default the field to '=Today', I would like to see '8/10/2006 9:04 AM' instead of '8/10/2006'

Similarly, when I pick a date using the date picker control that is displayed by default, I would like it to also display the time, which I guess would default to 12:00 AM.

Thanks in advance!

I have a report parameter set using :

=DateSerial(Year(now()), Month(now()), 0) that displays the last day of the month as default and when you view the report the end date is populated as:

7/31/2006 12:00:00 AM

does that help?

|||

Hi,

I encountered the same situation once and this is what I did:

in the report parameter --> default values, write the following expression

=today().addseconds(1). This will display the data and time when you run the report. The only thing is that for the default value it will add 1 second.

--Amde

|||

Thanks...your replies got me off on the right path. I ended up using the following:

=DateAdd("h",12,Today)

and

=now

I had been using =Today which just returns a date. Duh.