Showing posts with label specific. Show all posts
Showing posts with label specific. Show all posts

Friday, March 30, 2012

How to rename a file in SSIS

I want to rename a file that is a variable to a fixed file name in a specific folder in SQL Server System Integration Services using the File System Task Editor.

Example: File1.txt to Users.txt or File2 to Users.txt. The source file is a variable the destination file is not. Here is an example of the File System Task Editor

HOW DO I SPECIFY A FIXED OR VARIABLE FOLDER NAME WITH A SPECIFIC FILE NAME???

File System Task Editor

Properties Value

Destination Connection
IsDestinationPathVariable True
DestinationVariable User::ArchivePath
OverWriteDestination True

General
Name Rename a file
Description File System Task

Operation
Operation Rename file

Source Connection
IsSourcePathVariable True
SourceVariable User::ImportFilePath

Thanks

There is more than one way to do it, the last link is run by DTS/SSIS experts you will find most of what you need. Hope this helps.

http://blogs.conchango.com/jamiethomson/archive/2005/09/14/2149.aspx

http://msdn2.microsoft.com/en-us/library/ms140185.aspx

http://www.sqlis.com

Friday, March 23, 2012

How to reference in an expression a cell in a table

Want to reference from a cell on one table to cell in another table.
What is the specific code to do this?=ReportItems!<TextboxName>.Value
<TextboxName> is case-sensitive!
Charles Kangai, MCDBA, MCT
"Smartbiz" wrote:
> Want to reference from a cell on one table to cell in another table.
> What is the specific code to do this?

Friday, February 24, 2012

How to Query to get the Numeric fields Only in the Table

hi Good Day everyone.

how can i query numeric values in the specific fields for example EmployeeID only.

but the field EmployeeID has a datatype of varchar.

for example :

EmployeeID -> Field

001

002

a

b

c

how do i query 001 and 002 only. tnx

here it is,

Code Snippet

Create Table #employee (

[EmployeeID] Varchar(100)

);

Insert Into #employee Values('001');

Insert Into #employee Values('002');

Insert Into #employee Values('a');

Insert Into #employee Values('b');

Insert Into #employee Values('c');

Insert Into #employee Values('1E2');

Insert Into #employee Values('.');

Insert Into #employee Values('$');

Insert Into #employee Values('E0');

Select

*

from

#employee

Where

Isnumeric([EmployeeID]) = 1

And [EmployeeID]not like '%[^0-9]%'

|||Thanks Manivannan.D.Sekaran it helps me a lot.

how to query rows followed by specific rows

we have transaction data as below

id tcode

1 AB

2 AB

3 CD

1 EF

2 AB

2 EF

4 GH

3 AB

We want to query only rows with transaction code AB followed by transaction code EF. I mean, when we query the sample data above the result should contain only rows in bold.


You are going to find this to be virtually impossible.

There is NO guarantee that SQL Server will store consecutive entries in contigious space, e.g, row order cannot be relied upon -UNLESS you create a CLUSTERED index. And a clustered index will most certainly change the row sequence.


OR, there is another field in the table that indicates row order, i.e., an IDENTITY field.

|||

You can use the following query...But take care Arnie Rowland suggestions..

Code Snippet

select *,Identity(int,1,1) as RowId into #Data From data2

Select id,tcode From #Data
Where rowid in
(
Select A.RowId from #Data A
Join #Data B on A.RowId = B.RowId -1 And A.id=B.Id And A.tcode='AB' And B.tcode='EF'
Union
Select B.rowid from #Data A
Join #Data B on A.RowId = B.RowId -1 And A.id=B.Id And A.tcode='AB' And B.tcode='EF'
)