[T-SQL] Gettin Error while Inplorting data from excel file to Table in sqlserver. |
- Gettin Error while Inplorting data from excel file to Table in sqlserver.
- Which trigger should choose?
- Select first row
- Can we create Sequence to the environment?
- Dynamic SQL - What's wrong with sp_executesql ?
- HOW TO CREATE LINKED SERVER FOR CSV
- Changing Select Case used in Function to TSQL Query
- LTRIM,RTRIM
Gettin Error while Inplorting data from excel file to Table in sqlserver. Posted: 26 Aug 2013 12:59 AM PDT some column in excel has lengthy data so,im gettin the following error while importing Data from sqlserver2008: - Executing (Error)MessagesError 0xc020901c: Data Flow Task 1: There was an error with output column "Description" (33) on output "Excel Source Output" (9). The column status returned was: "Text was truncated or one or more characters had no match in the target code page.". (SQL Server Import and Export Wizard) Error 0xc020902a: Data Flow Task 1: The "output column "Description" (33)" failed because truncation occurred, and the truncation row disposition on "output column "Description" (33)" specifies failure on truncation. A truncation error occurred on the specified object of the specified component. (SQL Server Import and Export Wizard) Error 0xc0047038: Data Flow Task 1: SSIS Error Code DTS_E_PRIMEOUTPUTFAILED. The PrimeOutput method on component "Source - 'Request Tracking$'" (1) returned error code 0xC020902A. 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. (SQL Server Import and Export Wizard) -------------------------plz suggest im using import wizard from sqlserver2008 |
Posted: 26 Aug 2013 12:06 AM PDT Hi all,I have a scenario:There is 2 tables tableA and tableB. If I insert any record in tableA that is not exist in tableB then that record should get insert into tableB also, else if a record exists and any value is updated for that record than that value should also get updated in tableB.I have written MERGE statement for this in an trigger... But I am confused which should I use for this please suggest |
Posted: 26 Aug 2013 12:35 AM PDT Hi, I'd really appreciate if someone can help, beforehand, thank youI have sites with contact list table where every contact has a "cs_seqno" number; every contact has a phone numberSample:Table name: contactSite 50 has a contact list with six contacts where the order to display them start by cs_seqno 1Contact tablesite Name cs_seqno phone50 Amy Benh 1 91658452050 John Smith 10 38825812550 Carl Denver 20 64064012050 Ed Coleman 30 9864012050 Ben Harmon 40 621621001site Name cs_seqno phone60 John Sunny 1 96663852060 Aaron Davis 10 46025282560 Phil Waitman 20 54065612260 Ron Ellis 30 61928863060 Don Willet 40 621621001I need get the first contact that has a phone number starting by 6, so for the upper list i need select and get the cs_seqno 20 & 30 site Name cs_seqno phone50 Carl Denver 20 64064012060 Ron Ellis 30 619288630Thanks for your help.Cphspain |
Can we create Sequence to the environment? Posted: 26 Aug 2013 12:42 AM PDT HelloI know we can create a sequence on any particular column/ columns in a table. someone was asking me that can we create a sequence to the environment(Dev/Test).Thanks |
Dynamic SQL - What's wrong with sp_executesql ? Posted: 25 Aug 2013 02:46 AM PDT Hi,the following Script builds a perfect SQL-Statement to Truncate multiple Tables.Print shows the Script, but EXECUTE sp_executesql @sql doesn't exec the Script. What's wrong? I want to truncate each Table with GV%.RegardsNicole ;-) DECLARE @sql NVARCHAR(MAX) ; DECLARE @TableNameStartsWith AS NVARCHAR(50)= 'GV' SET @sql = 'SELECT ''Truncate table '' + TABLE_NAME FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME LIKE ''' + '%' + @TableNameStartsWith + '%' + '''' PRINT @sql EXECUTE sp_executesql @sql |
HOW TO CREATE LINKED SERVER FOR CSV Posted: 25 Aug 2013 11:27 PM PDT Hi EverybodyPlease help me to write a query for creating linkedserver to read csv files.Thanks |
Changing Select Case used in Function to TSQL Query Posted: 25 Aug 2013 07:13 PM PDT Hi,I want to change the following function to a TSQL Query. Please help me in this regards.[code="vb"]Public Function TranslatedVal(SecCashHedge as String, ReturnType as String, Local as Decimal, BaseUnhedged as Decimal, BaseHedged as Decimal) as Decimal Dim Val as Decimal Val = Local Select Case ReturnType Case "Local" Val = Local Case "Base" Val = Local Case "Base Unhedged" Val = BaseUnhedged Case "Base Hedged" Val = BaseHedged End Select Select Case SecCashHedge & ReturnType Case "AcctBase" Val = BaseHedged Case "AcctHedgingBase" Val = BaseHedged Case "AcctTranslationBase" Val = BaseHedged Case "IndexBase" Val = BaseHedged Case "IndexHedgingLocal" Val = 0 Case "IndexHedgingBase" Val = BaseHedged Case "IndexHedgingBase Unhedged" Val = 0 Case "IndexHedgingBase Hedged" Val = 0 Case "IndexTranslationLocal" Val = 0 Case "IndexTranslationBase" Val = BaseHedged Case "IndexTranslationBase Unhedged" Val = 0 Case "IndexTranslationBase Hedged" Val = 0 Case "AcctHedging & Translation Gains/LossesBase" Val = BaseHedged Case "IndexHedging & Translation Gains/LossesBase" Val = BaseHedged End Select Return ValEnd Function[/code] |
Posted: 21 Oct 2011 12:29 AM PDT hii have this code in where clause RTRIM(LTRIM(ODER_ID))= ' ',WHAT THis do |
You are subscribed to email updates from SQLServerCentral / SQL Server 2008 / T-SQL (SS2K8) To stop receiving these emails, you may unsubscribe now. | Email delivery powered by Google |
Google Inc., 20 West Kinzie, Chicago IL USA 60610 |
No comments:
Post a Comment