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

Monday, March 12, 2012

Interactive sort has probs

Hi All,

I've designed a simple sales report , first grouped by Transport type and then by item.

Example

Category Item Sales

DHL A 2000

DHL C 1500

DHL E -1700

AmEx A 200

Amex E 20

-

when click on sales under group DHL it shouild sort -say descending-

so result should be

DHL A 2000

DHL C 1500

DHL E -1700

instead I get results

DHL A 2000

DHL E -1700

DHL C 1500

this is just an example but this is the sort of results I get when I try to use interactive sorting.

Any Ideas?

thanks

Sonny

Are you by any chance sorting on the Absolute value of the field? If so, it could be possible that the negative sign is being ignored and 1700 is being used to sort upon, instead of -1700.

Just a thought

-Aayush.

|||

thanks fo rthe reply Aayush. This could be the reason but why would it happen?

sonny

|||What Sort expression have you given under the Interactive Sort option for your textbox? Are you passing the field value as it is, or using some function there?|||

I'm not using any functions. Just passing the value as it is.

thanks'

Sonny

|||factoid:
did you know you can sort multiple cols in IE by holding down Shift when clicking on the little sort uppy downy jobbies?

Friday, March 9, 2012

intellisense for QA?

VB.NET (actually VS.NET) has a feature called Intellisense that will display
methods/properties for an object once you type a dot. For example:
Object1.
At that point, you may see a list similar to:
- Compare
- GetType
- Parse
- ToString
which you can choose. No memorization required. Is there a plug-in or
something for QA that will do the above? For example, I might join two
tables:
select us.column1, mm.column1
from dbo.summary us JOIN
dbo.message mm
ON us.
When I type us., I'd like to see all the fields in that table. Any
suggestions?
Thanks,
Brett> Is there a plug-in or
> something for QA that will do the above?
No. And the feature was dropped from the next version because T-SQL isn't
written and organized in a way that suits intellisense, the way a more
structured programming language is. If you type SELECT you might expect a
drop-down to appear with all of the built-in aggregate functions,
user-defined functions and every single column in all views and tables in
the entire database. The kind of metadata retrieval required for this just
didn't make sense...

> When I type us., I'd like to see all the fields in that table. Any
> suggestions?
Check out some of the other tools written for writing/modifying T-SQL,
though I've never heard of one that accomplishes this. The tools that ship
with SQL Server won't have this feature for a while (if ever)...|||There is no plug in for QA. This feature has also been dropped, currently,
from SQL 2005. I would look for a third party tool for running queries to
solve this problem.
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA
***************************
Think Outside the Box!
***************************
"Brett" wrote:

> VB.NET (actually VS.NET) has a feature called Intellisense that will displ
ay
> methods/properties for an object once you type a dot. For example:
> Object1.
> At that point, you may see a list similar to:
> - Compare
> - GetType
> - Parse
> - ToString
> which you can choose. No memorization required. Is there a plug-in or
> something for QA that will do the above? For example, I might join two
> tables:
> select us.column1, mm.column1
> from dbo.summary us JOIN
> dbo.message mm
> ON us.
> When I type us., I'd like to see all the fields in that table. Any
> suggestions?
> Thanks,
> Brett
>
>|||Brett wrote:
> VB.NET (actually VS.NET) has a feature called Intellisense that will
> display methods/properties for an object once you type a dot. For
> example:
> Object1.
> At that point, you may see a list similar to:
> - Compare
> - GetType
> - Parse
> - ToString
> which you can choose. No memorization required. Is there a plug-in
> or something for QA that will do the above? For example, I might
> join two tables:
> select us.column1, mm.column1
> from dbo.summary us JOIN
> dbo.message mm
> ON us.
> When I type us., I'd like to see all the fields in that table. Any
> suggestions?
> Thanks,
> Brett
Take a look at SQL IDE from Imceda. We offer autocomplete on objects.
14-day trial from web site.
David Gugick
Imceda Software
www.imceda.com|||Have a look at ApexSQL Edit (http://www.apexsql.com/). I bought this
some time ago and it's a pretty good product. Their support is very good
and you get free upgrades for ever, major and minor versions.
Regards,
William D. Bartholomew
http://blog.bartholomew.id.au
*** Sent via Developersdex http://www.examnotes.net ***|||We've added T-SQL Intellisense-like word-completion support for Visual
Studio 2003/2005 and the SQL Server 2005 Management Studio to our PromptSQL
product. So you can now have auto-completion for TSQL in those environments
and of course Query Analyzer.
SELECT * FROM Em[Ctrl-Space] displays a popup with all tables starting with
Em
SELECT * FROM Employees AS e JOIN [Ctrl-Space] shows a popup with all tables
related to the employees table (via primary/foreign keys)
SELECT * FROM Employees AS E JOIN Orders o on [Ctrl-Space] shows a popup
with possible joins based on primary/foreign keys on the tables in the FROM.
Press "." after a table name to get the columns in the table. It has proper
support for SQL Server 2005, which of course means prefixing table names
with schema names as appropriate.
Online demos and registration-free download: http://www.promptsql.com/
PromptSQL is written in C# and uses hooks to monitor Query Analyzer and the
other supported environments. You carry on using these standard tools.
Regards,
PromptSQL Team.
Brett wrote:
> VB.NET (actually VS.NET) has a feature called Intellisense that will
> display
> methods/properties for an object once you type a dot. For example:
> Object1.
> At that point, you may see a list similar to:
> - Compare
> - GetType
> - Parse
> - ToString
> which you can choose. No memorization required. Is there a plug-in or
> something for QA that will do the above? For example, I might join two
> tables:
> select us.column1, mm.column1
> from dbo.summary us JOIN
> dbo.message mm
> ON us.
> When I type us., I'd like to see all the fields in that table. Any
> suggestions?
> Thanks,
> Brett|||your product is way - however this is not the correct forum for these
types of post. Please post this in microsoft.public.sqlserver.tools.
Truly a fabulous product though.
Hilary Cotter
Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602.html
Looking for a FAQ on Indexing Services/SQL FTS
http://www.indexserverfaq.com
"Damian Mehers" <feedback at promptsql.com> wrote in message
news:O9hBnr1mFHA.3608@.TK2MSFTNGP15.phx.gbl...
> We've added T-SQL Intellisense-like word-completion support for Visual
> Studio 2003/2005 and the SQL Server 2005 Management Studio to our
PromptSQL
> product. So you can now have auto-completion for TSQL in those
environments
> and of course Query Analyzer.
> SELECT * FROM Em[Ctrl-Space] displays a popup with all tables starting
with
> Em
> SELECT * FROM Employees AS e JOIN [Ctrl-Space] shows a popup with all
tables
> related to the employees table (via primary/foreign keys)
> SELECT * FROM Employees AS E JOIN Orders o on [Ctrl-Space] shows a popup
> with possible joins based on primary/foreign keys on the tables in the
FROM.
> Press "." after a table name to get the columns in the table. It has
proper
> support for SQL Server 2005, which of course means prefixing table names
> with schema names as appropriate.
> Online demos and registration-free download: http://www.promptsql.com/
> PromptSQL is written in C# and uses hooks to monitor Query Analyzer and
the
> other supported environments. You carry on using these standard tools.
> Regards,
> PromptSQL Team.
>
>
> Brett wrote:
>

Friday, February 24, 2012

Integration Services Data Types Maximum Length

Hi,

Is there a way in-code to determine the maximum length of a Integration Services Data Type.

I need to determine based on the data type what the maximum length of a column is IN-CODE.

However, the column.Length property only gives me a length for DT_WSTR and DT_STR values. This is the only property that would seem to remotely give me the right answer.

I need to know the maximum lengths in columns for DT_BOOL, DT_CY, DT_I2, DT_I4, DT_I8, DT_NUMERIC, and DT_UI1. I can always hard-code these values into my program, but that makes no sense. There has to be some sort of way to determine what the maximum possible length of these values are.

For numeric values I could use the column.Precision value but that still leaves with with a lot of data types without a maximum length.
It might help if you explain why you want to know this information.

A DT_I4 is 4 bytes long, for instance, but it can hold -2,147,483,648 to 2,147,483,647. So which value do you want? Do you see the problem?

Data types are fixed in what they can handle, so why not just hard code them into your "IN-CODE"?|||In your example, for DT_I4, -2,147,483,648 is a length of 11 (excluding commas, but including the sign). Thats the kind of value I need to know. I apologize if I wasn't clear on that.

Well, yes, I could hard-code them. But I was wondering whether that type of information is actually stored (which really if you think about it, shouldn't be that difficult, and also worthwhile so a person does not have the compute what each one would be).

Hard-coding is something you also try to avoid if there is a way to avoid it (and hence my question as to whether I can avoid this or not).

Thanks

|||But that's just it, the length of a DT_I4 is 4, not 11.

The "length" of 11 is not stored anywhere. It's a limitation of the storage allocated to the data type. There are probably internal bounds checks, but I'm guessing they are not exposed. You could always try one of the many programming forums in MSDN to see if someone has an idea, as this really isn't an SSIS issue. SSIS data types are simply mapped to structures in .Net.

And the max length of a DT_STR is 8000 bytes. DT_WSTR is 4000 bytes. But more importantly, there is no such thing as a DT_STR, DT_I4, etc... in code. So what SSIS has as limitations may not be the same as the structures available in your code. (A DT_I4 equates to the Integer (Int32) structure.)|||

theddern wrote:

Hi,

Is there a way in-code to determine the maximum length of a Integration Services Data Type.

I need to determine based on the data type what the maximum length of a column is IN-CODE.

However, the column.Length property only gives me a length for DT_WSTR and DT_STR values. This is the only property that would seem to remotely give me the right answer.

I need to know the maximum lengths in columns for DT_BOOL, DT_CY, DT_I2, DT_I4, DT_I8, DT_NUMERIC, and DT_UI1. I can always hard-code these values into my program, but that makes no sense. There has to be some sort of way to determine what the maximum possible length of these values are.

For numeric values I could use the column.Precision value but that still leaves with with a lot of data types without a maximum length.

There is no maximum/minimum length for those data types. They are just what they are - they never change. The length simply isn't relevant.

-Jamie

|||

theddern wrote:

In your example, for DT_I4, -2,147,483,648 is a length of 11 (excluding commas, but including the sign).

No its not. The length of it is 4. 4 bytes that is.

If the value that you want is 11 then just cast it as a DT_STR and get the length of that.

-Jamie

|||So what you are saying is that I need to hard-code the lengths if I need to know those particular type of values?

|||

theddern wrote:

So what you are saying is that I need to hard-code the lengths if I need to know those particular type of values?

Yes! I just can't see the value in knowing the "lengths" of data types.|||And to clarify, I need to know what the maximum length (in characters) a particular column can be if that particular data was transfered to a command delimited flat file.

I was trying to figure that out based on IDTSColumn90.DataType because that would be the most logical place to start.
|||Are you wanting the display length for each data type?|||

theddern wrote:

And to clarify, I need to know what the maximum length (in characters) a particular column can be if that particular data was transfered to a command (sic) delimited flat file.

Why? If it is a delimited file, who cares?|||If he wanted to document specs for a fixed-length output file, he would find these useful. |||

theddern wrote:

So what you are saying is that I need to hard-code the lengths if I need to know those particular type of values?

No. I'm saying you don't need to care.

|||

Phil Brammer wrote:

theddern wrote:

And to clarify, I need to know what the maximum length (in characters) a particular column can be if that particular data was transfered to a command (sic) delimited flat file.

Why? If it is a delimited file, who cares?

Very very very good point.

This seems a very strange thing to want to do.

|||Yes