Showing posts with label type. Show all posts
Showing posts with label type. Show all posts

Friday, March 30, 2012

Mirroring and Domains

I not too hot on networking. When I type "IPCONFIG /ALL" the "Prmary DNS Suffix" is empty. Does this mean I have no domain? Can I configure a mirror on this server?

Thanks in advance.

Yes, you can configure a mirror to the server. You do not have to be in a domain to do mirroring, although it makes it a bit easier to manage the accounts at a Windows level.

Mirroring operates under the security context of the SQL Server service account. That means the SQL Server service account on the instance hosting the principal must have been granted CONNECT permissions on the instance hosting the mirror. It additionally needs dbo authority to the mirror database. Likewise, the SQL Server service account on the instance hosting the mirror needs to have been granted CONNECT permissions on the instance hosting the principal as well as dbo authority on the principal database.

|||Michael I'll be glad if you could clarify my doubt with respect to service account !
Can we have the same Sql service account in both the sql servers and configure mirroring ? also if there are 2 different service account for principal and mirror servers can we configure mirroring ?

This might be a simple question but i am confused at this ! your help is very much appreciated Smile

Thanxx
Deepak

|||Yes. If you use a local account on both machine that has the exact same name and password, then you wind up with Windows doing passthrough authentication. (Although this practice is frowned upon.) If you have 2 different service accounts, you can still do mirroring. You just have to make sure the permission conditions I outlined above are true.

Monday, March 26, 2012

Minor changes to field position

I've got a report with six vertical fields. Are are currency type, all are same font. All are right justified. All are from the same data source. All are the same data type on the data source. For some reason, one of these fields is approximately 1/16" indented from the rest. Normally, I would rule this as a quirk and manually adjust the field's position by 1/16" in order to compensate. Unfortunately, I don't seem able to manually move the field in increments of less that 1/8". Any ideas?Check to see if snap to grid is on. Also, is one of these a formula and the others text >?<|||You Should be able to select all the fields, and size to same size.

Monday, March 19, 2012

Min(NULL) shows up as 12/30/1899 in cube

Hi!

I have a cube with a measure based on a datetime column with aggregation Min in AS 2000 SP4. The Data Type is set to Date and the Format is set to Short Date. Somehow the the measure shows 12/30/1899 when all values in the datetime column are NULL. If I check the properties in the cube browser it says Formatted Value: 12/30/1899 and Value: 12:00:00 AM.

I've implemented a work around in the reports that use this measure to look for 1899 or AM and replace with it NULL, but what I really want is the cube to display the real value (= NULL) when I browse it.

Any help would be greatly appreciated. Thanks!

Nulls don't behave the same in an OLAP database. In fact they often evaluate to 0 which is what is happening here.

In a relational DB 1 + NULL = NULL

In an OLAP DB 1 + NULL = 1

You might have to change your approach, so possible avenues to explore would be

use an aggregation of None and use a calculation to rollup the values, but this could be slow as you would need to drill down to the leaf level to get any values when using an aggregtion type of none. You might be able to attach the date as an attribute to another dimension, it depends what the date measure is.|||

So basically what I have to do is to create a calculated member based on this measure and use that one in the reports?:

iif(the_date_measure == 12/30/1899, NULL, iif(the_date_measure == 12:00:00 AM, NULL, the_date_measure )), which is the same thing I do in the reports.

I've verified it and a date column with NULL becomes 12/30/1899 in AS (in ver 2000 at least). So gotta use a work around as above to fix this.

|||

That would work too.

You could even put that type of calculation in the cube. If it were me I would hide the "raw" measure and create a calculated measure with this sort of logic in it.

|||

I've now created a calculated member as:

IIF( (InStr([Measures].[Adate], "00:00") > 0) OR (InStr([Measures].[Adate], "00.00") > 0), NULL, [Measures].[Adate])

and it seems to work very well. Looking for AM or 1899 does not work since the value will be 12:00:00 AM, 0:00:00, 00:00:00 depending on regional settings. I looked through all regional settings on my computer and only Faeroese and Italy have a dot separator instead of colon in their time setting (00.00.00).

Btw, do you know how date columns with NULL show up in AS 2005? Same behavior here?

Thanks for all your help!

|||Well you have some more options in AS2005, it is not really typical to use dates based measures so it is hard to say without knowing more details. The Min aggregation should behave the same, but you could also potential use something like LastNonEmpty or None with a calculation to do the rollup.

Saturday, February 25, 2012

Migration from Access : AutoNumber

I have proceed to an Access Migration to SQL Server.

The Access field type "autonumber" are now
of type "int" in SQL Server.
I do not see in SQL Server a way to tell him that it is
an auto counter.
Is this transparent ?
Will SQL Server manage it alone ?

Thanks, PierreI'm not sure of your exact question, but in SQL Server the equivalent of "Autonumber" is IDENTITY. If you want to count by one, then its IDENTITY (1,1).|||I do not see the field type "identity" in SQL Server ?

My question was, in Access we have the type of field
"automatic number" which is an auto incremental integer field.
(often ID numbers)

After migration, this one become a simple "int" field.

So in my sql statement, I never fullfill this field through
the "insert", because it is automatic in ACCESS.

Now, under SQL Server, it bugs.
So I need to tell to SQL Server that this is an atomatic incremental field.

I do not see how to do that.

Thanks,
Pierre.|||Pierre,

The IDENTITY property is not a data type, but an attribute that can be assigned to INT data types (and other data types as well). From EM, you can right-click on the table and go into Design. In the design, click on the field you wish to set to auto-increment. In the area beneath the listing of columns, you will see a list of attributes (Description, Default Value, Precision, Scale, Identity, Identity Seed, Indentity Increment, etc...).

Click on the Identity attribute and set it equal to "Yes".

Alternatively, you may use a script to create the table. Here is a generic script that you may use. Note, however, that you will have issues with trying to do it this way. Obviously, you cannot create a table with the same name over the existing table. Also, if you create a temporary table and push the data from your existing table into it, you will have to enable Identity Insert (see SQL BOL). However, I thought you should see the DDL for creating a table with an Identity Column so that you might better understand what SQL is doing.

CREATE TABLE [dbo].[tbl_MyTable] (
[int] IDENTITY (1, 1) NOT NULL ,
[MyColumn1] [varchar] (50) NOT NULL ,
[MyColumn2] [varchar] (3000) NULL ,
[MyColumn3] [varchar] (50) NOT NULL
) ON [PRIMARY]

Also not the following:
1. The syntax for IDENTITY is INDENTITY (Seed, Increment)
2. Seed is a starting value. You may not want to start at 1
3. Increment is a value by which the increment the identity. You may want to increment by a value other than 1.

HTH,

Hugh Scott

See SQL BOL for more information on IDENTITY

[i]Originally posted by Plarde
I do not see the field type "identity" in SQL Server ?

My question was, in Access we have the type of field
"automatic number" which is an auto incremental integer field.
(often ID numbers)

After migration, this one become a simple "int" field.

So in my sql statement, I never fullfill this field through
the "insert", because it is automatic in ACCESS.

Now, under SQL Server, it bugs.
So I need to tell to SQL Server that this is an atomatic incremental field.

I do not see how to do that.

Thanks,
Pierre.|||Thank you very much,
that was the solution.

It does work fine.

Pierre.