Showing posts with label changing. Show all posts
Showing posts with label changing. Show all posts

Sunday, March 25, 2012

Derived Column

How do i change the data type of a column using the derived column feature?
I have two columns that need changing
(a) needs to be changed to an integer
(b) needs to be changed to a date
Both columns contain balnks and spaces!
Realise i could do this using a view but is it best practice to change the
data types before they get into the Database
Milk Bottle> Realise i could do this using a view but is it best practice to change the
> data types before they get into the Database
Good idea. One of the main purposes of SSIS is to scrub data before it is
loaded.

> I have two columns that need changing
> (a) needs to be changed to an integer
> (b) needs to be changed to a date
One method is with 4 Derived Column transformations, 2 for the integer and 2
for the datetime. The first transformation of each pair attempts to convert
the input to the appropriate datatype and the second transformation assigns
a default value if a conversion error occurs. To do this:
Create 2 new derived column transforms for the integer field and specify
expression as (DT_I4)[YourIntegerData] in the first transformation. Con
nect
that derived column output path to a new Union All and the derived column
error path (redirect row) to the second transformation that specifies your
desired default value (e.g. (DT_I4)0). Connect that derived column output
path to the same union all as the first transformation so that all records
are processed and contain valid integer values.
Repeat the above process for the datetime field with the union all output of
the integer transforms connected to a derived column with expression
(DT_DBTIMESTAMP)[YourDateTimeData]. The output of the second union all
will
then contain only valid integer and datetime values.
Hope this helps.
Dan Guzman
SQL Server MVP
"MilkBottle" <MilkBottle@.discussions.microsoft.com> wrote in message
news:488C7D26-B9A6-43F8-BB9D-596EF19B2517@.microsoft.com...
> How do i change the data type of a column using the derived column
> feature?
> I have two columns that need changing
> (a) needs to be changed to an integer
> (b) needs to be changed to a date
> Both columns contain balnks and spaces!
> Realise i could do this using a view but is it best practice to change the
> data types before they get into the Database
>
>
> --
> Milk Bottle|||Dan
Thank you very very much...it worked a treat.
Thanks for taking the time to post a reply.
Milk Bottle
"Dan Guzman" wrote:

> Good idea. One of the main purposes of SSIS is to scrub data before it is
> loaded.
>
> One method is with 4 Derived Column transformations, 2 for the integer and
2
> for the datetime. The first transformation of each pair attempts to conve
rt
> the input to the appropriate datatype and the second transformation assign
s
> a default value if a conversion error occurs. To do this:
> Create 2 new derived column transforms for the integer field and specify
> expression as (DT_I4)[YourIntegerData] in the first transformation. C
onnect
> that derived column output path to a new Union All and the derived column
> error path (redirect row) to the second transformation that specifies your
> desired default value (e.g. (DT_I4)0). Connect that derived column output
> path to the same union all as the first transformation so that all records
> are processed and contain valid integer values.
> Repeat the above process for the datetime field with the union all output
of
> the integer transforms connected to a derived column with expression
> (DT_DBTIMESTAMP)[YourDateTimeData]. The output of the second union al
l will
> then contain only valid integer and datetime values.
>
> --
> Hope this helps.
> Dan Guzman
> SQL Server MVP
> "MilkBottle" <MilkBottle@.discussions.microsoft.com> wrote in message
> news:488C7D26-B9A6-43F8-BB9D-596EF19B2517@.microsoft.com...
>|||I'm glad I was able to help you out.
Dan Guzman
SQL Server MVP
"MilkBottle" <MilkBottle@.discussions.microsoft.com> wrote in message
news:3FAD3449-D418-46FB-83CC-1ED98F1A6F1C@.microsoft.com...[vbcol=seagreen]
> Dan
> Thank you very very much...it worked a treat.
> Thanks for taking the time to post a reply.
> --
> Milk Bottle
>
> "Dan Guzman" wrote:
>

Derived Column

How do i change the data type of a column using the derived column feature?
I have two columns that need changing
(a) needs to be changed to an integer
(b) needs to be changed to a date
Both columns contain balnks and spaces!
Realise i could do this using a view but is it best practice to change the
data types before they get into the Database
--
Milk Bottle> Realise i could do this using a view but is it best practice to change the
> data types before they get into the Database
Good idea. One of the main purposes of SSIS is to scrub data before it is
loaded.
> I have two columns that need changing
> (a) needs to be changed to an integer
> (b) needs to be changed to a date
One method is with 4 Derived Column transformations, 2 for the integer and 2
for the datetime. The first transformation of each pair attempts to convert
the input to the appropriate datatype and the second transformation assigns
a default value if a conversion error occurs. To do this:
Create 2 new derived column transforms for the integer field and specify
expression as (DT_I4)[YourIntegerData] in the first transformation. Connect
that derived column output path to a new Union All and the derived column
error path (redirect row) to the second transformation that specifies your
desired default value (e.g. (DT_I4)0). Connect that derived column output
path to the same union all as the first transformation so that all records
are processed and contain valid integer values.
Repeat the above process for the datetime field with the union all output of
the integer transforms connected to a derived column with expression
(DT_DBTIMESTAMP)[YourDateTimeData]. The output of the second union all will
then contain only valid integer and datetime values.
Hope this helps.
Dan Guzman
SQL Server MVP
"MilkBottle" <MilkBottle@.discussions.microsoft.com> wrote in message
news:488C7D26-B9A6-43F8-BB9D-596EF19B2517@.microsoft.com...
> How do i change the data type of a column using the derived column
> feature?
> I have two columns that need changing
> (a) needs to be changed to an integer
> (b) needs to be changed to a date
> Both columns contain balnks and spaces!
> Realise i could do this using a view but is it best practice to change the
> data types before they get into the Database
>
>
> --
> Milk Bottle|||Dan
Thank you very very much...it worked a treat.
Thanks for taking the time to post a reply.
--
Milk Bottle
"Dan Guzman" wrote:
> > Realise i could do this using a view but is it best practice to change the
> > data types before they get into the Database
> Good idea. One of the main purposes of SSIS is to scrub data before it is
> loaded.
> > I have two columns that need changing
> > (a) needs to be changed to an integer
> > (b) needs to be changed to a date
> One method is with 4 Derived Column transformations, 2 for the integer and 2
> for the datetime. The first transformation of each pair attempts to convert
> the input to the appropriate datatype and the second transformation assigns
> a default value if a conversion error occurs. To do this:
> Create 2 new derived column transforms for the integer field and specify
> expression as (DT_I4)[YourIntegerData] in the first transformation. Connect
> that derived column output path to a new Union All and the derived column
> error path (redirect row) to the second transformation that specifies your
> desired default value (e.g. (DT_I4)0). Connect that derived column output
> path to the same union all as the first transformation so that all records
> are processed and contain valid integer values.
> Repeat the above process for the datetime field with the union all output of
> the integer transforms connected to a derived column with expression
> (DT_DBTIMESTAMP)[YourDateTimeData]. The output of the second union all will
> then contain only valid integer and datetime values.
>
> --
> Hope this helps.
> Dan Guzman
> SQL Server MVP
> "MilkBottle" <MilkBottle@.discussions.microsoft.com> wrote in message
> news:488C7D26-B9A6-43F8-BB9D-596EF19B2517@.microsoft.com...
> >
> > How do i change the data type of a column using the derived column
> > feature?
> > I have two columns that need changing
> > (a) needs to be changed to an integer
> > (b) needs to be changed to a date
> > Both columns contain balnks and spaces!
> >
> > Realise i could do this using a view but is it best practice to change the
> > data types before they get into the Database
> >
> >
> >
> >
> >
> > --
> > Milk Bottle
>|||I'm glad I was able to help you out.
--
Dan Guzman
SQL Server MVP
"MilkBottle" <MilkBottle@.discussions.microsoft.com> wrote in message
news:3FAD3449-D418-46FB-83CC-1ED98F1A6F1C@.microsoft.com...
> Dan
> Thank you very very much...it worked a treat.
> Thanks for taking the time to post a reply.
> --
> Milk Bottle
>
> "Dan Guzman" wrote:
>> > Realise i could do this using a view but is it best practice to change
>> > the
>> > data types before they get into the Database
>> Good idea. One of the main purposes of SSIS is to scrub data before it
>> is
>> loaded.
>> > I have two columns that need changing
>> > (a) needs to be changed to an integer
>> > (b) needs to be changed to a date
>> One method is with 4 Derived Column transformations, 2 for the integer
>> and 2
>> for the datetime. The first transformation of each pair attempts to
>> convert
>> the input to the appropriate datatype and the second transformation
>> assigns
>> a default value if a conversion error occurs. To do this:
>> Create 2 new derived column transforms for the integer field and specify
>> expression as (DT_I4)[YourIntegerData] in the first transformation.
>> Connect
>> that derived column output path to a new Union All and the derived column
>> error path (redirect row) to the second transformation that specifies
>> your
>> desired default value (e.g. (DT_I4)0). Connect that derived column
>> output
>> path to the same union all as the first transformation so that all
>> records
>> are processed and contain valid integer values.
>> Repeat the above process for the datetime field with the union all output
>> of
>> the integer transforms connected to a derived column with expression
>> (DT_DBTIMESTAMP)[YourDateTimeData]. The output of the second union all
>> will
>> then contain only valid integer and datetime values.
>>
>> --
>> Hope this helps.
>> Dan Guzman
>> SQL Server MVP
>> "MilkBottle" <MilkBottle@.discussions.microsoft.com> wrote in message
>> news:488C7D26-B9A6-43F8-BB9D-596EF19B2517@.microsoft.com...
>> >
>> > How do i change the data type of a column using the derived column
>> > feature?
>> > I have two columns that need changing
>> > (a) needs to be changed to an integer
>> > (b) needs to be changed to a date
>> > Both columns contain balnks and spaces!
>> >
>> > Realise i could do this using a view but is it best practice to change
>> > the
>> > data types before they get into the Database
>> >
>> >
>> >
>> >
>> >
>> > --
>> > Milk Bottlesql

Derived Column

How do i change the data type of a column using the derived column feature?
I have two columns that need changing
(a) needs to be changed to an integer
(b) needs to be changed to a date
Both columns contain balnks and spaces!
Realise i could do this using a view but is it best practice to change the
data types before they get into the Database
Milk Bottle
> Realise i could do this using a view but is it best practice to change the
> data types before they get into the Database
Good idea. One of the main purposes of SSIS is to scrub data before it is
loaded.

> I have two columns that need changing
> (a) needs to be changed to an integer
> (b) needs to be changed to a date
One method is with 4 Derived Column transformations, 2 for the integer and 2
for the datetime. The first transformation of each pair attempts to convert
the input to the appropriate datatype and the second transformation assigns
a default value if a conversion error occurs. To do this:
Create 2 new derived column transforms for the integer field and specify
expression as (DT_I4)[YourIntegerData] in the first transformation. Connect
that derived column output path to a new Union All and the derived column
error path (redirect row) to the second transformation that specifies your
desired default value (e.g. (DT_I4)0). Connect that derived column output
path to the same union all as the first transformation so that all records
are processed and contain valid integer values.
Repeat the above process for the datetime field with the union all output of
the integer transforms connected to a derived column with expression
(DT_DBTIMESTAMP)[YourDateTimeData]. The output of the second union all will
then contain only valid integer and datetime values.
Hope this helps.
Dan Guzman
SQL Server MVP
"MilkBottle" <MilkBottle@.discussions.microsoft.com> wrote in message
news:488C7D26-B9A6-43F8-BB9D-596EF19B2517@.microsoft.com...
> How do i change the data type of a column using the derived column
> feature?
> I have two columns that need changing
> (a) needs to be changed to an integer
> (b) needs to be changed to a date
> Both columns contain balnks and spaces!
> Realise i could do this using a view but is it best practice to change the
> data types before they get into the Database
>
>
> --
> Milk Bottle
|||Dan
Thank you very very much...it worked a treat.
Thanks for taking the time to post a reply.
Milk Bottle
"Dan Guzman" wrote:

> Good idea. One of the main purposes of SSIS is to scrub data before it is
> loaded.
>
> One method is with 4 Derived Column transformations, 2 for the integer and 2
> for the datetime. The first transformation of each pair attempts to convert
> the input to the appropriate datatype and the second transformation assigns
> a default value if a conversion error occurs. To do this:
> Create 2 new derived column transforms for the integer field and specify
> expression as (DT_I4)[YourIntegerData] in the first transformation. Connect
> that derived column output path to a new Union All and the derived column
> error path (redirect row) to the second transformation that specifies your
> desired default value (e.g. (DT_I4)0). Connect that derived column output
> path to the same union all as the first transformation so that all records
> are processed and contain valid integer values.
> Repeat the above process for the datetime field with the union all output of
> the integer transforms connected to a derived column with expression
> (DT_DBTIMESTAMP)[YourDateTimeData]. The output of the second union all will
> then contain only valid integer and datetime values.
>
> --
> Hope this helps.
> Dan Guzman
> SQL Server MVP
> "MilkBottle" <MilkBottle@.discussions.microsoft.com> wrote in message
> news:488C7D26-B9A6-43F8-BB9D-596EF19B2517@.microsoft.com...
>
|||I'm glad I was able to help you out.
Dan Guzman
SQL Server MVP
"MilkBottle" <MilkBottle@.discussions.microsoft.com> wrote in message
news:3FAD3449-D418-46FB-83CC-1ED98F1A6F1C@.microsoft.com...[vbcol=seagreen]
> Dan
> Thank you very very much...it worked a treat.
> Thanks for taking the time to post a reply.
> --
> Milk Bottle
>
> "Dan Guzman" wrote:

Saturday, February 25, 2012

Deploy to Server or Open from Server doesn't work

Sometimes when a report is deployed after changes, the changes do not show up
on the Reporting Server, however the changes do show up in VS. Changing the
report and deploying again have no affect on the displayed report.
Also, sometimes a report will display one way on the server, but be a
completely different version in VS, what can be done to stop this behavior?After you deploy you show shut down IE and open up a new instance of IE.
One of the things you are seeing is a caching issue.
As far as it looking different, I haven't seen that. What I have seen is
bugs present in VS that are not there in the production environment. So if I
have something weird occur with the preview I always deploy and see if the
problem still shows itself.
Bruce Loehle-Conger
MVP SQL Server Reporting Services
"Alec Hardy" <Alec Hardy@.discussions.microsoft.com> wrote in message
news:56CEB137-0768-46A6-805D-258C3D970403@.microsoft.com...
> Sometimes when a report is deployed after changes, the changes do not show
> up
> on the Reporting Server, however the changes do show up in VS. Changing
> the
> report and deploying again have no affect on the displayed report.
> Also, sometimes a report will display one way on the server, but be a
> completely different version in VS, what can be done to stop this
> behavior?|||Tried shuting down IE and reopening, then viewing the report again, same thing.
Interesting thing is that when I export to PDF, the report looks fine,
exactly what I'm seeing in visual studio, however from inside report manager,
not good.
Problem is alignment in the Page header of the report name and Date Time.
"Bruce L-C [MVP]" wrote:
> After you deploy you show shut down IE and open up a new instance of IE.
> One of the things you are seeing is a caching issue.
> As far as it looking different, I haven't seen that. What I have seen is
> bugs present in VS that are not there in the production environment. So if I
> have something weird occur with the preview I always deploy and see if the
> problem still shows itself.
>
> --
> Bruce Loehle-Conger
> MVP SQL Server Reporting Services
>
> "Alec Hardy" <Alec Hardy@.discussions.microsoft.com> wrote in message
> news:56CEB137-0768-46A6-805D-258C3D970403@.microsoft.com...
> > Sometimes when a report is deployed after changes, the changes do not show
> > up
> > on the Reporting Server, however the changes do show up in VS. Changing
> > the
> > report and deploying again have no affect on the displayed report.
> >
> > Also, sometimes a report will display one way on the server, but be a
> > completely different version in VS, what can be done to stop this
> > behavior?
>
>|||As a follow up to my previous post, I found that having overlaping text boxes
will cause the text boxes to wrap and not follow the alignment that set up in
VS. This is apparently only true for viewing the report in Report Manager,
as it will look fine when exported.
"Alec Hardy" wrote:
> Tried shuting down IE and reopening, then viewing the report again, same thing.
> Interesting thing is that when I export to PDF, the report looks fine,
> exactly what I'm seeing in visual studio, however from inside report manager,
> not good.
> Problem is alignment in the Page header of the report name and Date Time.
> "Bruce L-C [MVP]" wrote:
> > After you deploy you show shut down IE and open up a new instance of IE.
> > One of the things you are seeing is a caching issue.
> >
> > As far as it looking different, I haven't seen that. What I have seen is
> > bugs present in VS that are not there in the production environment. So if I
> > have something weird occur with the preview I always deploy and see if the
> > problem still shows itself.
> >
> >
> > --
> > Bruce Loehle-Conger
> > MVP SQL Server Reporting Services
> >
> >
> >
> > "Alec Hardy" <Alec Hardy@.discussions.microsoft.com> wrote in message
> > news:56CEB137-0768-46A6-805D-258C3D970403@.microsoft.com...
> > > Sometimes when a report is deployed after changes, the changes do not show
> > > up
> > > on the Reporting Server, however the changes do show up in VS. Changing
> > > the
> > > report and deploying again have no affect on the displayed report.
> > >
> > > Also, sometimes a report will display one way on the server, but be a
> > > completely different version in VS, what can be done to stop this
> > > behavior?
> >
> >
> >|||Sorry, don't have any suggestions. I have never seen it be worse deployed, I
have always had the opposite problem.
--
Bruce Loehle-Conger
MVP SQL Server Reporting Services
"Alec Hardy" <AlecHardy@.discussions.microsoft.com> wrote in message
news:4D158749-13A8-4A4F-8AED-7BF94285BB64@.microsoft.com...
> Tried shuting down IE and reopening, then viewing the report again, same
thing.
> Interesting thing is that when I export to PDF, the report looks fine,
> exactly what I'm seeing in visual studio, however from inside report
manager,
> not good.
> Problem is alignment in the Page header of the report name and Date Time.
> "Bruce L-C [MVP]" wrote:
> > After you deploy you show shut down IE and open up a new instance of
IE.
> > One of the things you are seeing is a caching issue.
> >
> > As far as it looking different, I haven't seen that. What I have seen is
> > bugs present in VS that are not there in the production environment. So
if I
> > have something weird occur with the preview I always deploy and see if
the
> > problem still shows itself.
> >
> >
> > --
> > Bruce Loehle-Conger
> > MVP SQL Server Reporting Services
> >
> >
> >
> > "Alec Hardy" <Alec Hardy@.discussions.microsoft.com> wrote in message
> > news:56CEB137-0768-46A6-805D-258C3D970403@.microsoft.com...
> > > Sometimes when a report is deployed after changes, the changes do not
show
> > > up
> > > on the Reporting Server, however the changes do show up in VS.
Changing
> > > the
> > > report and deploying again have no affect on the displayed report.
> > >
> > > Also, sometimes a report will display one way on the server, but be a
> > > completely different version in VS, what can be done to stop this
> > > behavior?
> >
> >
> >