Showing posts with label output. Show all posts
Showing posts with label output. Show all posts

Monday, March 26, 2012

Is there a limit of 256 on CHAR data?

We are creating some VIEWS that concatenate columns for output to FIXED
LENGTH TEXT FILES - with FIXED LENGTH columns.
This is being done for various transmissions - W2 files to the SS Admin,
1099 files to the IRS, eligibility files to various health organizations.
While testing today, in Query Analyzer, it appeared that saying something
like:
Cast( Cast(col1 as char(10))+Cast(Col2 as char(15))...+Cast(Colnn as
char(10)) as char(280))
The 280 was not liked. In QA we could only see a single column of I'm
thinking around 256 bytes?
Does QA have a max size for column display in the grid?
QA->Menu-> Tools.. Options...Results tab. Maximum Characters per column
box. Adjust as necessary.
Geoff N. Hiten
Microsoft SQL Server MVP
Senior Database Administrator
Careerbuilder.com
I support the Professional Association for SQL Server
www.sqlpass.org
"Steve Z" <szlamany@.antarescomputing_no_spam.com> wrote in message
news:Om8MaQROEHA.2468@.TK2MSFTNGP11.phx.gbl...
> We are creating some VIEWS that concatenate columns for output to FIXED
> LENGTH TEXT FILES - with FIXED LENGTH columns.
> This is being done for various transmissions - W2 files to the SS Admin,
> 1099 files to the IRS, eligibility files to various health organizations.
> While testing today, in Query Analyzer, it appeared that saying something
> like:
> Cast( Cast(col1 as char(10))+Cast(Col2 as char(15))...+Cast(Colnn as
> char(10)) as char(280))
> The 280 was not liked. In QA we could only see a single column of I'm
> thinking around 256 bytes?
> Does QA have a max size for column display in the grid?
>
|||Steve,
Change the max number in Query analyzer 'tools' menu |options|'results' tab.
Dinesh
SQL Server MVP
--
SQL Server FAQ at
http://www.tkdinesh.com
"Steve Z" <szlamany@.antarescomputing_no_spam.com> wrote in message
news:Om8MaQROEHA.2468@.TK2MSFTNGP11.phx.gbl...
> We are creating some VIEWS that concatenate columns for output to FIXED
> LENGTH TEXT FILES - with FIXED LENGTH columns.
> This is being done for various transmissions - W2 files to the SS Admin,
> 1099 files to the IRS, eligibility files to various health organizations.
> While testing today, in Query Analyzer, it appeared that saying something
> like:
> Cast( Cast(col1 as char(10))+Cast(Col2 as char(15))...+Cast(Colnn as
> char(10)) as char(280))
> The 280 was not liked. In QA we could only see a single column of I'm
> thinking around 256 bytes?
> Does QA have a max size for column display in the grid?
>
|||> The 280 was not liked. In QA we could only see a single column of I'm
> thinking around 256 bytes?
http://www.aspfaq.com/2272
Aaron Bertrand
SQL Server MVP
http://www.aspfaq.com/
|||Thank you all very much - I was thinking I was crazy...
It worked like a charm.
"Dinesh T.K" <tkdinesh@.nospam.mail.tkdinesh.com> wrote in message
news:e8QpGWROEHA.2704@.TK2MSFTNGP10.phx.gbl...
> Steve,
> Change the max number in Query analyzer 'tools' menu |options|'results'
tab.[vbcol=seagreen]
> --
> Dinesh
> SQL Server MVP
> --
> --
> SQL Server FAQ at
> http://www.tkdinesh.com
> "Steve Z" <szlamany@.antarescomputing_no_spam.com> wrote in message
> news:Om8MaQROEHA.2468@.TK2MSFTNGP11.phx.gbl...
organizations.[vbcol=seagreen]
something
>

Is there a limit of 256 on CHAR data?

We are creating some VIEWS that concatenate columns for output to FIXED
LENGTH TEXT FILES - with FIXED LENGTH columns.
This is being done for various transmissions - W2 files to the SS Admin,
1099 files to the IRS, eligibility files to various health organizations.
While testing today, in Query Analyzer, it appeared that saying something
like:
Cast( Cast(col1 as char(10))+Cast(Col2 as char(15))...+Cast(Colnn as
char(10)) as char(280))
The 280 was not liked. In QA we could only see a single column of I'm
thinking around 256 bytes?
Does QA have a max size for column display in the grid?QA->Menu-> Tools.. Options...Results tab. Maximum Characters per column
box. Adjust as necessary.
Geoff N. Hiten
Microsoft SQL Server MVP
Senior Database Administrator
Careerbuilder.com
I support the Professional Association for SQL Server
www.sqlpass.org
"Steve Z" <szlamany@.antarescomputing_no_spam.com> wrote in message
news:Om8MaQROEHA.2468@.TK2MSFTNGP11.phx.gbl...
> We are creating some VIEWS that concatenate columns for output to FIXED
> LENGTH TEXT FILES - with FIXED LENGTH columns.
> This is being done for various transmissions - W2 files to the SS Admin,
> 1099 files to the IRS, eligibility files to various health organizations.
> While testing today, in Query Analyzer, it appeared that saying something
> like:
> Cast( Cast(col1 as char(10))+Cast(Col2 as char(15))...+Cast(Colnn as
> char(10)) as char(280))
> The 280 was not liked. In QA we could only see a single column of I'm
> thinking around 256 bytes?
> Does QA have a max size for column display in the grid?
>|||Steve,
Change the max number in Query analyzer 'tools' menu |options|'results' tab.
Dinesh
SQL Server MVP
--
--
SQL Server FAQ at
http://www.tkdinesh.com
"Steve Z" <szlamany@.antarescomputing_no_spam.com> wrote in message
news:Om8MaQROEHA.2468@.TK2MSFTNGP11.phx.gbl...
> We are creating some VIEWS that concatenate columns for output to FIXED
> LENGTH TEXT FILES - with FIXED LENGTH columns.
> This is being done for various transmissions - W2 files to the SS Admin,
> 1099 files to the IRS, eligibility files to various health organizations.
> While testing today, in Query Analyzer, it appeared that saying something
> like:
> Cast( Cast(col1 as char(10))+Cast(Col2 as char(15))...+Cast(Colnn as
> char(10)) as char(280))
> The 280 was not liked. In QA we could only see a single column of I'm
> thinking around 256 bytes?
> Does QA have a max size for column display in the grid?
>|||> The 280 was not liked. In QA we could only see a single column of I'm
> thinking around 256 bytes?
http://www.aspfaq.com/2272
Aaron Bertrand
SQL Server MVP
http://www.aspfaq.com/|||Thank you all very much - I was thinking I was crazy...
It worked like a charm.
"Dinesh T.K" <tkdinesh@.nospam.mail.tkdinesh.com> wrote in message
news:e8QpGWROEHA.2704@.TK2MSFTNGP10.phx.gbl...
> Steve,
> Change the max number in Query analyzer 'tools' menu |options|'results'
tab.
> --
> Dinesh
> SQL Server MVP
> --
> --
> SQL Server FAQ at
> http://www.tkdinesh.com
> "Steve Z" <szlamany@.antarescomputing_no_spam.com> wrote in message
> news:Om8MaQROEHA.2468@.TK2MSFTNGP11.phx.gbl...
organizations.[vbcol=seagreen]
something[vbcol=seagreen]
>sql

Is there a limit of 256 on CHAR data?

We are creating some VIEWS that concatenate columns for output to FIXED
LENGTH TEXT FILES - with FIXED LENGTH columns.
This is being done for various transmissions - W2 files to the SS Admin,
1099 files to the IRS, eligibility files to various health organizations.
While testing today, in Query Analyzer, it appeared that saying something
like:
Cast( Cast(col1 as char(10))+Cast(Col2 as char(15))...+Cast(Colnn as
char(10)) as char(280))
The 280 was not liked. In QA we could only see a single column of I'm
thinking around 256 bytes?
Does QA have a max size for column display in the grid?QA->Menu-> Tools.. Options...Results tab. Maximum Characters per column
box. Adjust as necessary.
--
Geoff N. Hiten
Microsoft SQL Server MVP
Senior Database Administrator
Careerbuilder.com
I support the Professional Association for SQL Server
www.sqlpass.org
"Steve Z" <szlamany@.antarescomputing_no_spam.com> wrote in message
news:Om8MaQROEHA.2468@.TK2MSFTNGP11.phx.gbl...
> We are creating some VIEWS that concatenate columns for output to FIXED
> LENGTH TEXT FILES - with FIXED LENGTH columns.
> This is being done for various transmissions - W2 files to the SS Admin,
> 1099 files to the IRS, eligibility files to various health organizations.
> While testing today, in Query Analyzer, it appeared that saying something
> like:
> Cast( Cast(col1 as char(10))+Cast(Col2 as char(15))...+Cast(Colnn as
> char(10)) as char(280))
> The 280 was not liked. In QA we could only see a single column of I'm
> thinking around 256 bytes?
> Does QA have a max size for column display in the grid?
>|||Steve,
Change the max number in Query analyzer 'tools' menu |options|'results' tab.
--
Dinesh
SQL Server MVP
--
--
SQL Server FAQ at
http://www.tkdinesh.com
"Steve Z" <szlamany@.antarescomputing_no_spam.com> wrote in message
news:Om8MaQROEHA.2468@.TK2MSFTNGP11.phx.gbl...
> We are creating some VIEWS that concatenate columns for output to FIXED
> LENGTH TEXT FILES - with FIXED LENGTH columns.
> This is being done for various transmissions - W2 files to the SS Admin,
> 1099 files to the IRS, eligibility files to various health organizations.
> While testing today, in Query Analyzer, it appeared that saying something
> like:
> Cast( Cast(col1 as char(10))+Cast(Col2 as char(15))...+Cast(Colnn as
> char(10)) as char(280))
> The 280 was not liked. In QA we could only see a single column of I'm
> thinking around 256 bytes?
> Does QA have a max size for column display in the grid?
>|||> The 280 was not liked. In QA we could only see a single column of I'm
> thinking around 256 bytes?
http://www.aspfaq.com/2272
--
Aaron Bertrand
SQL Server MVP
http://www.aspfaq.com/|||Thank you all very much - I was thinking I was crazy...
It worked like a charm.
"Dinesh T.K" <tkdinesh@.nospam.mail.tkdinesh.com> wrote in message
news:e8QpGWROEHA.2704@.TK2MSFTNGP10.phx.gbl...
> Steve,
> Change the max number in Query analyzer 'tools' menu |options|'results'
tab.
> --
> Dinesh
> SQL Server MVP
> --
> --
> SQL Server FAQ at
> http://www.tkdinesh.com
> "Steve Z" <szlamany@.antarescomputing_no_spam.com> wrote in message
> news:Om8MaQROEHA.2468@.TK2MSFTNGP11.phx.gbl...
> > We are creating some VIEWS that concatenate columns for output to FIXED
> > LENGTH TEXT FILES - with FIXED LENGTH columns.
> >
> > This is being done for various transmissions - W2 files to the SS Admin,
> > 1099 files to the IRS, eligibility files to various health
organizations.
> >
> > While testing today, in Query Analyzer, it appeared that saying
something
> > like:
> >
> > Cast( Cast(col1 as char(10))+Cast(Col2 as char(15))...+Cast(Colnn as
> > char(10)) as char(280))
> >
> > The 280 was not liked. In QA we could only see a single column of I'm
> > thinking around 256 bytes?
> >
> > Does QA have a max size for column display in the grid?
> >
> >
>

Is there a function that returns the name of the executing sproc?

Greetings,

I've got a stored procedure that returns execution feedback information through OUTPUT parameters. One of the parameters contains the name of the stored procedure.

I'd like to be able to derive the name of a stored procedure without hard-coding it, which I obviously could do. I'm wondering if there is a system function or another approach that would allow me to grab the procedure name on the fly. I've got many procedures that are doing the same thing so I want to generalize this common code as much as possible.

Ideally, I would like something like this:

SET @.ProcedureName = GETPROCEDURENAME()

Thanks,

BCB

yes..

SET @.ProcedureName = object_name(@.@.ProcID)

Wednesday, March 21, 2012

is that possible to prevent modifying the name of an IDTSInputColumn90?

Hi,

I'm building a custom SSIS data flow component and I create myself input and output columns from a custom property of my pipeline component. That's why I don't want the user to modify the name of the input and output columns by using the advanced editor.

Is there a way either to make input/output column properties - at least the name - readonly or to override any PipelineComponent method to throw an exception like we do when we want to prevent the user from adding/removing input/output colulmns with methods like PipelineComponent.DeleteOutputColumn?

Thanks for your help,

David

Have you tried SetInputColumnProperty? The name is a property, but I have vague recollection that you cannot use that method to set the name, and end up having to do it on the IDTSInputColumn90 reference directly.

Can you detect a change, and pick this up in Validate? If you can detect a change you could return VS_NEEDSNEWMETADATA, and then correct the problem in ReinitializeMetaData. Not as proactive as preventing a change, but maybe it is better than nothing?

|||

I've tried SetInputColumnProperty but it is called only for custom properties...and the name is not a custom property.

I any case, like you said, when the user modifies the name of an input column, Validate is called and I can detect the error...

Thanks

Friday, February 24, 2012

IS NULL not working

Hi I am trying to do this on a temp table
DELETE FROM #output where [tst1] is NULL
this for some reason doesnt seem to work.
on the other hand when i do the below
insert into db_comp
select tst1, tst2,tst3 from #output
where tst1 is not null
seems to work. does anyone know why this is happening.
regards,
njPlease elaborate on "doesn't seem to work". Are there errors? Are you certai
n
there are rows in the table that correspond to the criteria in the WHERE
clause?
ML
http://milambda.blogspot.com/|||NJ skrev:

> Hi I am trying to do this on a temp table
> DELETE FROM #output where [tst1] is NULL
> this for some reason doesnt seem to work.
> on the other hand when i do the below
> insert into db_comp
> select tst1, tst2,tst3 from #output
> where tst1 is not null
> seems to work. does anyone know why this is happening.
> regards,
> nj
As ML wrote, you need to explain how the above does not work...
To me it looks consistent with #output having no rows where tst1 is
NULL (if by 'not working' you mean the first statement didn't delete
anything)...
/impslayer, aka Birger Johansson|||Here you are using IS NULL
Tony Rogerson
SQL Server MVP
http://sqlserverfaq.com - free video tutorials
"NJ" <npaulus@.hotmail.com> wrote in message
news:1147766869.501289.38100@.g10g2000cwb.googlegroups.com...
> Hi I am trying to do this on a temp table
> DELETE FROM #output where [tst1] is NULL
> this for some reason doesnt seem to work.
> on the other hand when i do the below
> insert into db_comp
> select tst1, tst2,tst3 from #output
> where tst1 is not null
> seems to work. does anyone know why this is happening.
> regards,
> nj
>|||Here you are using IS NULL

> DELETE FROM #output where [tst1] is NULL
Here you are using IS NOT NULL

> select tst1, tst2,tst3 from #output
> where tst1 is not null
They are mutually exclusive.
If SELECT * FROM #output WHERE [tst1] IS NULL returns no rows then it won't
delete any.
Sorry about the part post on the other answer, I hit enter and something
else which so happens to be the short cut to posting the post!
Tony/.
Tony Rogerson
SQL Server MVP
http://sqlserverfaq.com - free video tutorials
"NJ" <npaulus@.hotmail.com> wrote in message
news:1147766869.501289.38100@.g10g2000cwb.googlegroups.com...
> Hi I am trying to do this on a temp table
> DELETE FROM #output where [tst1] is NULL
> this for some reason doesnt seem to work.
> on the other hand when i do the below
> insert into db_comp
> select tst1, tst2,tst3 from #output
> where tst1 is not null
> seems to work. does anyone know why this is happening.
> regards,
> nj
>|||Tony Rogerson (tonyrogerson@.sqlserverfaq.com) writes:
> Sorry about the part post on the other answer, I hit enter and something
> else which so happens to be the short cut to posting the post!
CTRL-Enter is a shortcut for Send in Outlook, and I believe in Outlook
Express (that I see that you are using).
Now, is that a really stupid keyboard shortcut or what!
Myself, I'm go to press F8 now. :-)
Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se
Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/pr...oads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodin...ions/books.mspx|||I know Erland, dam stupid.
I seem to do it every now and again, but after doing it once i always do it
again - so, expect some half posts from me today...
tony.
Tony Rogerson
SQL Server MVP
http://sqlserverfaq.com - free video tutorials
"Erland Sommarskog" <esquel@.sommarskog.se> wrote in message
news:Xns97C57FAA43A96Yazorman@.127.0.0.1...
> Tony Rogerson (tonyrogerson@.sqlserverfaq.com) writes:
> CTRL-Enter is a shortcut for Send in Outlook, and I believe in Outlook
> Express (that I see that you are using).
> Now, is that a really stupid keyboard shortcut or what!
> Myself, I'm go to press F8 now. :-)
> --
> Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se
> Books Online for SQL Server 2005 at
> http://www.microsoft.com/technet/pr...oads/books.mspx
> Books Online for SQL Server 2000 at
> http://www.microsoft.com/sql/prodin...ions/books.mspx|||The first statement the delete statement doesnt delete anything. let me
put this more into perspective
part 1:
DELETE FROM #output where [tst1] is NULL
Insert into db_comp
select * from #output
part 2:
insert into db_comp
select tst1, tst2,tst3 from #output
where tst1 is not null|||NJ skrev:

> The first statement the delete statement doesnt delete anything. let me
> put this more into perspective
> part 1:
> DELETE FROM #output where [tst1] is NULL
> Insert into db_comp
> select * from #output
> part 2:
> insert into db_comp
> select tst1, tst2,tst3 from #output
> where tst1 is not null
/me scratches his head.
You use "is null" for the delete statement, but "is not null" for that
second part... If there are no rows in #output with tst1 being NULL,
then it shouldn't delete anything.
In part 2, OTOH, you select (and insert those) rows where tst1 is NOT
NULL, that is, the rows that you weren't trying to delete in the first
statement.
/impslayer, aka Birger Johansson|||Hi NJ,
How many rows does this return?
SELECT * FROM #output where [tst1] is NULL
Tony Rogerson
SQL Server MVP
http://sqlserverfaq.com - free video tutorials
"NJ" <npaulus@.hotmail.com> wrote in message
news:1147780233.453202.150570@.v46g2000cwv.googlegroups.com...
> The first statement the delete statement doesnt delete anything. let me
> put this more into perspective
> part 1:
> DELETE FROM #output where [tst1] is NULL
> Insert into db_comp
> select * from #output
> part 2:
> insert into db_comp
> select tst1, tst2,tst3 from #output
> where tst1 is not null
>