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

Friday, March 30, 2012

nvarchar = unicode?

Dear all,
I would like to ask the question as the tile. will all data store in
nvarchar type be converted to unicode? Thank you for all of your help.
Alex Yung
Hi Alex,
Thanks for your post.
I think the answer from Peter was short but rather solid. I just wanted to
post a quick note to see if you would like additional assistance or
information regarding this particular issue. We appreciate your patience
and look forward to hearing from you!
Sincerely yours,
Michael Cheng
Online Partner Support Specialist
Partner Support Group
Microsoft Global Technical Support Center
Get Secure! - http://www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.
Please reply to newsgroups only, many thanks!

nvarchar = unicode?

Dear all,
I would like to ask the question as the tile. will all data store in
nvarchar type be converted to unicode? Thank you for all of your help.
Alex YungHi Alex,
Thanks for your post.
I think the answer from Peter was short but rather solid. I just wanted to
post a quick note to see if you would like additional assistance or
information regarding this particular issue. We appreciate your patience
and look forward to hearing from you!
Sincerely yours,
Michael Cheng
Online Partner Support Specialist
Partner Support Group
Microsoft Global Technical Support Center
---
Get Secure! - http://www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.
Please reply to newsgroups only, many thanks!

nvarchar = unicode?

Dear all,
I would like to ask the question as the tile. will all data store in
nvarchar type be converted to unicode? Thank you for all of your help.
Alex YungYes
http://msdn.microsoft.com/library/default.asp?
url=/library/en-us/tsqlref/ts_na-nop_9msy.asp
Peter
"Information is the oxygen of the modern age. It seeps
through the walls topped by barbed wire, it wafts across
the electrified borders.""
Ronald Reagan
>--Original Message--
>Dear all,
> I would like to ask the question as the tile. will all
data store in
>nvarchar type be converted to unicode? Thank you for all
of your help.
>Alex Yung
>
>.
>|||Hi Alex,
Thanks for your post.
I think the answer from Peter was short but rather solid. I just wanted to
post a quick note to see if you would like additional assistance or
information regarding this particular issue. We appreciate your patience
and look forward to hearing from you!
Sincerely yours,
Michael Cheng
Online Partner Support Specialist
Partner Support Group
Microsoft Global Technical Support Center
---
Get Secure! - http://www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.
Please reply to newsgroups only, many thanks!

Numeric/Decimal datatype

Hi,
Is there any difference between the Decimal and Numeric data type? I am
converting an Oracle Numeric data type (using precision and scale) to
SQLServer and need to know if they are identical, is one there just for
backward compatibility etc.
Thanks for any help.> Is there any difference between the Decimal and Numeric data type?
They are functionally equivalent.
This is my signature. It is a general reminder.
Please post DDL, sample data and desired results.
See http://www.aspfaq.com/5006 for info.|||In ANSI SQL, for DECIMAL, you can get higher precision than what you asked f
or. For NUMERIC, you
should get what you ask for.
In SQL Server, they are identical, you get what you ask for for both datatyp
es.
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"ClaireB" <ClaireB@.discussions.microsoft.com> wrote in message
news:0291C14E-C9DD-4B95-8095-77B408927262@.microsoft.com...
> Hi,
> Is there any difference between the Decimal and Numeric data type? I am
> converting an Oracle Numeric data type (using precision and scale) to
> SQLServer and need to know if they are identical, is one there just for
> backward compatibility etc.
> Thanks for any help.
>|||Thanks for your help. NUMERIC it is then...
Claire
"Tibor Karaszi" wrote:

> In ANSI SQL, for DECIMAL, you can get higher precision than what you asked
for. For NUMERIC, you
> should get what you ask for.
> In SQL Server, they are identical, you get what you ask for for both datat
ypes.
> --
> Tibor Karaszi, SQL Server MVP
> http://www.karaszi.com/sqlserver/default.asp
> http://www.solidqualitylearning.com/
>
> "ClaireB" <ClaireB@.discussions.microsoft.com> wrote in message
> news:0291C14E-C9DD-4B95-8095-77B408927262@.microsoft.com...
>
>

numeric vs. money data types performance considerations or gotchas

Hi All,

We are doing some db cleanup and our monetary fields are not defined consistanly. Most are numeric and some are money data type.

Does anyone know of any performance considerations and/or gotchas regarding these two data types? We'd like to convert all monetary amounts to numeric(10,6) fields.

Any feedback would be greatly appreciated.

thanks, dave

This should have a problem if you are using SQL 4.2.1 or 6.5 and I don;t think you are using them so.

Here's an excerpt from Microsoft SQL Server Books Online:
"Monetary Data
Monetary data represents positive or negative amounts of money. In Microsoft? SQL ServerT 2000, monetary data is stored using the money and smallmoney data types. Monetary data can be stored to an accuracy of four decimal places. Use the money data type to store values in the range from -922,337,203,685,477.5808 through +922,337,203,685,477.5807 (requires 8 bytes to store a value). Use the smallmoney data type to store values in the range from -214,748.3648 through 214,748.3647 (requires 4 bytes to store a value). If a greater number of decimal places are required, use the decimal data type instead."

Numeric to real type

Hi Everyone,

I hope this is not a silly one. Well, I have two tables - table 1 destination, table 2 source. Data is being imported from table 1 to table 2. For ages this has been working fine but now we get an error which just says can not insert value 1 (.i.e. user defined error message from error handling). I have been trying to run this whole thing bit by bit and detect the actual error but for some reason it doesn't show any error but only on live.

I could detect just one potential issue that value 1 in table1 is numeric defined with size 13 precision (20,10) and in table 2 it is defined as real. But I am not sure if conversion from numeric to real can be any problem as the SP didn't show me when I tried to run manually.

Can anyone double on my assumption that this might be a potential problem which doesn't seem to occur on test server as it might be because the data are different in test and live.

Thanks a ton in advance,
Sree

Quote:

Originally Posted by sreemati

Hi Everyone,

I hope this is not a silly one. Well, I have two tables - table 1 destination, table 2 source. Data is being imported from table 1 to table 2. For ages this has been working fine but now we get an error which just says can not insert value 1 (.i.e. user defined error message from error handling). I have been trying to run this whole thing bit by bit and detect the actual error but for some reason it doesn't show any error but only on live.

I could detect just one potential issue that value 1 in table1 is numeric defined with size 13 precision (20,10) and in table 2 it is defined as real. But I am not sure if conversion from numeric to real can be any problem as the SP didn't show me when I tried to run manually.

Can anyone double on my assumption that this might be a potential problem which doesn't seem to occur on test server as it might be because the data are different in test and live.

Thanks a ton in advance,
Sree


Well that should not be a problem because 1 is just a single digit number.
We would not be able to find the real reason with the help of user defined message.
Is it possible to find the original error message and POST it for my reference?|||

Quote:

Originally Posted by amitpatel66

Well that should not be a problem because 1 is just a single digit number.
We would not be able to find the real reason with the help of user defined message.
Is it possible to find the original error message and POST it for my reference?


Hi

I did not mean the Number 1 by value1, I just meant it in reference to a field value1. Yes, I know that I am trying to re-create the error and get the error message, hopefully I get lucky soon and than I will post it.

Thanks,
Sree|||

Quote:

Originally Posted by sreemati

Hi

I did not mean the Number 1 by value1, I just meant it in reference to a field value1. Yes, I know that I am trying to re-create the error and get the error message, hopefully I get lucky soon and than I will post it.

Thanks,
Sree


Then I assume there should be some problem with the data.
Ok, find out the exact error message and POST here for my reference!!

Wednesday, March 28, 2012

numeric data types in sqlserver

Whats the difference between int,float and decimal in sql server.
WHich data type takes how many bytes?
What data type i should use to store the following sets of data
1set--100000,854275,74892734
2set--6538726.98765923,762.659325
Thanks.int is for integers. 4-byte. Max value is 2^31. This looks adequate for your first set although if the numbers will exceed 2^31 you should use bigint (8 bytes)

float is for floating point numbers (non-integers). You will need floating point for the second set. I would suggest the double type for that set.

decimal, numeric, and float all support customizable precision levels. BOL has pretty good documentation on this.

Numeric data column and insert from ASP.NET

I am trying to insert some values into a table where the column is of the data type "numeric". The insert works fine.Update does not work.

Update BUT_BREAKDOWN_PCT SET BDP_EFFORT_BREAKDOWN_PCT=0.15 WHERE BDP_BREAKDOWN_ID =1 AND BDP_PHASE_ID = 3 AND BDP_START_EFF_DT = '12/31/2004'

BDP_EFFORT_BREAKDOWN_PCT is a numeric column with a size 5 (4,3)

When I do the updatedirectly from QA, it works fine.

I was googling it and read a KB article saying it's a problem with Service Pack of SQL Server 2000. If it is, then the query should not work even from QA...isn't it?

Anyone had this problem before? Please help.

In SQL Server 2000 you can change the data type to Decimal and your problem will go away but in SQL Server 7.0 Numeric was more stable than Decimal from my experience. Hope this helps.|||If it works OK in Query Analyzer (works fine for me, too), and it isnot working in your application, then your application is not sendingthe exact same information.

What results are you seeing? An error message? Unexpected data in theBDP_EFFORT_BREAKDOWN_PCTcolumn? No update at all?

I am suspecting that you are not seeing any update at all, which meansthat your WHERE condition is not being met. And since you seem tohave a datetime column in your WHERE condition, I would guess furtherthat that is where your problem lies. (Datetime columnstrip up a lot of people.)

If you are having difficulty troubleshooting this further, let us see your code and maybe we can point out the problem.

numeric and decimal

I am using SQL 2000. What is the difference between a numeric type and
decimal type data? Are they interchangeable?Hi,
In SQL Server, the numeric data type is equivalent to the decimal data type.
Thanks
Hari
SQL Server MVP
" -00Eric Clapton" <a@.b.com> wrote in message
news:enCIlrmuFHA.2396@.TK2MSFTNGP14.phx.gbl...
>I am using SQL 2000. What is the difference between a numeric type and
>decimal type data? Are they interchangeable?
>

numeric and decimal

I am using SQL 2000. What is the difference between a numeric type and
decimal type data? Are they interchangeable?Hi,
In SQL Server, the numeric data type is equivalent to the decimal data type.
Thanks
Hari
SQL Server MVP
" -00Eric Clapton" <a@.b.com> wrote in message
news:enCIlrmuFHA.2396@.TK2MSFTNGP14.phx.gbl...
>I am using SQL 2000. What is the difference between a numeric type and
>decimal type data? Are they interchangeable?
>

numeric and decimal

I am using SQL 2000. What is the difference between a numeric type and
decimal type data? Are they interchangeable?
Hi,
In SQL Server, the numeric data type is equivalent to the decimal data type.
Thanks
Hari
SQL Server MVP
" -00Eric Clapton" <a@.b.com> wrote in message
news:enCIlrmuFHA.2396@.TK2MSFTNGP14.phx.gbl...
>I am using SQL 2000. What is the difference between a numeric type and
>decimal type data? Are they interchangeable?
>

Numbers and Crystal Reports 9

I exported a column of type float to SQL Server using DTS. In Crystal
reports, it 'sees' the column as a string! Is 'float' the best type to
use? Must I create a formula field in CR to 'correct' for this?Hi

From the database side you should choose the most appropriate datatype for
the data which it will hold, at a guess decimal might be more appropriate.

Its been a while since I used Crystal so I can't remember how it determined
the datatypes, but I seem to remember that you mask the output to be in the
format that you require.

John

"chrispycrunch" <chrispycrunch@.gmail.com> wrote in message
news:1107712517.428328.79850@.o13g2000cwo.googlegro ups.com...
>I exported a column of type float to SQL Server using DTS. In Crystal
> reports, it 'sees' the column as a string! Is 'float' the best type to
> use? Must I create a formula field in CR to 'correct' for this?|||chrispycrunch (chrispycrunch@.gmail.com) writes:
> I exported a column of type float to SQL Server using DTS. In Crystal
> reports, it 'sees' the column as a string! Is 'float' the best type to
> use? Must I create a formula field in CR to 'correct' for this?

So if you sp_help on the table in Query Analyzer, it is reported to be
a float?

If so, you should probably ask in a forum devoted to Crystal Reports. We
use Crystal in our shop, but I don't have it installed on my machine...

--
Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se

Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techin.../2000/books.asp|||"John Bell" <jbellnewsposts@.hotmail.com> wrote in message
news:4206972c$0$7707$fa0fcedb@.news.zen.co.uk...
> Hi
> From the database side you should choose the most appropriate datatype for
> the data which it will hold, at a guess decimal might be more appropriate.
> Its been a while since I used Crystal so I can't remember how it
> determined the datatypes, but I seem to remember that you mask the output
> to be in the format that you require.
> John
> "chrispycrunch" <chrispycrunch@.gmail.com> wrote in message
> news:1107712517.428328.79850@.o13g2000cwo.googlegro ups.com...
>>I exported a column of type float to SQL Server using DTS. In Crystal
>> reports, it 'sees' the column as a string! Is 'float' the best type to
>> use? Must I create a formula field in CR to 'correct' for this?
>
I would imagine decimal is probably more appropriate than float.

I usually base my crystal reports on stored procedures rather than directly
on tables.
I can then do any "work" necessary to make the crystal report easier to put
together in the stored procedure which I, quite frankly, find a lot easier
to work with than the crystal alternatives.
I'd do any maths I could in the stored procedure as well.
If float is best for storage and decimal for presentation then you could
cast the field in your stored procedure's select statement.

If these are no good for you then, is it just a presentation thing?
You can specify a formula for display format of a field in crystal.

HTH
--
Regards,
Andy O'Neill

Friday, March 9, 2012

NullReferenceException from AMO - Connect

Server svr = new Server();

svr.Connect(Properties.Settings.Default.OLAPConnectionString);

(Server is of type Microsoft.AnalysisServices.Server)

Results in:

NullReferenceException: Object reference not set to an instance of an object.

at Microsoft.AnalysisServices.DesignXmlReader.CheckForXmlaException()

at Microsoft.AnalysisServices.DesignXmlReader.ReadRoot(Type type)

at Microsoft.AnalysisServices.DesignXmlReader.DeserializeComponent(IDesignerSerializationManager manager, XmlReader reader, Type root)

at Microsoft.AnalysisServices.JaXmlSerializer.DeserializeComponent(IDesignerSerializationManager manager, XmlReader reader, Type root)

at Microsoft.AnalysisServices.AnalysisServicesClient.Discover(IMajorObject obj, ObjectExpansion expansion)

at Microsoft.AnalysisServices.Server.Refresh(IMajorObject obj, ObjectExpansion expansion)

at Microsoft.AnalysisServices.Server.SendRefresh(IMajorObject obj, ObjectExpansion expansion)

at Microsoft.AnalysisServices.MajorObject.Refresh()

at Microsoft.AnalysisServices.Server.Connect(String connectionString, String sessionId)

at Microsoft.AnalysisServices.Server.Connect(String connectionString)

at ... my code, the call to Connect, above

The connection string is non-null, and names a valid, running SSAS database on the local machine. Any theories? This code has been working fine up till now, and nothing's changed in the cube or the enclosing database in weeks. The only thing of interest that changed recently was a batch of updates from Windows Update - but that seems very unlikely since none of them were SSAS related.

... and, wouldn't you know it, next time through, the code worked fine. The process hasn't even been re-started. I hate bugs that "fix" themselves!

This is typically a result of late bindings. Not necessarily a bug, just a runtime risk.

Adamus

|||Actually, I think the problem was simply that I had VS set to stop on exception throw, instead of stop on unhandled. Second time through, I'd changed the settings. Presumably this exception was thrown, caught and handled inside of AMO and is nothing to worry about.