Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  Advanced Search
  HOME    TRACKER    MS SQL Server






SuperbHosting.net & Arvixe.com have generously sponsored dedicated servers and web hosting to ensure a reliable and scalable dedicated hosting solution for BigResource.com.







How To Find Out The Character Set/code Page


Hi!
How one can find out the character set/code page set during SQLServer installation?
Thanks,
Fabio


View Complete Forum Thread with Replies
Sponsored Links:

Related Messages:
SSIS Failing To Load Extended Character In Code Page 1252
Background€¦
 
We€™re receiving the data as flat files, when I open up the file in notepad the characters look like the error€™d examples (see below).  Open the file up in a texteditor where you can apply code page 1252 it display the characters correctly, which is expected behaviour!
 
I use SSIS to load these files into my database, applying the correct code page€¦
 

€¦however the data gets loaded in the incorrect form.  Plus the database is collation €˜SQL_Latin1_General_CP1_CI_AS€™ which is code page 1252 so I can€™t see why I am getting these issues.
 
This is an example of the Umlaut (German chars) issues were getting, they€™re appearing in the database like this€¦.
 
tuid                  travelproductid            lastname
1741869            6                                  P€?hls
1792950            6                                  Sch€žfer
2087798            6                                  L€?schhorn
2089010            6                                  Sagemller
2314086            6                                  Jnger
 
 €¦& should be€¦
 
1741869            6                                  Pöhls
1792950            6                                  Schäfer
2087798            6                                  Löschhorn
2089010            6                                  Sagemüller
2314086            6                                  Jünger
 
 
I think it€™s a bug with SSIS, I know having a Unicode file would certainly solve this but I don't have that option.

View Replies !   View Related
How To Find A Row By (file#:page#:slot On Page)
Hi

I would like to know if there is some way to find a row in a table by the RID that sp_lock returns :

for example

"SELECT * FROM Authors (UPDLOCK) WHERE name = 'John'"

sp_lock returns the locked row id :
2:328:11 (file#page#slot on page)

How do i get this row???

Thanks

PB

View Replies !   View Related
Find Character
Hi all,

I have a string like '10010000001000'.
Here I need to find the 4th character of this string (in this case it should be '1') by using sql query. How to do this one?


regards
Shaji

View Replies !   View Related
To Find The Special Character Inside A Name
CHALASANI writes "I have a name in my table which is "ra_ja" I want to find the name with the help of the'_' character.

Can you please help with the querry

Sorry with my english
Thank you"

View Replies !   View Related
To Find The Number Of Occurences Of A Particular Character In A String
Hi all,

@str varchar(500)

select @str = 'abcd,efgh,i,jklmn,opsqrtuv'

For the above string, which string function can be used to find the number of occurences of a particular character, for example, ','? For this example, the answer should be 4. Is there any built-in function in SQL to do this?

Thanks in advance,
-Praveena

View Replies !   View Related
Patindex To Find Special Character And Next 6 Digits
I am creating a view to pull data for a UPS integration I am doing. I currently have this view where I pull my data from. All is well accept for my PATINDEX,

Currently I have this PATINDEX So when a user puts this into delivery instructions "#999999" UPS_FINAL returns 999999 which is good for me to use. But The PATINDEX will also grab all kinds of neat stuff out of the delivery instructions field when I really only want whatever is after the # sign in the field.

I am new to sql and dont quite understand how this search is working but I think I am in need of a better way to search the field



Code:


WHEN SUBSTRING(P21PLAY.dbo.p21_view_oe_hdr.delivery_instructions, PATINDEX('%[^a-z ]%', P21PLAY.dbo.p21_view_oe_hdr.delivery_instructions) + 1, 6) IS NULL

THEN dbo.Address_Table.ups_code

ELSE SUBSTRING(P21PLAY.dbo.p21_view_oe_hdr.delivery_instructions,
PATINDEX('%[^a-z ]%', P21PLAY.dbo.p21_view_oe_hdr.delivery_instructions) + 1, 6) END AS UPS_FINAL


-------------------------------------------------------------------------------------
What I am looking to accomplish is a SUBSTRING that will search delivery_instructions



Code:


SELECT

TOP (100) PERCENT P21PLAY.dbo.p21_view_oe_pick_ticket.pick_ticket_no,
P21PLAY.dbo.p21_view_oe_hdr.order_no, P21PLAY.dbo.p21_view_oe_hdr.customer_id,
P21PLAY.dbo.p21_view_oe_hdr.ship2_name, P21PLAY.dbo.p21_view_oe_hdr.ship2_add1,
P21PLAY.dbo.p21_view_oe_hdr.ship2_add2,
P21PLAY.dbo.p21_view_oe_hdr.ship2_city,
P21PLAY.dbo.p21_view_oe_hdr.ship2_state,
P21PLAY.dbo.p21_view_oe_hdr.ship2_zip,
P21PLAY.dbo.p21_view_oe_hdr.po_no,
P21PLAY.dbo.p21_view_oe_pick_ticket.carrier_id AS Carrier,
P21PLAY.dbo.p21_view_oe_pick_ticket.carrier_id AS Supplier,

P21PLAY.dbo.p21_view_oe_hdr.cod_flag,
P21PLAY.dbo.p21_view_oe_hdr.terms,
P21PLAY.dbo.p21_view_oe_hdr.ship2_country,
P21PLAY.dbo.p21_view_oe_hdr.ship_to_phone,
P21PLAY.dbo.p21_view_oe_hdr.delivery_instructions,
dbo.Address_Table.ups_code,

-----------Looks for special character and returns next 6 spaces as UPS_Shipper----------

SUBSTRING(P21PLAY.dbo.p21_view_oe_hdr.delivery_instructions, PATINDEX('%[^a-z ]%',

P21PLAY.dbo.p21_view_oe_hdr.delivery_instructions) + 1, 6)
AS UPS_Shipper,

------------------Checks view for email address or assigns alternate------------------
(CASE WHEN charindex('@', p21_view_contacts.email_address) > 0 THEN p21_view_contacts.email_address ELSE

'email@domain.com' END) AS alternate_address,

'Y' AS QVN, 'email@domain.com' AS failureaddress,

P21PLAY.dbo.p21_view_contacts.email_address,

------------When carrier_id is not one of these # then Null; else ------------------------------

CASE WHEN P21PLAY.dbo.p21_view_oe_pick_ticket.carrier_id NOT IN (105188, 105191, 105194, 105197, 105200,

105203, 105206, 105209, 105212) THEN NULL

----------------- Looks for special Character in delivery_instructions; if NULL then ups_code;
ELSE return value from delivery_instructions as UPS_Final--------------------

WHEN SUBSTRING(P21PLAY.dbo.p21_view_oe_hdr.delivery_instructions,
PATINDEX('%[^a-z ]%', P21PLAY.dbo.p21_view_oe_hdr.delivery_instructions) + 1, 6) IS NULL
THEN dbo.Address_Table.ups_code
ELSE SUBSTRING(P21PLAY.dbo.p21_view_oe_hdr.delivery_instructions,
PATINDEX('%[^a-z ]%', P21PLAY.dbo.p21_view_oe_hdr.delivery_instructions) + 1, 6) END AS UPS_FINAL


FROM dbo.Address_Table INNER JOIN
P21PLAY.dbo.p21_view_oe_pick_ticket INNER JOIN
P21PLAY.dbo.p21_view_oe_hdr ON P21PLAY.dbo.p21_view_oe_pick_ticket.order_no =

P21PLAY.dbo.p21_view_oe_hdr.order_no ON
dbo.Address_Table.id = P21PLAY.dbo.p21_view_oe_hdr.customer_id LEFT OUTER JOIN
P21PLAY.dbo.p21_view_contacts ON P21PLAY.dbo.p21_view_oe_hdr.contact_id = P21PLAY.dbo.p21_view_contacts.id

WHERE
(P21PLAY.dbo.p21_view_oe_hdr.completed <> 'Y')
AND (P21PLAY.dbo.p21_view_oe_hdr.delete_flag <> 'Y')
AND (P21PLAY.dbo.p21_view_oe_hdr.will_call <> 'Y')
ORDER BY P21PLAY.dbo.p21_view_oe_pick_ticket.pick_ticket_no



Hope this makes since

View Replies !   View Related
Find And Replace Carriage Return Character
Hi I have a text file which I need to import into Access or SQL.

It is 500,000 records which is pipe delimited. The problem is, is that it can contain carriage returns: (square symbol).

Therefore I need to find and replace these characters

Does anybody know of any free ware text file viewers that can do this??

Best Regareds

David

View Replies !   View Related
Find The Occurrence Of A Particular Character Inside A String
Hi all,
 
Am searching for a built-in function that retrives me the occurrence (counts) of a particular character inside a string.

 
For e.g.  In the String 'SqlServer'. I want to find the no of the character 'e', which shud retrive the value as 2.
 
Can this be acheived through any function.
 
Cheers !
ash
 

View Replies !   View Related
Error At Login Page: Conversion Failed When Converting From A Character String To Uniqueidentifier.
Hello,  Im Getting an error (below) at the login page. The only control on
that page is a Login control, adn the error below comes when I click login. Does anyone know what Im doing wrong? This is my login page:<%@ Page Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true" CodeFile="Login.aspx.cs" Inherits="Login" Title="myapp- Login" %><asp:Content ID="Content1" ContentPlaceHolderID="ContentHeader" Runat="Server">    LOGIN</asp:Content><asp:Content ID="Content2" ContentPlaceHolderID="ContentBody" Runat="Server">    <table border="1" cellpadding="0" cellspacing="0" width="305">        <tr>            <td class="bodyText" colspan="2" style="height: 20px; text-align: center;">                <p>                    <!-- TemplateBeginEditable name="mainText" -->                    &nbsp;<asp:Login ID="Login1" runat="server" TitleText="Existing Users Log In">                    </asp:Login>                </p>            </td>        </tr>        <tr>            <td style="text-align: right">                <asp:LinkButton ID="lbNewmembers" runat="server" OnClick="lbNewmembers_Click">New Member?</asp:LinkButton></td>            <td>                <asp:LinkButton ID="lbForgotPassword" runat="server" OnClick="lbForgotPassword_Click">Forgot Password?</asp:LinkButton></td>        </tr>    </table></asp:Content>Error: 
Server Error in '/myApp' Application.


Conversion failed when converting from a character string to
uniqueidentifier. Description:
An unhandled exception occurred during the execution of the current web
request. Please review the stack trace for more information about the error and
where it originated in the code. Exception Details:
System.Data.SqlClient.SqlException: Conversion failed when converting from a
character string to uniqueidentifier.Source Error:



An unhandled exception was generated during the execution of the
current web request. Information regarding the origin and location of the
exception can be identified using the exception stack trace below.
Stack Trace:



[SqlException (0x80131904): Conversion failed when converting from a character string to uniqueidentifier.] System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection) +859322 System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection) +736198 System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj) +188 System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj) +1959 System.Data.SqlClient.SqlDataReader.ConsumeMetaData() +31 System.Data.SqlClient.SqlDataReader.get_MetaData() +62 System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString) +297 System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async) +903 System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, DbAsyncResult result) +132 System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method) +32 System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior, String method) +122 System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior) +62 System.Web.Security.SqlMembershipProvider.GetPasswordWithFormat(String username, Boolean updateLastLoginActivityDate, Int32& status, String& password, Int32& passwordFormat, String& passwordSalt, Int32& failedPasswordAttemptCount, Int32& failedPasswordAnswerAttemptCount, Boolean& isApproved, DateTime& lastLoginDate, DateTime& lastActivityDate) +1121 System.Web.Security.SqlMembershipProvider.CheckPassword(String username, String password, Boolean updateLastLoginActivityDate, Boolean failIfNotApproved, String& salt, Int32& passwordFormat) +105 System.Web.Security.SqlMembershipProvider.CheckPassword(String username, String password, Boolean updateLastLoginActivityDate, Boolean failIfNotApproved) +42 System.Web.Security.SqlMembershipProvider.ValidateUser(String username, String password) +83 System.Web.UI.WebControls.Login.OnAuthenticate(AuthenticateEventArgs e) +160 System.Web.UI.WebControls.Login.AttemptLogin() +105 System.Web.UI.WebControls.Login.OnBubbleEvent(Object source, EventArgs e) +99 System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args) +35 System.Web.UI.WebControls.Button.OnCommand(CommandEventArgs e) +115 System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +163 System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +7 System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +11 System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +33 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +5102

Version Information: Microsoft .NET Framework Version:2.0.50727.312;
ASP.NET Version:2.0.50727.833

View Replies !   View Related
Code Page
Hello,

I am getting following error

Error: 0xC02020F4 at Data Flow Task, OLE DB Source [1]: The column "dbname" cannot be processed because more than one code page (936 and 1252) are specified for it.

Error: 0xC02020F4 at Data Flow Task, OLE DB Source [1]: The column "dbsize" cannot be processed because more than one code page (936 and 1252) are specified for it.

Error: 0xC02020F4 at Data Flow Task, OLE DB Source [1]: The column "Owner" cannot be processed because more than one code page (936 and 1252) are specified for it.

Error: 0xC02020F4 at Data Flow Task, OLE DB Source [1]: The column "Status" cannot be processed because more than one code page (936 and 1252) are specified for it.

Error: 0xC02020F4 at Data Flow Task, OLE DB Source [1]: The column "CompLevel" cannot be processed because more than one code page (936 and 1252) are specified for it.

 

When I run the package itself it is working fine and when I am calling the package from another package getting this error. From Parent package I sending servername for olde db source to this package.

Thanks.

View Replies !   View Related
Error : 806 -- Could Not Find Virtual Page...
at SQL Server startup, in error log:
Error : 806, Severity: 21, State: 1
Could not find virtual page for logical page <number> in database 'EMGTEST'

Error : 3414, Severity: 21, State: 1
Database 'EMGTEST' (dbid 7): Recovery failed. Please contact Technical Support for further instructions.

Database 'EMGTEST' cannot be opened - it has been marked SUSPECT by recovery. The SA can drop the database with DBCC.


.....

I reset status to Emergency mode (sysdatabases.status = -32768),
run dbcc checkdb, dbcc newalloc, dbcc textall...it all looks just fine.
I also changed database status to 12 (sysdatabases.status = 12 - select into/bulkcopy and trunc. log on chkpt.) and then run dbcc checkdb, dbcc newalloc, dbcc textall again. looked just fine.
but, if I restarted server , database will be marked 'suspect' again, because of Error 806.

any ideas?

Thanks.

View Replies !   View Related
SqlDataSource - Where To Put It ? On The Page - In The Code Behind ?
Hi,
I have the following Sql Data Source that I wish to bring back on my page:
<asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:FrogConnectionString %>"
SelectCommand="ProposalsCheckNewCustomerData" SelectCommandType="StoredProcedure">
<SelectParameters>
<asp:FormParameter FormField="MaritalStatusID" Name="MartialStatusID" Type="Int32" />
<asp:FormParameter FormField="LivingStatusID" Name="LivingStatusID" Type="Int32" />
<asp:FormParameter FormField="DealerID" Name="DealerID" Type="Int32" />
<asp:FormParameter FormField="VehicleTypeID" Name="VehicleTypeID" Type="Int32" />
<asp:FormParameter FormField="FinanceTypeID" Name="FinanceTypeID" Type="Int32" />
<asp:FormParameter FormField="MediaSourceID" Name="MediaSourceID" Type="Int32" />
<asp:FormParameter FormField="DealerContactID" Name="DealerContactID" Type="Int32" />
</SelectParameters>
</asp:SqlDataSource>
The recordset brings back 7 values that I wish to populate into 7 Labels.
1. Should the SqlDataSource be on the page (between the Head tags) or within the Page_Load command of the Page Behind ?- If its on the page behind do any of you have any sample code to show me how to get the recordset up and running ?
2. How would I bind the results to a label ?- Within my old asp pages it was simple (I'm not saying its not simple here, I am still getting my head around vb.net)- eg <%=rsX("MaritalStatus")%> I guess its something very similar
Thanks for any pointersFizzystutter
 

View Replies !   View Related
DTS Import Code Page
I'm trying to set the encoding of my dts package and have no clue how to do this. Basically i got:

Function Main()
DTSDestination("CONCEPT_CKI") = DTSSource("CONCEPT_CKI")
....
....
DTSDestination("UPDT_CNT") = DTSSource("UPDT_CNT")
Main = DTSTransformStat_OK
End Function

How do I add the encoding page ex. 1252 or 437

View Replies !   View Related
Changing Code Page
Does anyone have details on how to change the code page on a server. I know that SBOL says to bcp data out, rebuild master and then to reload databases back in, but there are many fine points that I am missing cause I can't get it right. Also, I am trying to change the code page from 850 to 1252 and I want to ensure that the characters are translated correctly. For the most part they are converted right with the exception of a handful of characters. Does the OEMtoAnsi conversion option make a difference to the BCP process?

ALso, has anyone tried to change the code page from SQL 6.5 to SQL 7.0?

View Replies !   View Related
Changing Code Page
Does anyone have details on how to change the code page on a server. I know that SBOL says to bcp data out, rebuild master and then to reload databases back in, but there are many fine points that I am missing cause I can't get it right. Also, I am trying to change the code page from 850 to 1252 and I want to ensure that the characters are translated correctly. For the most part they are converted right with the exception of a handful of characters. Does the OEMtoAnsi conversion option make a difference to the BCP process?

ALso, has anyone tried to change the code page from SQL 6.5 to SQL 7.0?

View Replies !   View Related
Code Page Conversion
Does anyone have details on how to change the code page on a server. I know that SBOL says to bcp data out, rebuild master and then to reload databases back in, but there are many fine points that I am missing cause I can't get it right. Also, I am trying to change the code page from 850 to 1252 and I want to ensure that the characters are translated correctly. For the most part they are converted right with the exception of a handful of characters. Does the OEMtoAnsi conversion option make a difference to the BCP process?

ALso, has anyone tried to change the code page from SQL 6.5 to SQL 7.0?

View Replies !   View Related
Code Page Headaches
Hi

I am looking at upgrading some SQL 6.5 servers to SQL 2000. The 6.5 servers run a mixture of code page 850 & ISO 8890 and sort orders of 42 & 52.

We want to ensure all the 6.5 databases are migrated to 2000 BUT want to future proof the SQL 2000 databases by supporting unicode characters, as the SQL 2000 databases will be avialable world wide to all languages. That said, we want to ensure the existing table structures are preserved and run at 6.5 compatibility level. I am a little concerned as I am unsure if unicode support will alter table structures and require a re-write of the database schema or table structures.

Can someone help by giving me a straight forward explanation of the implications of my plans please?

Many thanks,

JB

View Replies !   View Related
TRUNCATION OR CODE PAGE
I have a very nasty error on ssis,

Text was truncated or one or more characters had no match in the target code page

This can not be truncation because the field is empty, the second thing is that when i read the file it reads 62000 odd rows but there are 64000 rows.

if i just read the entire file and write the entire file in a scipt i loose 13 rows

I have tried different code pages and non have worked.

Does anyone have an idea

 

 

View Replies !   View Related
Getting Code Page Errors....
I am importing some data from my IBM DB2 Z/OS mainframe to SQL Server 2005 using the SSIS import wizard.  The wizard automatically converted the DB2 string data before trying to store it to SQL Server.  The code page that the wizard chose to do its conversion is the 1252 Ansi Latin.  However, I am getting the following error on the address field...."one or more characters had no match in the target code page".  Can someone suggest another code page?  ASCII?  IBM 37?

View Replies !   View Related
Code Page Error
Can anyone tell me y is this error occuring?
 

[01989 Flat File Source [1781]] Error: Data conversion failed. The data conversion for column "StreetAddress1" returned status value 4 and status text "Text was truncated or one or more characters had no match in the target code page.".
 
[01989 Flat File Source [1781]] Error: The "output column "StreetAddress1" (1822)" failed because truncation occurred, and the truncation row disposition on "output column "StreetAddress1" (1822)" specifies failure on truncation. A truncation error occurred on the specified object of the specified component.
 
[01989 Flat File Source [1781]] Error: An error occurred while processing file "G:MembershipUpdatesLocalSubmissions1989TabDelimitedText1989_raw.txt" on data row 957.
 
[DTS.Pipeline] Error: SSIS Error Code DTS_E_PRIMEOUTPUTFAILED.  The PrimeOutput method on component "01989 Flat File Source" (1781) returned error code 0xC0202092.  The component returned a failure code when the pipeline engine called PrimeOutput(). The meaning of the failure code is defined by the component, but the error is fatal and the pipeline stopped executing.  There may be error messages posted before this with more information about the failure.
 
[DTS.Pipeline] Error: SSIS Error Code DTS_E_THREADFAILED.  Thread "SourceThread0" has exited with error code 0xC0047038.  There may be error messages posted before this with more information on why the thread has exited.
 
[DTS.Pipeline] Error: SSIS Error Code DTS_E_THREADCANCELLED.  Thread "WorkThread0" received a shutdown signal and is terminating. The user requested a shutdown, or an error in another thread is causing the pipeline to shutdown.  There may be error messages posted before this with more information on why the thread was cancelled.
 
[DTS.Pipeline] Error: SSIS Error Code DTS_E_THREADFAILED.  Thread "WorkThread0" has exited with error code 0xC0047039.  There may be error messages posted before this with more information on why the thread has exited.
 
Please help me to solve this

View Replies !   View Related
Code Page Conversion...
I'm grabbing data from a DB2 database on an AS/400.
 
Everything seemed fine and dandy until I started on one particular very big table. It turns out that some of the text fields in this table have characters specific to French. i.e. the funny 'oe' character and something that looks like at shrunken '<' sign.
 
The error being generated is:



Code Snippet
Text was truncated or one or more characters had no match in the target code page
 
 
 
The Code page on the DB2 box is 285, the default code page on the target SQL Server box is 1252. I've tried forcing the use of  the default code page (1252), but the same happens.
 
Anyone know what I'm doing wrong? Is there another Code page value I should try using?
 

View Replies !   View Related
AS/400 With Arabic Code Page (420)
Hi yeah.

I am doing a project which retrieves data from a AS/400 machine.
The code page of the machine is 420.
I used "OLE DBIBM DB2 UDB for iSeries IBMDASQL OLE DB Provider" to connect from SQL Server.
The problem is, all the arabic characters coming from this machine becomes unreadable, becoming some machine code text.
What could be the problem and how can I solve this?

Thank you.

View Replies !   View Related
Pls..help Me To Find Out The Error In The Code
 

hi,

when i tried to run the following code , the code keeps on running without creating the required table...............

pls can anyone help me to figure out the problem........

waiting for your replies...

 

int row_head = 3;

int col_head = 3;

TextBox[] columns1=new TextBox[5];

TextBox[] rows = new TextBox[2];

for (int i = 0; i < 3; i++)

columns1[ i ] = new TextBox();

for (int i = 0; i < 2; i++)

rows[ i ] = new TextBox();

columns1[0].Text = "col1";

columns1[1].Text = "col2";

columns1[2].Text = "col3";



rows[0].Text = "rowh1";

rows[1].Text = "rowh2";



String[] description=new string[10];

for (int k = 0; k < 10; k++)

description[k] = k.ToString();

int index_value = 0;

int des_index = 0;

string datatype = "";

string command = "";

SqlConnection sqlCN = new SqlConnection(connectionString);

for (int i = 0; i < col_head + 1; i++)

{

if (i == 0)

datatype += "(col " + i + " varchar(20),";

else if (i + 1 == col_head+1)

datatype += "col" + i + " varchar(20))";

else

datatype += "col" + i + " varchar(20),";

}

MessageBox.Show(datatype);

MessageBox.Show("create table " + textBox1.Text + " " + datatype);

string selectCommandText = "create table " + textBox1.Text +datatype;

MessageBox.Show("executed");

try

{

SqlCommand sqlCmd = new SqlCommand(selectCommandText, sqlCN);

sqlCN.Open();

MessageBox.Show("open ");

//  the following command is not executed.....

sqlCmd.ExecuteNonQuery();

MessageBox.Show("open and execu");

for (int i = 0; i < row_head + 1; i++)

{

command="";

if (i == 0)

{

command="' ',";

for(int j=0;j<col_head;j++)

{

if(j+1==col_head)

command+="'"+columns1[j].Text+"'";

else

command+="'"+columns1[j].Text+"',";

}

}

else

{

command = "'"+rows[index_value++].Text+"',";

for (int j = des_index; j < des_index + col_head; j++)

{

if (j +1== des_index+col_head)

command += "'" + description[j] + "'";

else

command += "'" + description[j] + "',";

}

des_index = des_index + col_head;

}

MessageBox.Show("INSERT INTO " + textBox1.Text + " values(" + command + ")");

sqlCmd.CommandText = "INSERT INTO " + textBox1.Text + " values("+command+")";

sqlCmd.ExecuteNonQuery();



}

MessageBox.Show("fini");

selectCommandText = "SELECT * FROM " + textBox1.Text;

sqlCmd = new SqlCommand(selectCommandText, sqlCN);

sqlCmd.ExecuteNonQuery();

SqlDataAdapter sqlDA = new SqlDataAdapter(selectCommandText, sqlCN);

DataSet DS = new DataSet();

sqlDA.Fill(DS);

MessageBox.Show("fini 2");

DataGridView1.DataSource = DS.Tables[0].DefaultView;



}

catch (Exception eio)

{ }}

 

Sweety

View Replies !   View Related
Code Page Conversion Error
Hi
We have the problem with Text data type. We can insert into Text column from few work stations but not from few. This is the following error we are getting
COde page translations are not supported for the text data type. From:1252 To: 850.

If anybody has solutions advance thanks to them.

Thanks,
Rau

View Replies !   View Related
HEEEEELP....How Can I Change The Page Code?
I migrate from sql server 6.5 to sql server 7.0, and i'm having problems
with the information that returns me, when i was using 6.5 version
everythings was fine, but now that i'm using 7.0 version sql returns me
unknow characters instead of latin characters, somebody tells me that
i've installed different character set and code page in sql server 7
than Sql Server 6.5 , if this is right what can i do to repair this
mistake that i've made, ther is a way to change the code page and
character set in sql 7.0. Or maybe i have to look an sql driver
compatible, or this is a crazy idea?.

View Replies !   View Related
Code Page Conversion Shortcut?
Is there a simple way to avoid having to use a data conversion task to convert Unicode data (from DB2) to ANSI format (for insert to Oracle)?

I'm hoping that there is a way to set the code page property on the OLEDB driver so that it implicitly converts to the format I want instead of having to explicitly force the conversion in the package.

Thoughts? suggestions?

-Clayton

View Replies !   View Related
Code Page Issues With Connecting To DB2
I'm using the IBM DB2 UDB for iSeries IBMDA400 OLE DB Provider to connect to an AS/400 db2 database
 
I'm trying to do a simple pull through of table data.
 
My connection string is :
 



Code Snippet
Provider=IBMDA400.DataSource.1;Data Source=WAS400;Persist Security Info=True;Password=**********;User ID=svcorbit;Initial Catalog=S652F01E;Force Translate=0;Catalog Library List=OSLD1F3, PAOS21, OSLPLF3
 
 



I'm getting a code page conflict when I try to import the data into SQL Server. This happens when I edit the OLE DB Source component:
 



Code Snippet
The component reported the following warnings:
Warning at {47FF55CB-AA24-45A4-B0DC-2807EC6D3EC1} [OLE DB Source [3570]]: Cannot retrieve the column code page info from the OLE DB provider.  If the component supports the "DefaultCodePage" property, the code page from that property will be used.  Change the value of the property if the current string code page values are incorrect.  If the component does not support the property, the code page from the component's locale ID will be used.
 
 


and at package validation level when trying to run:
 



Code SnippetError at Data Flow Task [OLE DB Destination [970]]: Column "ACRC10" cannot convert between unicode and non-unicode string data types.
 
 

I've tried using the default code page on the component, that doesn't work. I've tried changing the code page to 285 (which is what it is on the AS/400), that doesn't work.
 
I'm running out of ideas... help!

View Replies !   View Related
Setting Default Code Page
I've been reading some forums and I'm not able to get this to work. Basically I'm using an Oracle DB source and trying to import data into SQL server 2005. I guess the best connections to use are OLE DB.
 
Here are my current connections:
Source: Native OLE DBOracle Provide for OLE DB
Destination: Native OLE DBSQL Native Client
 
I'm running SP2 of SQL 2005.
 
Now, the issue is I'm not getting the code page stuff correct. In the data flow I'm just doing a OLE DB Source to SQl Server Destination. I'm not doing any transformations (I'm hoping to avoid doing that).
 
I'm getting an error:

 
[OLE DB Source [1]] Warning: Cannot retrieve the column code page info from the OLE DB provider.  If the component supports the "DefaultCodePage" property, the code page from that property will be used.  Change the value of the property if the current string code page values are incorrect.  If the component does not support the property, the code page from the component's locale ID will be used.
 
 
I'm looking at how to set the DefaultCodePage property in various forums, but nowhere does it say exactly how to do this. I've tried changing the "Extended Properties" and added AlwaysUseDefaultCodePage=TRUE in there, but that doesn't work. I've tried changing the Locale Identifier to 1252 that doesn't work. I've tried a combination of the two, doesn't work. Can somebody tell me two things:
 
1. what's the best/fastest/industry used method to get data from Oracle into SQL server via SSIS (please include the type of connections).
2. How the hell do you set the DefaultCodePage property. I would love a screenshot on this one as well.
 
 
Thanks,
Phil

View Replies !   View Related
Code Page Errors In SSIS
 

Hi All,
we have a set of packages which has to to be implemented across differnet environments.
the packages invariable uses OLEDB Source/Destination Components.
In these two components the Code Page Property is not Configurable.
so if the package has to be Deployed in a different environment than,where it is Developed it gives a Validation Error.
Is there a Workaround for this problem.
if anybody have faced the problem earlier,please post it.
thanks in advance.
cheers
srikanth

View Replies !   View Related
Where Can I Find Out All The Definitions Of SQL Error Code
Hi,

Does anybody know where to find out the definition of all the SQL error code
For example, What does error code 4002 means ? What does error code 3146 means ? Thanks.

View Replies !   View Related
How Do I Pass A Parameter To A Sqldatasource In A Code Behind Page
i have a sqldatasource on my asp.net page -- select * from table where id = @id
i want to set the @id in the backend and set the result to textbox1.text
how do i do this?

View Replies !   View Related
How To Code ASP.NET Page With Return Value Store Procedure?
Does anyone know how to call a SQL store procedure that return a value to the page?
I've a simple data entry aspx page with several textboxes and a save button. When user fill out the form and click save/submit, it calls a store procedure to insert a row into a SQL table and automatically generate an ID that need to return the the page to display for the user.
Are there a similar article somewhere?
 
Thank you all!

View Replies !   View Related
Host Variables And Code Page Conversion
Hello,Does anybody know what is the documented and known behavior ofinserting/updating binary columns using host variables from a client to aserver which have different code pages? Will any code page / character setconversion take place? I am particulary interested in insert/update fromsubqueries.eg:insert into t1(binarycol) select :HV1 from t2versusinsert into t1(binarycol) select :HV1||charcol from t2update t1 set bytecol=:HV1versusupdate t1 set bytecol=:HV1||'abc'insert into t1 (bytecol) values(:HV1)versusinsert into t1 (bytecol) values(:HV1||'abc')Is the conversion dependent on the context?ThanksAakash

View Replies !   View Related
6.5 To 2000 Upgrade Code Page Issue
Hi

I am upgrading a SQL 6.5 database with code page 850 to SQL 2000 with code page 1252.

The problem we have is any german "u" ( with the umlatt - two dots ) above it wont transfer.

I am using the SQL upgrade tool that comes with sql 2000 and have tried many different code pages in 2000 but no joy.

Can anyone help?

Thanks

J.

View Replies !   View Related
Code Page Problems With Cold Fusion
I've just finished converting a SQL2K database from Compatability... collation to Latin1_General, the default for out SQL2K installation. I used ALTER DATABASE to set the default collation for the database. I used ALTER TABLE...to change the collation of fields in user tables that were originally compatability mode. For text fields I created a new version of the table with the correct collation, DTS'd the old data into the new table, renamed the old table and then the new table, and then recreated the PK, FK, and indexes. When I look at information_schema.columns all collation data is either NULL or Latin1...

Our Cold Fusion web app that points to that database errors out, unfortunately, saying:

ODBC Error Code = 37000 (Syntax error or access violation)

[Microsoft][ODBC SQL Server Driver][SQL Server]Code page translations are not supported for the text data type. From: 1252 To: 850.



Date/Time: 07/24/02 13:54:44
Browser: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0)
Remote Address: 12.104.89.38
HTTP Referrer: http://alpha.spie.org/podium/Login.cfm

I've looked at login.cfm and the routines it calls; it simply looks up records in a table based on a 'hashed' representation of a username and password.

Any thoughts???

AL

View Replies !   View Related
Changing Sort / Code Page When Upgrading
Any experience with upgrading from 6.5 to 7.0 and changing sort order / code page in the process? Does this cause problems or matter? We're trying to go with a standard and the servers I need to upgrade aren't at that code page standard.

Thanks..

View Replies !   View Related
Code Page Problem With IBM ISeries Source
Hello,
I'm not up to speed on the IBM database and provider technologies, and I have an issue that I'm not clear on. I am using the .Net ODBC Data Provider in a connection mananger. The DSN uses the iSeries Access ODBC Driver. I have iSeries Access for Windows version 5 release 4 installed on laptop where I have built the package.
 
I have a sql command configured in a DataReader source that uses the connection manager. Between the source and sql server table destination, I have a Derived Column transform that converts the columns from Unicode to non unicode data.
 
When I run the package, I get an error that states that the package failed because a particular column, 'ADDR1' is set to fail if truncation occurs. I set up error output to a text file so that I could look at the failing row(s). The text file had to be set up using UTF-8 before it would accept data. The ADDR1 column at the destination will accept 30 characters. The data in the ADDR1 column of the failing row is 19 characters long, but I think there is a carriage return character present. I have tried TRIM in the exression for the column, but no luck. I have tried code pages 65001, and 37 in the Derived Column transform, but that has not worked. I remembered to set up DefaultCodePage and AlwaysUseDefaultCodePage for the OLE DB destination for each code page change.
 
Am I not using the correct code page, or do I need to do something else to clean up the data?
 
Thank you for your help!
 
cdun2

View Replies !   View Related
Configuring The Code Page Of A OLEDB Source.
hi,

i have a number of interfaces in which i have used oledb source.

the problem i am facing is oledb source components code page is not configurable now if i want to deploy the interface in a different environment which has a database with a different collation it gives a error that oledb source needs new metadata.

has anybody faced this problem earlier.please give me a solution to this problem ..

thanks in advance.

srikanth

View Replies !   View Related
Does Anyone Know Where To Find A Simple Sample Code That Uses Asp.net 2.0 And SQL 2000 To ....
Does anyone know where to find a simple sample showing you how to use asp.net 2.0 with the login control to direct you to another aspx page using SQL 2000 as the database on a hosted server? I have been beating my head against the wall trying to figure this out and would be very appreciative if anyone knows a place out there that shows this?  I can find many sites that show you how to do this with SQL 2005, but not SQL 2000.  Thanks -  Chris 

View Replies !   View Related
Trying To Find Code For SSIS Package That Has Been Migrated
We have a sql job type SSIS package that is not populating a database table as expected and I'm trying to figure what why not but I'm not sure where the "code" is.  The person that created it said they copied a legacy package (sql 2000) and made modifications to it, then migrated it to the new version.  When a legacy package is migrated is there a SSIS solution built?  I see you can edit SSIS packages only in BI Development Studio but I'm not sure where to find package.


 
This post may answer my question but if you have any additional or updated information I'd like to hear it.
http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=393634&SiteID=1
 
So, to view or edit the package you have to export it?
Package location


Select the type of storage location to export the package to. The following options are available:

SQL Server

File System

SSIS Package Storage
 
So do you pick "File System" in order to view it in BI?
 
Thanks for your help.

View Replies !   View Related
Script Component Can't Find The Binary Code
Dear all:

          I have set the PrecompileScriptIntoBinaryCode property to true,but the Script Component show the message "can't find the binary code" after I finish the script language and save it . What's wrong with it ? I ever tried the same code, and it's OK with no problem. When did the problem happen ?

         Please give me a help ....Thanks a lot!

         

View Replies !   View Related
How To Code An Aspx Page To Run A Stored Procedure With A Parameter
 My stored proceddure "My Programs" includes a parameter @meid.How do I code an aspx file to run the procedure with a user ID, e.g. EmpID?I tried the following codes, but the error message indicated it can not findthe Stored Procedure.  How do I pass the EmpID as a Stored Procedure parameter?
 <%meid = EmpIdcmd.CommandText = "MyPrograms meid"cmd.CommandType = CommandType.StoredProcedurecmd.Connection = sqlConnection2sqlConnection2.Open()reader3 = cmd.ExecuteReader(meid)While reader3.Read()sb.Append(reader3(i).ToString() + "......<BR> <BR /> ")End While%> 
TIA,Jeffrey

View Replies !   View Related
Capture Return Value From Stored Procedure, Use Same In Code Behind Page
My stored procedure works and codes is working except I need to capture the return value from the stored procedure and use that value in my code behind page to indicate that a duplicate record entry was attempted.  In my code behind file (VB) how would I capture the value "@myERROR" then display in the label I have that a duplicate entry was attempted.
Stored ProcedureCREATE PROCEDURE dbo.usp_InsertNew @IDNumber         nvarchar(25), @ID  nvarchar(50), @LName  varchar(50), @FName  varchar(50)
AS
 DECLARE @myERROR int    -- local @@ERROR      , @myRowCount int  --local @@rowcountBEGIN  -- See if a contact with the same name and zip code exists IF EXISTS (Select * FROM Info   WHERE ID = @ID)   BEGIN    RETURN 1END ELSEBEGIN TRAN    INSERT INTO Info(IDNumber, ID, LName,             FName) VALUES (@IDNumber, @ID, @LName,             @FName)             SELECT @myERROR = @@ERROR, @myRowCount = @@ROWCOUNT If @myERROR !=0 GOTO HANDLE_ERROR
                               COMMIT TRAN RETURN 0 HANDLE_ERROR:  ROLLBACK TRAN  RETURN @myERROR      ENDGO
asp.net page<asp:SqlDataSource ID="ContactDetailDS" runat="server" ConnectionString="<%$ ConnectionStrings:EssPerLisCS %>"            SelectCommand="SELECT * FROM TABLE_One"                        UpdateCommand="UPDATE TABLE_One WHERE ID = @ID"                         InsertCommand="usp_InsertNew" InsertCommandType="StoredProcedure">                        <SelectParameters>                <asp:ControlParameter ControlID="GridView1" Name="ID" PropertyName="SelectedValue" />            </SelectParameters>             </asp:SqlDataSource>
 

View Replies !   View Related
It Gives Code Page Error On Creating Stored Procedure !!!!!
Hi
I was transferring objects of my existing database from remote to local and I recieved this error during the DTS process. It was on the transfer of the following stored procedure. I tried to create this SP manually but its giving me the same error and doesn't create it. I don't know how to fix it.
I wonder if somebody can help me! Thanks in Advance
[450] Code page translations are not supported for the text data type. From: 1252 To: 1256.
CREATE  PROCEDURE dbo.Novasoft_DL_UpdateDownloadsRating @RatingID int,  @DownloadID int,  @UserID int,  @Rating int, @Comment text, @ReviewDate datetime, @CommentName nvarchar(50) ASUPDATE dbo.Novasoft_DL_DownloadsRating SET [DownloadID] = @DownloadID, [UserID] = @UserID, [Rating] = @Rating, [Comment] = @Comment, [ReviewDate] = @ReviewDate, [CommentName] = @CommentNameWHERE [RatingID] = @RatingID
GO

View Replies !   View Related
How Do I Return The Identity From Stored Procedure To Asp.net Code Behind Page?
how do i return the identity from stored procedure to asp.net code behind page?
CREATE PROCEDURE [dbo].[myInsert] ( @Name varchar(35),   @LastIdentityNumber int output)AS insert into table1 (name) values (@name)
DECLARE @IdentityNumber intSET @IdentityNumber = SCOPE_IDENTITY()SELECT @IdentityNumber as LastIdentityNumber
code behind:
public void _Insert(
string _Name,
{
DbCommand dbCommand = db.GetStoredProcCommand("name_Insert");db.AddInParameter(dbCommand, "name", DbType.String, _userId);
db.AddParameter(dbCommand, "@IdentityNumber", DbType.Int32, ParameterDirection.Output, "", DataRowVersion.Current, null);
db.ExecuteNonQuery(dbCommand);
int a = (int)db.GetParameterValue(dbCommand,"@IdentityNumber");
whats wrong with to the above code?
 

View Replies !   View Related
How Can Insert Advande Code Into Report HTML Page?
I have a report and I want export it to HTML. How I can insert Java Script code and advande HTML code into report HTML page?

Now, I design report on Visual Studio .NET!

Please help me.

Thanks!

View Replies !   View Related
Data Conversion Components &&amp; Code Page Issue
I am using the SSIS wizard to pull data from DB2 z/os to sql server.  The data flow task that is created converts the data to DT_STR Ansi 1252 before storing to sql server database.  The package is blowing up on in the data conversion component...no match in found in target code page...for my city name field.

My old dts wizard didn't have this problem.  The forums seem to indicate that SSIS is no longer doing some of the implicit conversions that DTS did and I may have to do more than one conversion.

What format type/code page do I use for the other conversion?  The code page for my DB2 data source is 37.

I've tried several scenarios and none of them have worked.  Any hints?

View Replies !   View Related

Copyright © 2005-08 www.BigResource.com, All rights reserved