SSIS Undouble - Inline Double Quote And Column Delimeter Problem

Apr 24, 2007

We have problems with SSIS flat file adapter.

We try to import file which contains next sort of data:

"1";"ABC";5
"2";"A""BC""";5
"3";"A""B;C""";5

The resulting table must be:
f1 f2 f3
1 ABC 5
2 A"BC" 5
3 A"B;C" 5

How can we get this result?

p.s.
We tried to use "SQL Server SSIS Sample Component: UnDouble" but the result was unsuccesfull.

View 11 Replies


ADVERTISEMENT

SQL 2012 :: SSIS Double Quote Text Qualifiers

Dec 12, 2014

We have an issue with importing a CSV file into SQL where using a double quote " text qualifier is failing. The data is correct but it fails on a particular line, complaining about the qualifier even though the qualifier is in place and previous lines have imported fine.

View 3 Replies View Related

Double Quote In Database Record

Dec 14, 2005

In my asp.net page when I run a query against the database the datagrid get populated with only the records that starts with the first letter for example A good day. But none of the records that starts like this "A fine day" or "A nice day" displays in the datagrid. I tried to replace the Double Quote but it still returns only the records without " quotes. My query looks like this:
Dim queryString As String = "SELECT [Articles].[AN], [Articles].[Department], [Articles].[ArticleHeading], [Articles].[AccessLevel], [Articles].[Status] FROM [Articles] WHERE (([Articles].[AccessLevel] <> 'SysAdmin') AND ([Articles].[Status] = 'Enable') AND (REPLACE([Articles].[ArticleHeading], 'chr(34)', '')) like @ArticleHeading) ORDER BY [Articles].[ArticleHeading]"

View 6 Replies View Related

Double Quote In Beginning Of Record

Dec 14, 2005

Some of my records starts with a double quote, when I do a search for all records starting with A I can get all except the ones that start "A fine day ...

View 4 Replies View Related

String Constants Must End With A Double Quote.

Apr 2, 2007

i got this error when i was trying to deploy the report... in the preview mode report is working good....



D:
eport1.rdl The expression for the query €˜dataset€™ contains an error: [BC30648] String constants must end with a double quote.



can any one gimme the solution




View 11 Replies View Related

String Constants Must End With A Double Quote.

May 5, 2008

Hi There,

I can't figure out what is causing this error: can you please have a look at my code and let em know what is wrong or rework it for me:

="SELECT ARIBC.cntbtch, ARIBC.btchdesc, ARIBC.AUDTUSER, ARIBC.AUDTDATE, ARIBC.AUDTTI, GLPSOFTMAP.PSPRODUCT, GLPSOFTMAP.PSDEPT, GLPSOFTMAP.PSACCOUNT, GLPSOFTMAP.ACCTID, ARIBH.CODECURN, ARIBH.INVCDESC, CONVERT(varchar,ARIBH.FISCYR + ARIBH.FISCPER) as PERIOD, CONVERT(varchar,ARIBH.IDCUST) AS ACCOUNT, ARCUS.NAMECUST as ARNAME, CASE TEXTTRX WHEN 1 THEN 'INV' WHEN 2 THEN 'DM' WHEN 3 THEN 'CM' END AS CLASS, CONVERT(varchar,ARIBH.IDINVC) AS TRX_NUMBER, (CASE TEXTTRX WHEN 3 THEN ROUND((ARIBD.AMTEXTN*-1),2) ELSE ROUND((ARIBD.AMTEXTN),2) END) AS ""AMOUNT FROM ARIBC"" INNER JOIN ARIBH ON ARIBC.CNTBTCH = ARIBH.CNTBTCH INNER JOIN ARCUS ON ARIBH.IDCUST = ARCUS.IDCUST INNER JOIN ARIBD ON ARIBH.CNTBTCH = ARIBD.CNTBTCH AND ARIBH.CNTITEM = ARIBD.CNTITEM INNER JOIN GLAMF ON ARIBD.IDACCTREV = GLAMF.ACCTFMTTD INNER JOIN GLPSOFTMAP ON ARIBD.IDACCTREV = GLPSOFTMAP.ACCTID WHERE ARIBC.BTCHSTTS=3 AND ERRENTRY <= 0 AND BTCHDESC NOT LIKE '%54-8003%' AND ARIBH.IDINVC in ('" &Replace(Parameters!invoicenum.Value,",","','")"

Thanks,
RC

View 1 Replies View Related

Searching For Double Quote In Sql Server 2005

Jun 11, 2008

Hi ,
I'm using sql server 2005. In my 'Books' table some of the 'subject' column contains data's with single and double quote. example: Quantu"m phys'ics
i'm passing the subject as parameter and it have to display results if the corresponding subject name is in the table. Here is my code... i'm using dynamic query...
 alter procedure getbooks
@sub varchar(200)
as
begin
declare @sqlq nvarchar(2000)
set @sqlq='select subject from books where subjectname like '''+@sub+'%'''
exec sp_executesql @sqlq
end
 How can i search for words like this Quantu"m phys'ics in the above query? Any one who knows how to do this please send me the code..
 

View 9 Replies View Related

Export A View With Double Quote Delimiter

Aug 14, 2006

i am running sql server 2000 on windows 2000. i have a need to export a view and delimit the columns with double quotes as it has imbedded commas in the columns, how do i do this??

View 1 Replies View Related

SQL Server 2008 :: Remove Double Quote In String Fields

Feb 23, 2015

I have a SQL select syntax as below

0 AS SalaryMin,
2088 AS SalaryMax,
2088 AS BillableHours,
'Month' AS SalaryPaidCode,
0 AS SalaryBreakdownHourly,
0 AS SalaryBreakdownDaily,

[Code] ...

While outputting to CSV.file

I got :0,2088,2088,"Month",0,0,0,0,0,0,0,"N/A","N/A","G","N/A","Exempt","Other",1

How can I remove all double quotes in the string fields? so that O can get the result as below while the output
0,2088,2088,Month,0,0,0,0,0,0,0,N/A,N/A,G,N/A,Exempt,Other,1

View 7 Replies View Related

Using Password Ending In Unmatched Double Quote Mark With OleDbConnection

Mar 14, 2008


Issue



I need to write VS2005 C# code using SQL OLE DB to access SQL Server 2005. I have no choice in that matter. I can create a database user with a password like COMPANY", which is a string of uppercase characters ending in an unmatched double-quote mark.

Using Microsoft SQL Server Server Management Studio I login using Windows Authentication, create an account with the password, COMPANY", check the "Enforce password policy", click "OK", and then exit.


Setup


I launch Microsoft SQL Server Server Management Studio again, select "SQL Server Authentication", type in the account name and the COMPANY" password, click the Connect button, and I'm in.

Problem


Now, I need to connect programmatically and run a stored procedure. The password is stored in clear text in hte Registry€”not my choice, it's a legacy application, and changing that is not an option open to me. (We have probably all seen company safes where the combination is scribbled on the wall in case you forget it!)

Here is the code I use to run the sproc:


DBCONNINFOLib.DBConnectionInfoClass DBConnInfo1 = new DBCONNINFOLib.DBConnectionInfoClass();
String strConnString = DBConnInfo1.GetConnectionString( "" );
OleDbConnection con1 = new OleDbConnection( strConnString );
OleDbCommand cmd1 = con1.CreateCommand();
cmd1.CommandType = CommandType.StoredProcedure;
String sCmdText = "sp_SomeStoredProcedure";
cmd1.CommandText = sCmdText;

If I set the connection string in the registry to COMPANY", I get an error like this:


Server Error in '/' Application.


Response is not available in this context.
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.Web.HttpException: Response is not available in this context.

Source Error:





Line 60: catch (System.Exception e)
Line 61: {
Line 62: Response.Write(e.Message.ToString());
Line 63: }
Line 64:
Source File: C:sourceProductNameDataCenterAdm&ReportsWebPagesProductNameWebCommonCodeCommon.cs Line: 62

Stack Trace:





[HttpException (0x80004005): Response is not available in this context.]
System.Web.UI.Page.get_Response() +2077605
SiteIQWeb.CommonCode.Common..ctor() in C:ProductNameDataCenterAdm&ReportsWebPagesProductNameWebCommonCodeCommon.cs:62
SiteIQWeb.MasterPage..ctor() in C:ProductNameDataCenterAdm&ReportsWebPagesProductNameWebMasterPage.master.cs:21
ASP.masterpage_master..ctor() in c:WINDOWSMicrosoft.NETFrameworkv2.0.50727Temporary ASP.NET Files
oot255b545c8a400c7App_Web_hfj8popy.0.cs:0
__ASP.FastObjectFactory_app_web_hfj8popy.Create_ASP_masterpage_master() in c:WINDOWSMicrosoft.NETFrameworkv2.0.50727Temporary ASP.NET Files
oot255b545c8a400c7App_Web_hfj8popy.3.cs:0
System.Web.Compilation.BuildResultCompiledType.CreateInstance() +49
System.Web.UI.MasterPage.CreateMaster(TemplateControl owner, HttpContext context, VirtualPath masterPageFile, IDictionary contentTemplateCollection) +250
System.Web.UI.Page.get_Master() +48
System.Web.UI.Page.ApplyMasterPage() +18
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +685




Version Information: Microsoft .NET Framework Version:2.0.50727.1433; ASP.NET Version:2.0.50727.1433


The closes to success I have been able to come is to set the password to "COMPANYNAME""" or 'COMPANYNAME"', which results in a System.Data.OleDb.OleDbConection Exception with a HResult of 0x80040e4d, and the message Login failed for user 'username'.


Questions


Can the password be formatted differently in the registry, or somehow processed after retrieving it, so that SQL Server 2005 will accept it?

Is this a bug in .NET Framework or SQL OleDb?

Is this simply a case of "Is it hurts, don't do it"?

Thanks in advance. As with all postings, my job, promotion, product success, company future, or some combination thereof is on the line.

View 2 Replies View Related

T-SQL (SS2K8) :: Find All Instances Of String That Contain Certain Letters - Escape Double Quote

Sep 14, 2015

I am trying to find all instances of a string that contain the letters FSC. While I am able to find most of them, I am unable to find the ones wrapped in double quotes.

Query example:

Select *
from myTable
Where item like '%FSC%'

This works great with the exception of when FSC is surrounded by double quotes.

ex: MySentencecontains"FSC"

I have tried Replace with no luck.

View 3 Replies View Related

Form Field Returns Name With Double Quotes Instead Of Single Quote During Update Process.

Oct 3, 2007

I've a weird problem in my application. In of the pages, while trying to update the text box "Name", when I enter Linda's test, it gets saved as Linda''s test. I'm not sure if this is a problem due to SQL server. When I look at the stored procedure, I don't anything different. Also, when I update the table directly in SQL Server, the result is displayed in single quote. But if I update the field thro' the application, the returned name is with double quotes instead of single quote.  Has any of you faced problems like this? What am I missing? What do I need to do to get the name saved the way I entered (with single quotes) instead of double quotes?

View 1 Replies View Related

Reporting Services :: SSRS 2012 - CSV Rendering / Turn Off Double Quote Qualifier

Sep 29, 2015

I have scoured the Microsoft forums and the internet to find out how I can generate the output of a CSV report that has double quotes around each value and is comma separated as follows:

"Abcd","123456","Efghi","789012","JKLMN"

If I try to concatenate double quotes around the values in the stored procedure or in the RDL, two double quotes appear around each value as follows. 

""Abcd"",""123456"",""Efghi"",""789012"",""JKLMN""

I understand that this is because the default qualifier is double quote.  What I see is that every time a double quote appears in a value (along with commas and line breaks), the qualifier will activate.  Is there any way to turn this off for double quotes? 

If I try to enter:  <Qualifier>false</Qualifier>, the word "false" appears as the qualifier instead.

The only way I have found that produces a result similar to what I need ("Abcd","123456","Efghi","789012","JKLMN") is if I add a line break - chr(10) in the RDL in each field. However, this won't work for me because I can't have line breaks in each field in the output. 

Note that in SSRS 2005, I was able to produce the report output as I state above by setting the field delimiter and qualifier as follows:

<FieldDelimiter>@?!?@</FieldDelimiter>
<Qualifier>?#^?</Qualifier>

This essentially turned the field delimiter and qualifier off, as the values entered would never appear in the data.  I then could add double quotes and commas in the RDL.  This used to work in the old version but does not anymore.

View 4 Replies View Related

Column Row Delimeter Problem

Feb 17, 2006

I'm trying to import a comma delimited text file into a SQL table-

The row delimiters I am assuming are {CR}{LF}

When I try to open up my file in Excel, the data file parses perfectly.

When I try to port it over in SSIS, I get an error:

"The column delimeter for column <my column> was not found."

"An error occurred while processing the file <my file> on data row 2076"

I've tried looking at that data row, and i am having a hard time finding anything wrong with the row.

Anybody know of any good ways to debug that?

View 1 Replies View Related

Truncation Error Arrising From Quote Escaped Quotes In Quote Encapsulated Strings

Feb 15, 2006

Hi All,

I'm having trouble importing a CSV file into SQL using SSIS. The trouble seems to stem from truncation and from quote encapsulated fields.

Firstly it's worth noting that some of the data within the quotes contains the separator. E.g.

12,"some text, and a comma",34

Thankfully SSIS seems to cope with that by specifying " as the Text Qualifier. My next problem was that the SSIS Import and Export Wizard gave an error: "failed because truncation occurred". But I fixed this by specifying the OutputColumnWidth for the NCHAR and NVARCHAR type columns to be the width from the table definition.

But now I have another problem with the length of fields. Consider the following where the center column is NCHAR (22)

101,"some text, and a comma",303
102,"some ""quoted text"" bye",303

The first row has the correct width (once the encapsulating quotes are stripped out), but the second row does not, because it seems that when I exported the table the export wizard escaped the quote characters within encapsulated strings using quote characters. So I am back to getting the "truncation occurred" error. How can I get around this within SSIS?

Cheers,

Tim.

View 1 Replies View Related

Error While Creating Inline Function - CREATE FUNCTION Failed Because A Column Name Is Not Specified For Column 1.

Apr 3, 2007



Hi,



I am trying to create a inline function which is listed below.



USE [Northwind]

SET ANSI_NULLS ON

GO

CREATE FUNCTION newIdentity()

RETURNS TABLE

AS

RETURN

(SELECT ident_current('orders'))

GO



while executing this function in sql server 2005 my get this error

CREATE FUNCTION failed because a column name is not specified for column 1.



Pleae help me to fix this error



thanks

Purnima

View 3 Replies View Related

Use Of Undouble In Package

Sep 19, 2006

HI,

I am using the sample Undouble in a package, which I believe is OK, but when I deploy and run my package it gives me errors:

Message: The component metadata for "component "UnDouble" (1)" could not be upgraded to the newer version of the component. The PerformUpgrade method failed.
Event Name: OnError
Message: The component is missing, not registered, not upgradeable, or missing required interfaces. The contact information for this component is "".

Do I have to distribute the dll for this or is it handled in the deployment of the package?

Thanks

View 5 Replies View Related

Dealing With Quotes In A Quote Encapsluated Column

Jan 16, 2007

I know this issue has been raised here before, but I have a different angle/question on it.

Flat File source, SQL Destination. No column from the source file has a consistent real width, just consistent to be less that the SQL column.

Issue:

CHAR(12), SMALLINT, CHAR(78), BIGINT

"100012",0,"This is the ""Memo"" of the record, it needs to be imported.",12

This row errors out due to the double quotes around the word MEMO. Additionally, the entire package stops processing due to there being a comma in the memo after the quote encapsulation is escaped.

Has this issue been addressed in any of the SP's? If not, how about this thinking:

1.) Character index the pattern ," and take the value of the first instance of the pattern.

2.) Character index the pattern ", and take the LAST instance of the pattern (ignoring the pattern match after the first column).

3.) Replace all double qoutes between the values of the indexes with single quotes.

4.) Proceed with the Comma separated, quote encapsulated import.



Any thoughts? Additionally, if this seems like it may work, does anyone have a clue how to program this in SSIS, or would I be better to run my files through a VBScript parser to accomplish this first?



Thanks in advance.

View 6 Replies View Related

SQL Server Agent SSIS Job: Set Values Drops Leading Quote

Jul 19, 2006

We are using BCP in a Process task. The value for the path to BCP's error log requires double quotes around it. We initially put this value in a configuration file, and that worked fine. Yesterday, we eliminated the config file and tried to use the "Set Values" tab of the SSIS SQL Server Agent job to pass in this value.

The package variable was assigned the value of the path -- all except for the leading double quote. The closing quotation mark was included in the value.

We tried adding a second double quote at the beginning of the value, but that caused the job to fail immediately.

For now we will work around this problem by putting the quotes around the value in a Script task inside the package.

Has anyone else encountered this problem?

Thanks,

Ron

View 2 Replies View Related

SQL Server 2008 :: DOUBLE Precision For Calculations / Convert To Double?

May 19, 2011

I am performing a series of calculations where accuracy is very important, so have a quick question about single vs double precision variables in SQL 2008.

I'm assuming that there is an easy way to cast a variable that is currently stored as a FLOAT as a DOUBLE prior to these calculations for reduced rounding errors, but I can't seem to find it.

I've tried CAST and CONVERT, but get errors when I try to convert to DOUBLE.

For example...

SELECT CAST(1.0/7.0 AS FLOAT)
SELECT CONVERT(FLOAT, 1.0/7.0)

both give the same 6 decimal place approximation, and the 6 decimals make me think this is single precision.

But I get errors if I try to change the word FLOAT to DOUBLE in either one of those commands...

SELECT CAST(1.0/7.0 AS DOUBLE)

gives "Incorrect syntax near )"

SELECT CONVERT(DOUBLE, 1.0/7.0)

gives "Incorrect syntax near ,"

View 2 Replies View Related

DB Engine :: Double Row Added From A Source Table That Did Not Have Double Record

Aug 28, 2014

Every night we connect to a remote server using Linked Server and copy details from that database to a loading table, then load it into the 'real' table in our own environment. The remove database we load it from has indexes/primary keys that match the 'real', however the 'loading' table itself does not have any indexes or primary keys, both are SQL Server 2005 machines.

In the loading table we first of all truncate it then do a select insert statement from the remote server, then we then truncate the 'real' table and load iit from the 'loading' table.

The issue is when we attempted to load it into our 'real' table from our loading table there was a duplicate row, and our process failed with a Primary Key violation.

I checked the source with does have the same primary key's in, it did not contain a duplicate row and I checked the loading table and that did contain a duplicate row.

My question this is in what circumstances this could happen ?

View 5 Replies View Related

Why Column Name On View Require Double Quotation

Dec 2, 2013

I have a view. When I select data, I have to use double quotation on selected column name, for instance:

select "assy_no" from myView;

if I try

select assy_no from myView

I will get error: ORA-00904: "ASSY_NO": invalid identifier

When I query on table, double quotation is not required.

Why the column name on view requires double quotation?

View 1 Replies View Related

Remove Double Quotes From Column Data?

Jun 17, 2014

I imported data from flat file to SQL Server database table. After execution one of column got data with double quotes. It look like:

22222.....02/14/2014....."Smith, John"
333........02/14/2014....."Brownies, Alian"

How to remove quotes?

View 3 Replies View Related

Insert Or Update Into A Image Column Causes Data To Double In Size

Aug 1, 2005

We are experiencing problems inserting or updating image fields fromone table to another in SQL Server.When we do this what ever size of file we insert is doubled in sizewhen it is inserted into the destination table.This happens in insert and update queries, and if we use DTS.Any help would be greatly appreciated

View 3 Replies View Related

Storing A Money Data Item (in SQL Server) In A Double SSIS Variable

Nov 5, 2007

Hi

I have a table in SQL Server with following spec
Table1(Grossamount(money))

I have a SSIS variable called grosstot of type double and use following sql in Execute SQL task in SSIS

Select Sum(Grossamount) from Table1

I then assign the result of above sql stmt to the SSIS variable grosstot within the same Execute SQL task.

it gives me the error :
[Execute SQL Task] Error: An error occurred while assigning a value to variable "grosstot ": "The type of the value being assigned to variable "User::grosstot " differs from the current variable type. Variables may not change type during execution. Variable types are strict, except for variables of type Object. ".



I tried the following sql to no avail

Select CONVERT(numeric (12,2), Sum(Grossamount) from Table1


Your help very much appreciated

View 7 Replies View Related

Flat File With Fixed Length Header And No Delimeter

Aug 21, 2006

Hi,

I'm trying to extract data from a Flat File which is as fixed length as they come. The file has a header, which simply contains the number of records in the file, followed by the records, with no header delimeter (No CR/LF, nothing).

For example a file would look like the following:

00000003Name1Address1Name2Address2Name3Address3

So this has 3 records (indicated by the first 8 characters), each consisting of a Name and Address.

I can't see a way to extract the data using a flat file connection, unless we add a delimeter for the header (not possible at this stage). Am I wrong?

Any suggestions on possible solution would be much appreciated - I'm thinking Ill have to write a script to parse the file manually.

Thanks in advance,

Scott

View 6 Replies View Related

Specifyin The Row Delimeter As Newline (Unix Style) In Bulkinsert Format File

Sep 28, 2007

Hi,

I am bulk inserting the data from a file into a table using the following format.



9.0
1
1 SQLCHAR 0 10 "
" 1 MSISDN SQL_Latin1_General_CP1_CI_AS

This works perfectly for me.

But my problem is that the firmat may not be generated in Windows and i can't user "
" as row delimeter.
It could be generated in Unix and want to use LF as the row delimeter.

Questions :

1) How do i specify this kind of new line (LF ) in formatfile?
2) Is there anyway that i can specify both the delimeters and let it use which ever is appropriate ?

Please provide some inputs on this??

Thank u so much
~Mohan

View 3 Replies View Related

Inline If

Sep 21, 2005

I want to execute something likeselect iif(type='credit',amount*-1,amount) from tablehow can i do that? help file says iif is used in MultidimensionalExpressions but that seems overly complicated for this task.any ideas?

View 1 Replies View Related

Inline SQL

Jun 25, 2007

Hello,



I would like to know if there is any sort of improvement when using Inline SQL vs Stored Procedures as far as the execution plans are concerned when they are used in SSIS packages. I happened to create a SSIS package which calls Stored Procedures but internally they are using Linked Servers to get the data required. At this point they want to know what will be benefit that can be achieved when Inline SQL is used.



I would appreciate if anybody can give their thoughts or provide some informative articles like pros and cons.



Thanks in advance.

View 1 Replies View Related

More Command Inline

Mar 4, 2005

Hi.

"isqlw" is for Query Analizer.

Which is for Enterprise Manager?

View 6 Replies View Related

Inline Sql With An Array

Sep 20, 2006

I have data which looks like below

actid labname
100 CKS
200 CKS;HDP;LAS

I need the data to be

actid labname
200 CKS
200 HDP
200 LAS

The ; is the seperator

For a reporting product I created a sp which created a temp table and then using my function below built. problem is the product won't allow me to create a temp table. With what I have below anyone have any creative ideas I could use. In-line sql, subquery views?

select enc_id,labcnt,order_name,date_due


reate FUNCTION fn_GET_ARRAY_VALUE(
@DELIMITER VARCHAR(100),
@STRING VARCHAR(1000),
@ARRAY_POSITION INT)
RETURNS VARCHAR(8000)
AS
BEGIN
DECLARE @CURRENT_POSITION INT
DECLARE @VALUE VARCHAR(8000)
SET @CURRENT_POSITION = 0

WHILE @CURRENT_POSITION<@ARRAY_POSITION
AND CHARINDEX(@DELIMITER,@STRING,0)>0
BEGIN
SET @STRING =
SUBSTRING(@STRING,
CHARINDEX(@DELIMITER, @STRING, 0)
+LEN(@DELIMITER),
LEN(@STRING)
-CHARINDEX(@DELIMITER, @STRING, 0)
+ LEN(@DELIMITER)
)
SET @CURRENT_POSITION = @CURRENT_POSITION + 1
END

IF CHARINDEX(@DELIMITER,@STRING,0)=0
SET @VALUE = @STRING
ELSE
SET @VALUE = SUBSTRING(@STRING, 0,
CHARINDEX(@DELIMITER, @STRING, 0)
)

RETURN(LTRIM(RTRIM(@VALUE)))
END

View 3 Replies View Related

IF In Query (inline IF)

Mar 10, 2007

Hi, I'm trying to get MSSQL to choose which row to display from a result from a query, but it seems to need an 'IF' or something similar.

My query asks the database to pick out all rows that meet critera X, but sometimes (quite correctly) some of the rows created by query X are duplicates. (A data overlap nothing wrong with the query)

I want to be able to get the query to decide which one of these duplicates to display. There is a unique element.

Example Below

|ID | SYSNAME |DATE |ACTIVE
---------------------------------------------
1 | PC1 | 10/3/7 | 1
2 | PC1 | 10/3/7 | 0
3 | PC2 | 10/3/7 | 1

ID 1 + 2 is the duplicate.

In my example I want to remove ID 1 from the result, I can't use the 'active' column as this will remove ID3 fro the result.
I want the query to recognise the duplicate based on the sysname, then choose to display the result with 0 in it.

Does anyone have a clue what I'm talking about? I'm loosing the plot.

View 1 Replies View Related

Inline Variable Assignment

Jan 22, 2004

I have to write a query for printing multiple barcodes, depending on the quantity of items that came in the store, based on the order number.



DECLARE @num INT
SELECT BarCodes.BarCode, BarCodes.ArticleID, ArticlesTrafic.DocumentID, ArticlesTrafic.TrafficQuantity
FROM BarCodes INNER JOIN
Articles ON BarCodes.ArticleID = Articles.ArticleID INNER JOIN
getAutoNumberTable(@num) ON @num=ArticlesTrafic.TrafficQuantity
WHERE (ArticlesTrafic.DocumentID = @Param2)



The thing i would like to do, is somehow assign a value to @num and pass it to the getAutoNumberTable stored procedure, which generates a table of consequtive numbers, so that each record is displayed multiple times. Is it even possible to do it without using temp tables and loops?

View 1 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved