Showing posts with label fields. Show all posts
Showing posts with label fields. Show all posts

Friday, March 30, 2012

Scripting component.

Hi Guys,

I need to generate a file using script component. I'm taking some data from an oledb source and then i would need to modify the fields, generate new fields and then generate the flat file.

I don't have any problems with this but the file i need to replicate would need to have a head record and a trail record which doesn't need to be duplicated.

Now when i generate the file and put anything in "Public Overrides Sub Input0_ProcessInputRow" it will work but it will generate the header record again and again as well.

Any quick help would be really appreciated.


TA

Gemma

Gemma,

Any reason for using the script component to create the file? Can you just use the script to populate the pipeline and use a flat file destination for the file? If so, I recently described how you would go about creating a flat file with header and trailing records.. http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=2168163&SiteID=1

|||

Hi Eric,

I'm just combinging the fields, padding the fields with zero and doing some cleaning of the data as well.

Is there any other way? I've checked your post but I don't know how to add something from the database in the header.

Yes you can enter any expressions but i need the value from the table.

Can you help me do that?


TA
Gemma

|||

Add a boolean flag at the class level and default it to True, Then in the ProcessInput check the flag. If it is True, write the header line and change the flag to false.

There's an example of that approach in the script I posted here - http://agilebi.com/cs/blogs/jwelch/archive/2007/09/14/dynamically-pivoting-rows-to-columns.aspx. The example is not what you were asking about, but the script illustrates the technique.

Tuesday, March 20, 2012

Script Question inside a DataFlow

Is it possible to iterate over all of the fields of the Row collection inside of the Script Component of a data flow. Basically, want I want to is to check every incoming column (all are strings) for a particular character sequence, and if found, change it to something else. I am current accessing each field as Row.Field1, Row.Field2, etc. and just thought there must be a better way to do something like:

For each col in Row

if row.col = XXX then do something.

End For

Thanks in advance for your help

gsell wrote:

Is it possible to iterate over all of the fields of the Row collection inside of the Script Component of a data flow. Basically, want I want to is to check every incoming column (all are strings) for a particular character sequence, and if found, change it to something else. I am current accessing each field as Row.Field1, Row.Field2, etc. and just thought there must be a better way to do something like:

For each col in Row

if row.col = XXX then do something.

End For

Thanks in advance for your help

Well, you COULD do that but, trust me, it would be much much slower than what you are already doing. To loop over the data this would need to be an asynchronous (sometimes called a blocking) component and these are slow.

The correct way to do this is what you are already doing.

-Jamie

Friday, March 9, 2012

Script for adding fields to table

How can I create a script that updates a table with new fields without
losing the data in the table (i.e., without dropping and recreating the
table)?
Thanks.Use an ALTER TABLE statement:
ALTER TABLE your_table_name ADD new_column_name INTEGER NULL
See Books Online for the full syntax.
David Portas
SQL Server MVP
--|||Use the alter table commands to add the column to existing table. Below is
an example of adding a column that is GUID id to a table already created and
populated with lots of data.
Alter TABLE [#hard_drives2] ADD [HDrive_ID] uniqueidentifier
CONSTRAINT Add_Guid
DEFAULT newid() WITH VALUES
GO
The ADD part of the statement is the part where you create new column and
give it the parameters for how long the column is, and in this case it is a
GUID id.
There are several things you can do with the alter table statement. Please
refer to SQL Books Online for more indepth functionality.
"Neil" wrote:

> How can I create a script that updates a table with new fields without
> losing the data in the table (i.e., without dropping and recreating the
> table)?
> Thanks.
>
>|||Thanks. It would be nice if EM provided a way to automatically script that
for you, the way it does for adding entire tables. But I guess some things
need to be done by hand.
"David Portas" <REMOVE_BEFORE_REPLYING_dportas@.acm.org> wrote in message
news:1117621367.921448.203030@.g44g2000cwa.googlegroups.com...
> Use an ALTER TABLE statement:
> ALTER TABLE your_table_name ADD new_column_name INTEGER NULL
> See Books Online for the full syntax.
> --
> David Portas
> SQL Server MVP
> --
>|||EM will generate the script for you. In the Design Table screen, add a
column and then click the "Save change script" button (third on the
toolbar). If you insert a column in the middle of the structure
however, it will generate a script to recreate the entire table,
because there is no way to fix absolute column order with an ALTER
TABLE statement.
It pays to make table mods through Query Analyzer rather than the EM
interface. TSQL is more powerful and gives you more control.
David Portas
SQL Server MVP
--|||Great! Thanks for the info.
"David Portas" <REMOVE_BEFORE_REPLYING_dportas@.acm.org> wrote in message
news:1117705690.710697.59860@.g44g2000cwa.googlegroups.com...
> EM will generate the script for you. In the Design Table screen, add a
> column and then click the "Save change script" button (third on the
> toolbar). If you insert a column in the middle of the structure
> however, it will generate a script to recreate the entire table,
> because there is no way to fix absolute column order with an ALTER
> TABLE statement.
> It pays to make table mods through Query Analyzer rather than the EM
> interface. TSQL is more powerful and gives you more control.
> --
> David Portas
> SQL Server MVP
> --
>|||Neil (nospam@.nospam.net) writes:
> Thanks. It would be nice if EM provided a way to automatically script that
> for you, the way it does for adding entire tables. But I guess some things
> need to be done by hand.
Count yourself lucky for not having found it, and damn the day David
told you that you could do it.
To wit, yes, there is a function for this in Enterprise Manager, but, no,
you should not use it. There are several serious flaws with it, and you
could end up messing up your database.
As David mentioned, EM will recreate the table if you insert a column in
the middle. What he didn't say is that EM will do this also if you change
or drop a column, despite there is an ALTER TABLE syntax for this.
Basically, EM assumes that it's talking to an 6.5 database.
Now, recreating table is necessarily not bad. In fact, this can be
preferable over an ALTER TABLE in some situations, even if ALTER TABLE
is available. But recreating the table, requires you to have some sort
of recovery strategy, if the operation fails half-way. EM applies a
transaction scope, and as long as you run the thing directly from EM,
it's safe, but if you save the script, the script is not safe. Furthermore,
EM's transaction scope is wacko.
Another horror story with EM is that you can start doing a change to
table, then abandon that table and close it. Yet, you may find this
change performed anyway when you save, because this table was referred
by some other table you saved!
So don't use Enterprise Manager to modify tables. The same applies to
the Modify Table function in the new SQL Server Management Studio.
Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se
Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techin.../2000/books.asp

Script for adding fields to table

How can I create a script that updates a table with new fields without
losing the data in the table (i.e., without dropping and recreating the
table)?

Thanks.Use an ALTER TABLE statement:

ALTER TABLE your_table_name ADD new_column_name INTEGER NULL

See Books Online for the full syntax.

--
David Portas
SQL Server MVP
--|||Thanks. It would be nice if EM provided a way to automatically script that
for you, the way it does for adding entire tables. But I guess some things
need to be done by hand.

"David Portas" <REMOVE_BEFORE_REPLYING_dportas@.acm.org> wrote in message
news:1117621367.921448.203030@.g44g2000cwa.googlegr oups.com...
> Use an ALTER TABLE statement:
> ALTER TABLE your_table_name ADD new_column_name INTEGER NULL
> See Books Online for the full syntax.
> --
> David Portas
> SQL Server MVP
> --|||EM will generate the script for you. In the Design Table screen, add a
column and then click the "Save change script" button (third on the
toolbar). If you insert a column in the middle of the structure
however, it will generate a script to recreate the entire table,
because there is no way to fix absolute column order with an ALTER
TABLE statement.

It pays to make table mods through Query Analyzer rather than the EM
interface. TSQL is more powerful and gives you more control.

--
David Portas
SQL Server MVP
--|||Great! Thanks for the info.

"David Portas" <REMOVE_BEFORE_REPLYING_dportas@.acm.org> wrote in message
news:1117705690.710697.59860@.g44g2000cwa.googlegro ups.com...
> EM will generate the script for you. In the Design Table screen, add a
> column and then click the "Save change script" button (third on the
> toolbar). If you insert a column in the middle of the structure
> however, it will generate a script to recreate the entire table,
> because there is no way to fix absolute column order with an ALTER
> TABLE statement.
> It pays to make table mods through Query Analyzer rather than the EM
> interface. TSQL is more powerful and gives you more control.
> --
> David Portas
> SQL Server MVP
> --|||Neil (nospam@.nospam.net) writes:
> Thanks. It would be nice if EM provided a way to automatically script that
> for you, the way it does for adding entire tables. But I guess some things
> need to be done by hand.

Count yourself lucky for not having found it, and damn the day David
told you that you could do it.

To wit, yes, there is a function for this in Enterprise Manager, but, no,
you should not use it. There are several serious flaws with it, and you
could end up messing up your database.

As David mentioned, EM will recreate the table if you insert a column in
the middle. What he didn't say is that EM will do this also if you change
or drop a column, despite there is an ALTER TABLE syntax for this.
Basically, EM assumes that it's talking to an 6.5 database.

Now, recreating table is necessarily not bad. In fact, this can be
preferable over an ALTER TABLE in some situations, even if ALTER TABLE
is available. But recreating the table, requires you to have some sort
of recovery strategy, if the operation fails half-way. EM applies a
transaction scope, and as long as you run the thing directly from EM,
it's safe, but if you save the script, the script is not safe. Furthermore,
EM's transaction scope is wacko.

Another horror story with EM is that you can start doing a change to
table, then abandon that table and close it. Yet, you may find this
change performed anyway when you save, because this table was referred
by some other table you saved!

So don't use Enterprise Manager to modify tables. The same applies to
the Modify Table function in the new SQL Server Management Studio.

--
Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se

Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techin.../2000/books.asp

Wednesday, March 7, 2012

Script Component - Timeout Expired

Hello,

I have a script component inside one of my packages that performs a calculation on the fields and then does several insert statements on SQL 2005 database for each row inputed.

During the execution, when the data is a bit large ~ 3000 records input that produce around 20,000 insert statement, a "Timeout Expired" message pops up several times from the script component. Although the data enters in the database, but I have to manually click "ok" on each of the messages during run-time.
Any idea as to why I am getting this error or how to fix it?
Below is the code of the script component that does the insert.

Thanks for your help.

Grace


Part of Script Component Code:

Try

connMgr = Me.Connections.Connection

conn = CType(connMgr.AcquireConnection(Nothing), SqlConnection)

cmd.Connection = conn

cmd.CommandText = "INSERT statement .... "

If conn.State = ConnectionState.Closed Then conn.Open()

cmd.ExecuteNonQuery()

Catch ex As Exception

MsgBox(ex.Message)

End Try

Why are you doing this inside a script component? This is incredibly inefficient as it issues an INSERT for each of the rows. If you used the data-flow OLE DB Destination it would do set based inserts.

-Jamie

|||

Hi Jamie,

For each row I have an amount, inception date and expiry date. I am using the script component because I have to divide the amount porportionally over each month between the inception - expiry dates and then issue an insert statement for each month with its amount. What I posted in my earlier question was the part that is doing the connection and insert because I thought there might be something wrong in it. So one row triggers multiple inserts depending on dates. I don't know how this is possible using OLE DB Destination.

Thank You,

Grace

|||

How big is your cmd.CommandTimeout? Have you tried to set it to 0 to see whether that helps?

thanks

wenyang

|||

Yes I tried to set it to 0 but still the same error.

The full error message I get: "Timeout expired. The timeout period elapsed prior to obtaining a connection from the pool. This may have occured because all pooled connections were in use and max pool size was reached."

I tried to use conn.clearPool (conn) after the execution but get the message: "Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding."

I tried to close the connection after the ExecuteNonQuery, it seems it worked, no more timeout expired. However, sometimes i get error on the DataFlow Task but when I run it another time, it works fine. I am still testing this case to know what is happening.

Thanks,

Grace


|||

Hi ,

I'm getting the same error in my script component as mentioned in the first post.

the error is "Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding"

I tried all the ways mentioned in the post.

can anybody help me in this regard.

Thanks,

vaishu.

|||

vaishali.mspp wrote:

Hi ,

I'm getting the same error in my script component as mentioned in the first post.

the error is "Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding"

I tried all the ways mentioned in the post.

can anybody help me in this regard.

Thanks,

vaishu.

Are you trying to insert into a table that is also the target of an OLE DB Destination? If so, your timeout is probably due to a lock.

For the record, I think the OP would be better served sending the new rows to another output of the script and pushing them into an OLE DB Destination, rather than trying to do inserts in the script. It did not sound as if the original scenario was inserting to different tables, which is really the only reason (off the top of my head) to do it in the script.

Script Component - Timeout Expired

Hello,

I have a script component inside one of my packages that performs a calculation on the fields and then does several insert statements on SQL 2005 database for each row inputed.

During the execution, when the data is a bit large ~ 3000 records input that produce around 20,000 insert statement, a "Timeout Expired" message pops up several times from the script component. Although the data enters in the database, but I have to manually click "ok" on each of the messages during run-time.
Any idea as to why I am getting this error or how to fix it?
Below is the code of the script component that does the insert.

Thanks for your help.

Grace


Part of Script Component Code:

Try

connMgr = Me.Connections.Connection

conn = CType(connMgr.AcquireConnection(Nothing), SqlConnection)

cmd.Connection = conn

cmd.CommandText = "INSERT statement .... "

If conn.State = ConnectionState.Closed Then conn.Open()

cmd.ExecuteNonQuery()

Catch ex As Exception

MsgBox(ex.Message)

End Try

Why are you doing this inside a script component? This is incredibly inefficient as it issues an INSERT for each of the rows. If you used the data-flow OLE DB Destination it would do set based inserts.

-Jamie

|||

Hi Jamie,

For each row I have an amount, inception date and expiry date. I am using the script component because I have to divide the amount porportionally over each month between the inception - expiry dates and then issue an insert statement for each month with its amount. What I posted in my earlier question was the part that is doing the connection and insert because I thought there might be something wrong in it. So one row triggers multiple inserts depending on dates. I don't know how this is possible using OLE DB Destination.

Thank You,

Grace

|||

How big is your cmd.CommandTimeout? Have you tried to set it to 0 to see whether that helps?

thanks

wenyang

|||

Yes I tried to set it to 0 but still the same error.

The full error message I get: "Timeout expired. The timeout period elapsed prior to obtaining a connection from the pool. This may have occured because all pooled connections were in use and max pool size was reached."

I tried to use conn.clearPool (conn) after the execution but get the message: "Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding."

I tried to close the connection after the ExecuteNonQuery, it seems it worked, no more timeout expired. However, sometimes i get error on the DataFlow Task but when I run it another time, it works fine. I am still testing this case to know what is happening.

Thanks,

Grace


|||

Hi ,

I'm getting the same error in my script component as mentioned in the first post.

the error is "Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding"

I tried all the ways mentioned in the post.

can anybody help me in this regard.

Thanks,

vaishu.

|||

vaishali.mspp wrote:

Hi ,

I'm getting the same error in my script component as mentioned in the first post.

the error is "Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding"

I tried all the ways mentioned in the post.

can anybody help me in this regard.

Thanks,

vaishu.

Are you trying to insert into a table that is also the target of an OLE DB Destination? If so, your timeout is probably due to a lock.

For the record, I think the OP would be better served sending the new rows to another output of the script and pushing them into an OLE DB Destination, rather than trying to do inserts in the script. It did not sound as if the original scenario was inserting to different tables, which is really the only reason (off the top of my head) to do it in the script.

Script component - column iteration within

I have a synchronous script component and have added 5 fields to the output (field1, field2... field5). Can I iterate those fields?

In sudo language, I'd like to do:

Code Snippet

Public Overrides Sub Input0_ProcessInputRow(ByVal Row As Input0Buffer)
dim i as integer = 1
while i < 6
row.field[i] = "somevalue: " + i.ToString
end while
end sub

Somehow, I'd like to be able to do that without specifying each field individually:

row.field1 = "somevalue: " + "1"
row.field2 = "somevalue: " + "2"
...

Phil Brammer wrote:

I have a synchronous script component and have added 5 fields to the output (field1, field2... field5). Can I iterate those fields?

In sudo language, I'd like to do:

Code Snippet

Public Overrides Sub Input0_ProcessInputRow(ByVal Row As Input0Buffer)
dim i as integer = 1
while i < 6
row.field[i] = "somevalue: " + i.ToString
end while
end sub

Somehow, I'd like to be able to do that without specifying each field individually:

row.field1 = "somevalue: " + "1"
row.field2 = "somevalue: " + "2"
...

Phil,

This should put you on the right path:

Code Snippet

Public Overrides Sub Input0_ProcessInputRow(ByVal Row As Input0Buffer)

Dim col As IDTSOutputColumn90

For Each col In Me.ComponentMetaData.OutputCollection(0).OutputColumnCollection

MsgBox(col.Name)

Next

End Sub

-Jamie

P.S. How did you get all the code indented in your post?

|||

Question. Why on earth do you want to do this? Smile

|||

Jamie Thomson wrote:

Question. Why on earth do you want to do this?

I'm trying to build an example for a poster from last night...

So the above works great for iterating the columns, now I need to assign a value to the output columns by iterating them.

Code Snippet

While counter < maxSegments
For Each col In Me.ComponentMetaData.OutputCollection(0).OutputColumnCollection

If col.Name.Contains("Segment" + (counter + 1).ToString) Then
' Below I need to take the current "column name" and assign a value to it in the output collection
Row.(col.Name) = myStringArray(counter)
Exit For
End If

Next
counter = counter + 1
End While


I just cut and paste with the indentions and it just works for me!|||

Jamie Thomson wrote:


Code Snippet

Public Overrides Sub Input0_ProcessInputRow(ByVal Row As Input0Buffer)

Dim col As IDTSOutputColumn90

For Each col In Me.ComponentMetaData.OutputCollection(0).OutputColumnCollection

MsgBox(col.Name)

Next

End Sub

-Jamie

P.S. How did you get all the code indented in your post?

How do you get color?

|||

JayH wrote:

How do you get color?

Let me guess, Jamie: Internet Explorer?|||

Phil Brammer wrote:

JayH wrote:

How do you get color?

Let me guess, Jamie: Internet Explorer?

I just copy and paste as well Smile

I get colour but no indents. Phil gets indents but no colour. Weird.

I'm on Vista and IE7.

-Jamie

P.S. color not colour. Whoops - better not get into that!!! Smile

|||

Phil Brammer wrote:


Let me guess, Jamie: Internet Explorer?

I think I tried IE, but it didn't do it either.

While I'm asking questions, how do users mark questions as "answered". I only see "Was this post helpful?" with Yes/No buttons. Is that it? I just assumed that only the OP had permission to mark the question as answered, and since I never start threads I just wasn't seeing it.
|||

JayH wrote:

Phil Brammer wrote:


Let me guess, Jamie: Internet Explorer?

I think I tried IE, but it didn't do it either.

While I'm asking questions, how do users mark questions as "answered". I only see "Was this post helpful?" with Yes/No buttons. Is that it? I just assumed that only the OP had permission to mark the question as answered, and since I never start threads I just wasn't seeing it.

That's correct. Only the OP and moderators can mark threads as answered.|||

Phil Brammer wrote:

JayH wrote:

Phil Brammer wrote:


Let me guess, Jamie: Internet Explorer?

I think I tried IE, but it didn't do it either.

While I'm asking questions, how do users mark questions as "answered". I only see "Was this post helpful?" with Yes/No buttons. Is that it? I just assumed that only the OP had permission to mark the question as answered, and since I never start threads I just wasn't seeing it.

That's correct. Only the OP and moderators can mark threads as answered.

really? dang. I didn't know that.

|||

Jamie Thomson wrote:

really? dang. I didn't know that.

What do you mean? aren't you a moderator? If so, you will see 'Mark as answer' buttom on each post

|||

Rafael Salas wrote:

Jamie Thomson wrote:

really? dang. I didn't know that.

What do you mean? aren't you a moderator? If so, you will see 'Mark as answer' buttom on each post

Yes, I'm a moderator. Hence I have the ability to 'mark as answered'. Hence I didn't know that none-moderators do not have the ability to do this.

-Jamie

|||jaegd has a wonderful example of a script component that does what I'm looking at:

http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=864401&SiteID=1

Script / Function ... to find difference b/w 2 similar tables

Hi,

I m searching for some Script / Function ... to find difference in data
b/w 2 similar tables (exactly same fields structure) in sql 2000.
plz update me asap !

thanks in advance !On 11 Jan 2005 22:34:27 -0800, AzGhanv/. wrote:

>I m searching for some Script / Function ... to find difference in data
>b/w 2 similar tables (exactly same fields structure) in sql 2000.
>plz update me asap !

Hi AzGhanv/.,

SELECT CASE
WHEN a.KeyCol = 1 THEN 'FirstTable'
ELSE 'SecondTable'
END AS Origin,
COALESCE (a.KeyCol1, b.KeyCol1) AS KeyCol1,
COALESCE (a.KeyCol2, b.KeyCol2) AS KeyCol2,
....
COALESCE (a.KeyColN, b.KeyColN) AS KeyColN,
COALESCE (a.DataCol1, b.DataCol1) AS DataCol1,
COALESCE (a.DataCol2, b.DataCol2) AS DataCol2,
....
COALESCE (a.DataColN, b.DataColN) AS DataColN
FROM FirstTable AS a
FULL OUTER JOIN SecondTable AS b
ON a.KeyCol1 = b.KeyCol1
AND a.KeyCol2 = b.KeyCol2
....
AND a.KeyColN = b.KeyColN
AND a.DataCol1 = b.DataCol1
AND a.DataCol2 = b.DataCol2
....
AND a.DataColN = b.DataColN

NOTE: The above assumes that no column may contain NULLS. For each data
column that allow NULLS, you'll have to replace

AND a.DataColX = b.DataColX

with

AND (a.DataColX = b.DataColX
OR (a.DataColX IS NULL AND b.DataColX IS NULL))

or, alternatively

AND NULLIF (a.DataColX, b.DataColX) IS NULL
AND NULLIF (b.DataColX, a.DataColX) IS NULL

Best, Hugo
--

(Remove _NO_ and _SPAM_ to get my e-mail address)|||Assuming by differences you mean rows in A not in B as well as vice
versa, a good solution would be

create table t1 (a int,b int)
create table t2 (a int,b int)

insert into t1 values (1,2)
insert into t1 values(3,4)
insert into t1 values(5,6)
insert into t2 values(1,2)
insert into t2 values(3,7)
insert into t2 values(5,6)

select sum(t) ,a,b from

(select 1 as t,* from t1
union all
select 2 as t,* from t2
) as both
group by a,b

this way you see both kinds of differences as 1 or 2, and 3 means no
difference (you can add having sum(t)<3 not to see them)
hope this helps
Tzvika

Saturday, February 25, 2012

Scrambled data in some fields

We have recently discovered that several sending systems (all using the same subroutine) have been scrambling some of the data sent to an MS SQL database.

I'm trying to figure out how to identify the scrambled records.

We know that records with zero in the 4th, 6th and 7th positions of their SSNs, had the SSN rearranged. Instead of the SSN in order (123456789) it is now (467512389).

The SSN is used as a subsidiary ID field in the system (let's call it the SID field.) Since some people don't have SSNs, an alternate number, which may begin with three zeros, is used.

I can select off all SIDs beginning with 3 zeros, but some of those will be legitimate records.

I can also select off all SIDs with zeroes in positions 4, 7 and 8, but only SOME systems were making the mistaking.

I can't figure out how to make a list of SIDs with 4, 7, and 8 for which a corresponding SID with 3 zeroes in front exists. This list would be the first we examine. (We will have to check all '000' SIDs, since it's possible that only 'bad' SIDs were created for some people, instead of both 'good' and 'bad' SIDs.)

Can someone help a novice SQL programmer with this (to me) perplexing problem?If I understand you, you need to try the following

INSERT INTO PossibleErrors
( SID )
SELECT SID
FROM Table
WHERE SUBSTRING(convert(varchar,SID),1,3) = '000'
AND SUBSTRING(convert(varchar,SID),4,1) = '0'
AND SUBSTRING(convert(varchar,SID),7,1) = '0'
AND SUBSTRING(convert(varchar,SID),8,1) = '0'

scptxfr.exe

Hello Experts,
I have some Table names and fields in my language (Greek)
and when I use the scptxfr.exe utility to script my DB
then I see "chinese" (Greek argot and maybe yours too). I
try place the Code Page but it didn't worked.
Do you have any suggestions how to resolve this problem?
Is it a good (which scripts hierachical) tool to script
my whole DB?
PS: I got SQL Server 2000 (latest Service Pack)
Thanks in advance.
Konstantinos MichasHi Konstantinos,
Have you tried running the program with the UNICODE
switch ?
That should make it collation independant.
J
>--Original Message--
>Hello Experts,
>I have some Table names and fields in my language (Greek)
>and when I use the scptxfr.exe utility to script my DB
>then I see "chinese" (Greek argot and maybe yours too). I
>try place the Code Page but it didn't worked.
>Do you have any suggestions how to resolve this problem?
>Is it a good (which scripts hierachical) tool to script
>my whole DB?
>PS: I got SQL Server 2000 (latest Service Pack)
>Thanks in advance.
>Konstantinos Michas
>.
>|||Hello Julie and thanks for your reply, it works fine know.
Thanks again!
Konstantinos Michas
>--Original Message--
>Hi Konstantinos,
>Have you tried running the program with the UNICODE
>switch ?
>That should make it collation independant.
>J
>
>>--Original Message--
>>Hello Experts,
>>I have some Table names and fields in my language
(Greek)
>>and when I use the scptxfr.exe utility to script my DB
>>then I see "chinese" (Greek argot and maybe yours too).
I
>>try place the Code Page but it didn't worked.
>>Do you have any suggestions how to resolve this
problem?
>>Is it a good (which scripts hierachical) tool to script
>>my whole DB?
>>PS: I got SQL Server 2000 (latest Service Pack)
>>Thanks in advance.
>>Konstantinos Michas
>>.
>.
>