Showing posts with label datatype. Show all posts
Showing posts with label datatype. Show all posts

Sunday, March 25, 2012

Cursor for

Hi,

Declare wh_ctry_id CURSOR FOR

Is "cursor for" is a function or datatype or what is this?

Regards

Abdul

According to the MSDN documentation...

Microsoft SQL Server statements produce a complete result set, butthere are times when the results are best processed one row at a time.Opening a cursor on a result set allows processing the result set onerow at a time. You can assign a cursor to a variable or parameter withacursor data type.

... a cursor is sort of result set within SQL Server.

|||

To know about the Cursors, check out the links given below:

http://www.databasejournal.com/features/mssql/article.php/1439731

http://www.teratrax.com/articles/sql_server_cursor.html

http://www.sqlteam.com/article/cursors-an-overview

|||

Hello Abdul,

The CURSOR FOR declaration is part of T-SQL. See:http://msdn2.microsoft.com/en-us/library/aa258831(SQL.80).aspx

You can use a cursor for looping over a number of records to perform certain actions in a stored procedure.

Jeroen Molenaar.

Monday, March 19, 2012

Currency or Double preferred?

I'm wondering whether it's better to choose Currency or Double for measure datatypes if the aggregated values will fit inside either datatype. Thoughts? Which would be smaller in terms of storage? If the number gets real big will either Currency or Double lose precision? Are rounding errors more prevalent with one rather than the other?

I have read the following pages but can't seem to make heads or tails of it in terms of best practices:

http://msdn2.microsoft.com/en-us/library/ms129408.aspx

http://msdn2.microsoft.com/en-us/library/system.data.oledb.oledbtype.aspx

http://msdn2.microsoft.com/en-us/library/678hzkk9(VS.80).aspx

http://msdn2.microsoft.com/en-us/library/364x0z75(VS.80).aspx

There is no Double in SQL Server so you have to use either Currency or Decimal or you may have to do conversion before sending the value to SQL Server. Try the link below for the SQL Server Types, ADO.NET types and .NET types. Hope this helps.

http://msdn2.microsoft.com/en-us/library/ms131092.aspx

|||

Caddre, thanks for the reply. That was a good link if you're doing SQLCLR stuff.

The Double SSAS datatype is equivalent to the float datatype in SQL Server. The Currency SSAS datatype is equivalent to the money datatype in SQL Server. Regardless, I'm not interested in SQL Server datatypes, just Analysis Services.

The question still remains, which datatype do you choose in SSAS if either will work: Currency or Double?

|||

Float is not a data type for persistence in any layer of SQL Server because of known precision issues in all programming languages. And my reply was related to your posted links which are clr related.

|||

Hi Furmangg,

If you have to store financial information in your cube and your database stores it as money(currency) you should definitely use currency data type for your mesures. Operations with the currency data type take less CPU power (no FPU calculations) and moreover will be better comressed by the storage engine.

Also if your information could be stored in currency data type (from -922,337,203,685,477.5808 to 922,337,203,685,477.5807) you schould take this type for your measures.

Best regards,

Vladimir Chtepa

|||

Thanks Vladimir. That's the answer I was looking for. I appreciate it.

Sunday, March 11, 2012

Currency $ sign.....

I have a column of salary that is in money datatype and i want to format it
so the $ shows up in my table'
Thanks
S.Please disregard...I better do this on the GUI side...;-)
"SMAN" <ksanti@.nycap.rr.com> wrote in message
news:OrChakxzDHA.832@.TK2MSFTNGP09.phx.gbl...
> I have a column of salary that is in money datatype and i want to format
it
> so the $ shows up in my table'
> Thanks
> S.
>|||You beat me to it, definitely something for the front end :-)
--
HTH
Jasper Smith (SQL Server MVP)
I support PASS - the definitive, global
community for SQL Server professionals -
http://www.sqlpass.org
"SMAN" <ksanti@.nycap.rr.com> wrote in message
news:%23qGNYqxzDHA.2056@.TK2MSFTNGP10.phx.gbl...
> Please disregard...I better do this on the GUI side...;-)
>
> "SMAN" <ksanti@.nycap.rr.com> wrote in message
> news:OrChakxzDHA.832@.TK2MSFTNGP09.phx.gbl...
> > I have a column of salary that is in money datatype and i want to format
> it
> > so the $ shows up in my table'
> >
> > Thanks
> >
> > S.
> >
> >
>

Friday, February 17, 2012

csv generation

hi
I want to generate excel file which contain table name , column name,datatype ,size
how we can do in sql server
is there any way
pleases tell the stepsI'm pretty sure DTS or SSMS can export in Excel format.

Or you can create a link directly to the database schema objects within Excel.|||SEe this http://codebetter.com/blogs/raymond.lewallen/archive/2005/05/04/62781.aspx blog.

CSV file..

I do have a csv file and I want to save the file into log table but I
wondernig that datatype would be text or image ? and after that I want to
fetch the data from that file and save it into different table.. can any let
me know what would be the best way to do this ?
Thanks in advance
Hi,
Do this activity using some programing language.. Visual studio . Net will
be a best option.
Thanks
hari
SQL Server MVP
"Noor" <noor@.istcl.com> wrote in message
news:ew0hil6tFHA.256@.tk2msftngp13.phx.gbl...
>I do have a csv file and I want to save the file into log table but I
>wondernig that datatype would be text or image ? and after that I want to
>fetch the data from that file and save it into different table.. can any
>let me know what would be the best way to do this ?
> Thanks in advance
>
|||Thanks HARI...
"Hari Prasad" <hari_prasad_k@.hotmail.com> wrote in message
news:u0I$TGAuFHA.3752@.TK2MSFTNGP09.phx.gbl...
> Hi,
> Do this activity using some programing language.. Visual studio . Net will
> be a best option.
> Thanks
> hari
> SQL Server MVP
> "Noor" <noor@.istcl.com> wrote in message
> news:ew0hil6tFHA.256@.tk2msftngp13.phx.gbl...
>
|||Thanks HARI......
"Hari Prasad" <hari_prasad_k@.hotmail.com> wrote in message
news:u0I$TGAuFHA.3752@.TK2MSFTNGP09.phx.gbl...
> Hi,
> Do this activity using some programing language.. Visual studio . Net will
> be a best option.
> Thanks
> hari
> SQL Server MVP
> "Noor" <noor@.istcl.com> wrote in message
> news:ew0hil6tFHA.256@.tk2msftngp13.phx.gbl...
>

Tuesday, February 14, 2012

CSV DeviceSettings in ReportServer.config dont take effect

I am using MS Reporting Services 2000 SP2 and I need help very urgently. my issue is that the user needs to view Text datatype columns exported to csv (basically, customer service support notes), but with the text fields in one cell. I changed the configuration settings of the CSV rendering extension as below, but but it didnt seem to make any difference. The report continues to export the csv in a haphazard format, with the newline characters in the notes spilling onto the next line, etc.

I also noticed that when I used ReportManager, the url request didnt have the rc:Encoding or rc:SuppressLineBreaks settings when I try to export the report to csv. I added these as a test in the url request directly and it worked just fine. I tried changing various settings, but none of them seem to take any effect. What am I missing here ?

I tried restarting the web server AND the ReportServer service. My config settings are as below. Also, my config file is located at:

C:\Program Files\Microsoft SQL Server\MSSQL\Reporting Services\ReportServer\RSReportServer.config

<Render>
... ... ...
... ... ...
<Extension Name="CSV" Type="Microsoft.ReportingServices.Rendering.CsvRenderer.CsvReport,Microsoft.ReportingServices.CsvRendering">
<Configuration>
<DeviceInfo>
<Encoding>ASCII</Encoding>
<SuppressLineBreaks>True</SuppressLineBreaks>
</DeviceInfo>
</Configuration>
</Extension>
</Render>

Any advice would be greatly appreciated. Thanks in advance.

I found the below information on another post.. Specifically, the thread "Export to an ASCII CSV" by Bruce L-C (MVP) on 4/19/2006. According to him, the settings (He speaks of only the encoding setting) work in RS 2000 only when passed in the URL explicitly. Setting it in the Config file does not have any effect in RS 2000, they are new for RS 2005.

http://msdn.microsoft.com/newsgroups/Default.aspx?query=device+settings+reporting+services&dg=&cat=en-us-msdn&lang=en&cr=US&pt=&catlist=774F24A2-F71F-425F-AC2B-DC48AB0DA5C9&dglist=&ptlist=&exp=&sloc=en-us

I hope someone can prove me wrong here.... I would love to figure out how to do this in RS 2000. Any advice would be highly appreciated. Thanks in advance.