Showing posts with label number. Show all posts
Showing posts with label number. Show all posts

Tuesday, March 27, 2012

Changing Column size/type with Derived Column

I have a number of date columns that are parsed as DT_WSTR (6) and I have written a Derived Column converting them into DT_DATE via this (found on the forums) type expression:
(DT_DATE)(SUBSTRING(Date,6,2) + "-" + SUBSTRING(Date,8,2) + "-" + SUBSTRING(Date,1,5))
But I really want to replace the current column, not create a new one. If I use "replace" the data is forced to be a DT_WSTR (6), and I get a truncation error at run-time.
Simeon
Simeon,
You're stuck with it I'm afraid. You can't change the type of a column in the derived column component. Its not a ahrdship to add it as a new column though, jsut don't use the existing one that's all!

-Jamie|||Could you change the source to return a larger column. This would solve your problem.|||Cheers Jamie,
That's what I thought, I was just hoping there was a way to keep it "clean".
On a related thought, I am finding that each time I alter any component near the top of a data flow, I end up needing to delete and re-add most the down stream components due to fields mismatching. Is this why people appear to be building there packages via code?
Simeon.
|||This does depend on the component, some just need double clicking on and the meta data should correct it self, others require you to select the mapped columns. The latter is generally when you change the names of components and inputs.

You shouldn't have to delete components though, I find that surprising.|||

SimonSa wrote:

Could you change the source to return a larger column. This would solve your problem.


That might work, but the derived column sets the type to DT_WSTR, so I'm not sure that putting a entry that is cast to DT_DATE would not upset it also.
|||

I was finding this while I was developing my source component. I had it wired to Raw Files (then later Trash Destinations) with Data Viewers to inspect the data. Running the package (after reloading BI) would give errors, so I found it easier to delete the source and it four outputs, and re-wire.
But going forward I'll try double clicking, and checking the mappings.

Simeon
|||Do you need to cast it to a date? If you do then you will have to have a new column, and the derived column is the best solution|||I would suggest your source component is recreating outputs when it shouldn't. Thus the metadata the downstream components are based on is no longer valid.|||

SimonSa wrote:

I would suggest your source component is recreating outputs when it shouldn't. Thus the metadata the downstream components are based on is no longer valid.


It was. I was slowly adding support for different data types, then adding support for foreign keys. The source component is like a flat file parser, but it handles files that have different rows (with different columns) that have relationships based on order. So really n tables with the foreign keys implied by what a row follows.
I was (for simplicity) developing support incrementally, with the relations setup by a function. The next step is to put that information into a configuration file.
|||A column is identified by it's lineage Id. Deleteing a column and adding it back, even with the same name and same data type properties will cause it to change lineage Id. This means downstream components that have referenced that column (by lineage Id) are now invalid. Opening the UI should bring up the mapping dialog, and one of the options is Map by Name. This normally solves most issues.

A well behaved component will not recreate the output buffer columns each time, but rather detect invalid columns, and remove, add new columns if required, and fix any columns in can detect on both sides, or leave alone matching columns. This can be a pain, as it is lots more code, but try the samples such as the ADO Source for some good template code.

Sunday, March 25, 2012

Changing all Int to Bigint

Hi,
We need to change all Int data types to Bigint. Considering the number of
tables and View tables, changing manually one by one is not a option. Is
there a nicer way of changing all (hundreds of them) in more automatic way?
YCYou'll have to script this kind of thing. You can start with
INFORMATION_SCHEMA.COLUMNS and filter on DATA_TYPE. You can generate a
bunch of ALTER TABLE statements from that.
Tom
----
Thomas A. Moreau, BSc, PhD, MCSE, MCDBA
SQL Server MVP
Toronto, ON Canada
.
"YC" <asppsa@.hotmail.com> wrote in message
news:%23NDqO2DhGHA.4452@.TK2MSFTNGP05.phx.gbl...
Hi,
We need to change all Int data types to Bigint. Considering the number of
tables and View tables, changing manually one by one is not a option. Is
there a nicer way of changing all (hundreds of them) in more automatic way?
YC|||On Tue, 30 May 2006 16:05:30 -0700, YC wrote:

>Hi,
>We need to change all Int data types to Bigint. Considering the number of
>tables and View tables, changing manually one by one is not a option. Is
>there a nicer way of changing all (hundreds of them) in more automatic way?
Hi YC,
Tom told you how to do this. But I just have to ask why you want to do
this. I can imagine that the -2,147,483,648 to 2,147,483,647 range is
insufficient for SOME columns - but all'?
Have you considered the impact that this change will have on your DB's
storage requirements? All int columns will double in size - this will
impact storage requirement for tables with integer columns, but for
indexes on integer columns as well (and any nonclustered indexes if the
clustered index of the same table is on an integer column).
How about performance - more bytes per data row (and per index row)
means less rows per page. Means more logical page reads. But also less
cache hits, and hence more physical page reads.
I recommend you to change just the columns that need the ennhanced range
of bigint. Keep other columns as int.
Hugo Kornelis, SQL Server MVP|||I have to agree. One more thing - you'll have to drop any constraints or
indexes that use the columns before you can alter the columns. You'll then
have to replace them when you're done.
Tom
----
Thomas A. Moreau, BSc, PhD, MCSE, MCDBA
SQL Server MVP
Toronto, ON Canada
"Hugo Kornelis" <hugo@.perFact.REMOVETHIS.info.INVALID> wrote in message
news:p36s72ht36u3slffgfilhi2ic2lhp689tn@.
4ax.com...
On Tue, 30 May 2006 16:05:30 -0700, YC wrote:

>Hi,
>We need to change all Int data types to Bigint. Considering the number of
>tables and View tables, changing manually one by one is not a option. Is
>there a nicer way of changing all (hundreds of them) in more automatic way?
Hi YC,
Tom told you how to do this. But I just have to ask why you want to do
this. I can imagine that the -2,147,483,648 to 2,147,483,647 range is
insufficient for SOME columns - but all'?
Have you considered the impact that this change will have on your DB's
storage requirements? All int columns will double in size - this will
impact storage requirement for tables with integer columns, but for
indexes on integer columns as well (and any nonclustered indexes if the
clustered index of the same table is on an integer column).
How about performance - more bytes per data row (and per index row)
means less rows per page. Means more logical page reads. But also less
cache hits, and hence more physical page reads.
I recommend you to change just the columns that need the ennhanced range
of bigint. Keep other columns as int.
Hugo Kornelis, SQL Server MVPsql

Monday, March 19, 2012

Changes in Katmai

I've got a number of questions about the forthcoming release which hopefully can be answered:

1) What version of Excel will 2008 export too? Currently exported Excel files are in native 2000/2003 format. Please don't tell me they will only export in 2007 format!

2) Can you give any details on changes we can expect to the report viewer (web version) control? In particular will it behave better in an update panel? Also we have found the only way of getting the height property to set correctly with this control is to use some very (I'm mean very) dodgy java script. This seems to be a common problem looking through various forums.

3) Will we have the option of opening linked reports through the report viewer in a new window/tab (this is common complaint from my users currently).

4) In the code window of the report designer is there any chance of getting some IntelliSense?

5) Will there be support for stored procedures that return multiple recordsets?

Thanks

Simon

Hi Simon,

I can answer #1 of your questions. Reporting Services 2008 will export to the same Excel format as before. The XLS format can be used on Excel 2000-2007.

Best regards,
Chris|||

#5: It's not on the list for SSRS 2008.

Could you please explain in more detail why this is so important?

Can you write wrapper stored procedures that return a particular recordset you are interested in?

-- Robert

|||

Thanks for both the answers so far. In response to Robert's point about #5 - it's useful rather than requirement.

I worked recently on converting an ASP based reporting system into RS. Many of the existing procs returns multiple recordsets so we struggled to reuse the code. Agreed it could be done with a wrapper anyway. This certainly wouldn't stop me wanting to upgrade!

Any comments on the other points?

Thanks again

Simon

|||Robert,

I think support for multiple resultsets would be great.

At the moment we may have a report that shows the same basic data in more than one way, eg two tables and a chart. If a single resultset can't provide the data we need to execute more than one query from within the report. I appreciate that they can run in parallel, but if they are basically hitting the same underlying data it would be better for us to have one stored procedure that returned several resultsets.

This is especially true if the query can't be done in one statement and requires the production of temporary tables/variables. If we have to have separate queries we may have to recreate the temporary data in each query, whereas if we have one procedure with multiple resultsets it gets created just once and the second resultset can build on the first, the third on the second etc.

Regards,
Andrew

Changes in Katmai

I've got a number of questions about the forthcoming release which hopefully can be answered:

1) What version of Excel will 2008 export too? Currently exported Excel files are in native 2000/2003 format. Please don't tell me they will only export in 2007 format!

2) Can you give any details on changes we can expect to the report viewer (web version) control? In particular will it behave better in an update panel? Also we have found the only way of getting the height property to set correctly with this control is to use some very (I'm mean very) dodgy java script. This seems to be a common problem looking through various forums.

3) Will we have the option of opening linked reports through the report viewer in a new window/tab (this is common complaint from my users currently).

4) In the code window of the report designer is there any chance of getting some IntelliSense?

5) Will there be support for stored procedures that return multiple recordsets?

Thanks

Simon

Hi Simon,

I can answer #1 of your questions. Reporting Services 2008 will export to the same Excel format as before. The XLS format can be used on Excel 2000-2007.

Best regards,
Chris|||

#5: It's not on the list for SSRS 2008.

Could you please explain in more detail why this is so important?

Can you write wrapper stored procedures that return a particular recordset you are interested in?

-- Robert

|||

Thanks for both the answers so far. In response to Robert's point about #5 - it's useful rather than requirement.

I worked recently on converting an ASP based reporting system into RS. Many of the existing procs returns multiple recordsets so we struggled to reuse the code. Agreed it could be done with a wrapper anyway. This certainly wouldn't stop me wanting to upgrade!

Any comments on the other points?

Thanks again

Simon

|||Robert,

I think support for multiple resultsets would be great.

At the moment we may have a report that shows the same basic data in more than one way, eg two tables and a chart. If a single resultset can't provide the data we need to execute more than one query from within the report. I appreciate that they can run in parallel, but if they are basically hitting the same underlying data it would be better for us to have one stored procedure that returned several resultsets.

This is especially true if the query can't be done in one statement and requires the production of temporary tables/variables. If we have to have separate queries we may have to recreate the temporary data in each query, whereas if we have one procedure with multiple resultsets it gets created just once and the second resultset can build on the first, the third on the second etc.

Regards,
Andrew

Changes in Katmai

I've got a number of questions about the forthcoming release which hopefully can be answered:

1) What version of Excel will 2008 export too? Currently exported Excel files are in native 2000/2003 format. Please don't tell me they will only export in 2007 format!

2) Can you give any details on changes we can expect to the report viewer (web version) control? In particular will it behave better in an update panel? Also we have found the only way of getting the height property to set correctly with this control is to use some very (I'm mean very) dodgy java script. This seems to be a common problem looking through various forums.

3) Will we have the option of opening linked reports through the report viewer in a new window/tab (this is common complaint from my users currently).

4) In the code window of the report designer is there any chance of getting some IntelliSense?

5) Will there be support for stored procedures that return multiple recordsets?

Thanks

Simon

Hi Simon,

I can answer #1 of your questions. Reporting Services 2008 will export to the same Excel format as before. The XLS format can be used on Excel 2000-2007.

Best regards,
Chris|||

#5: It's not on the list for SSRS 2008.

Could you please explain in more detail why this is so important?

Can you write wrapper stored procedures that return a particular recordset you are interested in?

-- Robert

|||

Thanks for both the answers so far. In response to Robert's point about #5 - it's useful rather than requirement.

I worked recently on converting an ASP based reporting system into RS. Many of the existing procs returns multiple recordsets so we struggled to reuse the code. Agreed it could be done with a wrapper anyway. This certainly wouldn't stop me wanting to upgrade!

Any comments on the other points?

Thanks again

Simon

|||Robert,

I think support for multiple resultsets would be great.

At the moment we may have a report that shows the same basic data in more than one way, eg two tables and a chart. If a single resultset can't provide the data we need to execute more than one query from within the report. I appreciate that they can run in parallel, but if they are basically hitting the same underlying data it would be better for us to have one stored procedure that returned several resultsets.

This is especially true if the query can't be done in one statement and requires the production of temporary tables/variables. If we have to have separate queries we may have to recreate the temporary data in each query, whereas if we have one procedure with multiple resultsets it gets created just once and the second resultset can build on the first, the third on the second etc.

Regards,
Andrew

Sunday, March 11, 2012

change value type from Int64 to Int32 ?

I have a query which calculates a number... but by default the number is represented as a 64 bit integer. I cannot remember the function name but it is only using SQL9.0 built in functions. Is there a way to cast the number?

This is not a trivial issue since I have found an easier way to do this which did not involve the number, although any input would be greatly appreciated.

Thank you :)

I don't quite understand your question. But you can cast a value to a different data type using CAST function. You may or may not get runtime errors depending on the data. See Books Online for more details. So in your query, you can do something like below:

select cast(<expr> as int)

from ...

Saturday, February 25, 2012

change text of msg 547,level 16

Hi
I've SQL Server 2000,now I want to change the default
text message of msg number 547,level 16.
how is it possible?
any help would be greatly appreiciated.
Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/RM wrote:
> Hi
> I've SQL Server 2000,now I want to change the default
> text message of msg number 547,level 16.
> how is it possible?
If all you want is localize the message, you may try the suggestions from
this article
INF: How to Install Localized SQL Server Error Messages
http://support.microsoft.com/defaul...kb;en-us;277535
sincerely,
--
Sebastian K. Zaklada
Skilled Software
http://www.skilledsoftware.com
This posting is provided "AS IS" with no warranties, and confers no rights.

Friday, February 24, 2012

Change SQL Server Serial Number

Good morning !

Anyone knows how can i change a SQL Server Serial number without uninstall
it ?

Thanks in advanced

JLuis"Pepelu" <jozeluis@.telefonica.net> wrote in message
news:isbue.1568448$I96.1885057@.telenews.teleline.e s...
> Good morning !
> Anyone knows how can i change a SQL Server Serial number without uninstall
> it ?
> Thanks in advanced
> JLuis

Probably not, but why would you want to do this?

Simon

Change SQL Server Error Logs

How do I change the number of SQL Server Error Logs from
the default of six?
Thank You,
DeanThis is a multi-part message in MIME format.
--=_NextPart_000_01C3_01C3ADC3.83BDD530
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: 7bit
In EM, go to Management->SQL Server Logs->Configure and then set the number
you want.
--
Tom
---
Thomas A. Moreau, BSc, PhD, MCSE, MCDBA
SQL Server MVP
Columnist, SQL Server Professional
Toronto, ON Canada
www.pinnaclepublishing.com/sql
"Dean" <anonymous@.discussions.microsoft.com> wrote in message
news:06be01c3adec$d11d95d0$a001280a@.phx.gbl...
How do I change the number of SQL Server Error Logs from
the default of six?
Thank You,
Dean
--=_NextPart_000_01C3_01C3ADC3.83BDD530
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
&

In EM, go to Management->SQL Server =Logs->Configure and then set the number you want.
-- Tom
---T=homas A. Moreau, BSc, PhD, MCSE, MCDBASQL Server MVPColumnist, SQL =Server ProfessionalToronto, ON Canadahttp://www.pinnaclepublishing.com/sql">www.pinnaclepublishing.com=/sql
"Dean" wrote in message news:06be01c3adec$d1=1d95d0$a001280a@.phx.gbl...How do I change the number of SQL Server Error Logs from the default of six?Thank You,Dean

--=_NextPart_000_01C3_01C3ADC3.83BDD530--|||This is a multi-part message in MIME format.
--=_NextPart_000_0042_01C3ADCB.31C905D0
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Mine always defaults back to 6. Any way to change this?
"Tom Moreau" <tom@.dont.spam.me.cips.ca> wrote in message =news:%23ALDx1erDHA.1872@.TK2MSFTNGP09.phx.gbl...
In EM, go to Management->SQL Server Logs->Configure and then set the =number you want.
-- Tom
---
Thomas A. Moreau, BSc, PhD, MCSE, MCDBA
SQL Server MVP
Columnist, SQL Server Professional
Toronto, ON Canada
www.pinnaclepublishing.com/sql
"Dean" <anonymous@.discussions.microsoft.com> wrote in message =news:06be01c3adec$d11d95d0$a001280a@.phx.gbl...
How do I change the number of SQL Server Error Logs from the default of six?
Thank You,
Dean
--=_NextPart_000_0042_01C3ADCB.31C905D0
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
&

Mine always defaults back to 6. Any way =to change this?
"Tom Moreau" = wrote in message news:%23ALDx1erDHA.=1872@.TK2MSFTNGP09.phx.gbl...
In EM, go to Management->SQL =Server Logs->Configure and then set the number you want.
-- Tom

=---T=homas A. Moreau, BSc, PhD, MCSE, MCDBASQL Server MVPColumnist, SQL =Server ProfessionalToronto, ON Canadahttp://www.pinnaclepublishing.com/sql">www.pinnaclepublishing.com=/sql


"Dean" wrote in message news:06be01c3adec$d1=1d95d0$a001280a@.phx.gbl...How do I change the number of SQL Server Error Logs from the default =of six?Thank You,Dean

--=_NextPart_000_0042_01C3ADCB.31C905D0--|||This is a multi-part message in MIME format.
--=_NextPart_000_028C_01C3ADD0.9F7BA830
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: 7bit
Are you a member of the sysadmin role?
--
Tom
---
Thomas A. Moreau, BSc, PhD, MCSE, MCDBA
SQL Server MVP
Columnist, SQL Server Professional
Toronto, ON Canada
www.pinnaclepublishing.com/sql
"Greg" <toonanimator@.excite.com> wrote in message
news:ukI8bUfrDHA.2556@.TK2MSFTNGP09.phx.gbl...
Mine always defaults back to 6. Any way to change this?
"Tom Moreau" <tom@.dont.spam.me.cips.ca> wrote in message
news:%23ALDx1erDHA.1872@.TK2MSFTNGP09.phx.gbl...
In EM, go to Management->SQL Server Logs->Configure and then set the
number you want.
--
Tom
---
Thomas A. Moreau, BSc, PhD, MCSE, MCDBA
SQL Server MVP
Columnist, SQL Server Professional
Toronto, ON Canada
www.pinnaclepublishing.com/sql
"Dean" <anonymous@.discussions.microsoft.com> wrote in message
news:06be01c3adec$d11d95d0$a001280a@.phx.gbl...
How do I change the number of SQL Server Error Logs from
the default of six?
Thank You,
Dean
--=_NextPart_000_028C_01C3ADD0.9F7BA830
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
&

Are you a member of the sysadmin role?
-- Tom
---T=homas A. Moreau, BSc, PhD, MCSE, MCDBASQL Server MVPColumnist, SQL =Server ProfessionalToronto, ON Canadahttp://www.pinnaclepublishing.com/sql">www.pinnaclepublishing.com=/sql
"Greg" =wrote in message news:ukI8bUfrDHA.2556=@.TK2MSFTNGP09.phx.gbl...
Mine always defaults back to 6. Any way =to change this?
"Tom Moreau" = wrote in message news:%23ALDx1erDHA.=1872@.TK2MSFTNGP09.phx.gbl...
In EM, go to Management->SQL =Server Logs->Configure and then set the number you want.
-- Tom

=---T=homas A. Moreau, BSc, PhD, MCSE, MCDBASQL Server MVPColumnist, SQL =Server ProfessionalToronto, ON Canadahttp://www.pinnaclepublishing.com/sql">www.pinnaclepublishing.com=/sql


"Dean" wrote in message news:06be01c3adec$d1=1d95d0$a001280a@.phx.gbl...How do I change the number of SQL Server Error Logs from the default =of six?Thank You,Dean

--=_NextPart_000_028C_01C3ADD0.9F7BA830--

Sunday, February 12, 2012

change number of CALs?

I have a client who has just purchased more SQL CALs. Where do we input
this new number of CALs to reflect that?
Thanks.I think you go to Control Panel -> license manager...
Wayne Snyder, MCDBA, SQL Server MVP
Computer Education Services Corporation (CESC), Charlotte, NC
www.computeredservices.com
(Please respond only to the newsgroups.)
I support the Professional Association of SQL Server (PASS) and it's
community of SQL Server professionals.
www.sqlpass.org
"Brian Rottman" <anonymous@.anonymous.net> wrote in message
news:%23tnkG03CEHA.3132@.TK2MSFTNGP11.phx.gbl...
> I have a client who has just purchased more SQL CALs. Where do we input
> this new number of CALs to reflect that?
> Thanks.|||I found that but the only type of license that is listed there is for
Windows.

> I think you go to Control Panel -> license manager...
>