Using Other Columns To Populate Filename...

Feb 23, 2006

Basically like the topic says, I need to populate a filename with data from other columns and im having a tough time doing it.

Code:


UPDATE nice_cls_calls_0027
SET vcarchivepath = 'G:Nice Storage
icestorage.safeautonet.netSafe Auto Task - Logger (807101)2006_feb_1SC_807101_'start_time'_'=stop_time'_'=channel'_'=cls_call_id'.aud'


I need start_time, stop_time, channel, and cls_call_id to populate the filename. The first 2 are datetime fields in the db and no conversion is needed for them, just raw data. The remaining two are smallint and raw data is needed there also. Any help would be greatly appreciated. TY

View 4 Replies


ADVERTISEMENT

Need To Populate Columns For Whole ID

Feb 2, 2015

I have data like below, I need to populate the ID_INDICATOR columns with the below condition

ID TASK_ID TASK_COMPLETEDTSTASK_DUETSTASK_INDICATORID_INDICATOR
112014-06-09 00:00:002014-06-11 00:00:00GREEN
122014-06-13 00:00:002014-06-14 00:00:00AMBER
132014-06-17 00:00:002014-06-16 00:00:00RED
142014-06-17 00:00:002014-06-18 00:00:00AMBER

Condition:
##########

Red = If ID due date was overdue, i.e. if last task completed after the ID end date(2014-06-18 00:00:00).
AMBER= If any task in the ID is overdue but completed before the ID end date(2014-06-18 00:00:00)
Green = If all tasks were completed on time.

I am looking for the logic to implement the AMBER for the whole ID, because the TASK_ID 3 is overdue, but completed before the ID end date (2014-06-18 00:00:00).

View 6 Replies View Related

Insert Trigger To Populate Other Columns In Same Row

Sep 22, 2006

I'm looking for an efficient way to populate derived columns when Iinsert data into a table in SQL Server. In Informix and PostgreSQLthis is easily done using the "for each row..." syntax, but all I'vebeen able to come up with for SQL Server is the following:create table testtrigger(id integer unique, b integer, c integer)gocreate trigger testtrigger_ins on testtriggerfor insert asupdate testtrigger set c = (select ...some_function_of_b... fromtesttrigger t1,inserted t2where t1.id = t2.id)where id in (select id from inserted);gowhere id is testrigger's unique id field, and c is a field derived fromb.This seems terribly inefficient since each insert results in an extraselect and update. And if the table is large and unindexed (which itcould be if we are bulk loading) then I would imagine this would bevery slow.Are there any better ways of doing this?Many thanks,...Mike Dunham-Wilkie

View 2 Replies View Related

How Do I Populate A Formview From Multiple Columns In A Gridview

Jun 29, 2006

Hi,
I have a master/detail scenario whereby to populate a formview, the user selects a row in the gridview.  The SqlDataSource used to populate the formview needs to check 2 columns from the gridview, ZRef (which is the SelectedValue of the Gridview) and ZName (a string).
From searching the forums it looks like I have to programmatically assign the SelectParameters in order to get ZName from the gridview.  Seems fair enough, so I set the parameters in the 'Selecting' event of the SqlDataSource.  (Code shown below).
 However the formview never shows.  In debug I can see that the values I'm setting in the SelectParameters.Add are correct; and if I set the default values for those parameters in the SqlDataSource itself, everything works fine.
Can anyone point me to some sample VB code that does this - I'm sure this must be a common situation.
Thanks.
Protected Sub sdsOff_Selecting(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.SqlDataSourceSelectingEventArgs)
Dim tmpSDS As SqlDataSource
Dim tmpLBL As Label
tmpSDS = CType(FormView1.FindControl("sdsOff"), SqlDataSource)
If tmpSDS Is Nothing Then
      Server.Transfer("ErrorOnPage.htm")
End If
tmpLBL = Me.GridView1.Rows(GridView1.SelectedIndex).FindControl("lblName")
If tmpLBL Is Nothing Then
      Server.Transfer("ErrorOnPage.htm")
End If
tmpSDS.SelectParameters.Clear()
tmpSDS.SelectParameters.Add("ZRef", GridView1.SelectedValue)   'In debug, this shows 7 - which is correct
tmpSDS.SelectParameters.Add("ZName", tmpLBL.Text)  'In debug, this shows 'Fred Bloggs' - which is correct
End Sub
 

View 5 Replies View Related

Parse XML Attributes And Populate Columns Within DB With Stripped Data

Nov 16, 2011

I'm trying to write a stored procedure that will parse XML attributes and populate columns within a DB with the stripped data. I'm a complete novice who prior to this week knew nothing about SQL commands, My understanding at least is that I need to perform a bulk insert.

Example XML file:

<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE Asset_Collection SYSTEM "Asset_Collection.dtd">
<Asset_Collection>
<Collection_Metadata
Name="Asset Collection"
Description="Random XML Feed Test"

[Code] ....

Table/Columns which need to be inserting into:
Table:
TABLE_A

Columns:
ProdID
CustomerID
AreaCode

View 4 Replies View Related

Loop Through A Recordset To Populate Columns In A Temp Table

Jul 23, 2005

I want to take the contents from a table of appointments and insert theappointments for any given month into a temp table where all theappointments for each day are inserted into a single row with a columnfor each day of the month.Is there a simple way to do this?I have a recordset that looks like:SELECTa.Date,a.Client --contents: Joe, Frank, Fred, Pete, OscarFROMdbo.tblAppointments aWHEREa.date between ...(first and last day of the selected month)What I want to do is to create a temp table that has 31 columnsto hold appointments and insert into each column any appointments forthe date...CREATE TABLE #Appointments (id int identity, Day1 nvarchar(500), Day2nvarchar(500), Day3 nvarchar(500), etc...)Then loop through the recordset above to insert into Day1, Day 2, Day3,etc. all the appointments for that day, with multiple appointmentsseparated by a comma.INSERT INTO#Appointments(Day1)SELECTa.ClientFROMdbo.tblAppointments aWHEREa.date = (...first day of the month)(LOOP to Day31)The results would look likeDay1 Day2 Day3 ...Row1 Joe, PeteFrank,FredMaybe there's an even better way to handle this sort of situation?Thanks,lq

View 11 Replies View Related

How To Concatenate Variables For RAW Output Filename I.e.@path + @filename?

Sep 7, 2007

Doesn't appear you can do this.

Am I wrong?

Please tell me I am.

View 11 Replies View Related

SSIS Execution Error: FlatFile Connection Problem - FileName &&<fileName&&> Specified In The Connection Was Not Valid.

Apr 19, 2008



Hi Champs,

Scenario Configuration : VB.net 2005 Code, WebService for Executing SSIS on Server, SSIS deployed on the Database Server

Problem Description : We are developing windows applicaiton in which we call webservice which was deployed on the same server where SSIS packages are deployed.
Now from Code we are passing FilePath name in variable and execute the Package. But the SSis result says that
The file name "\computernamefol1fol2fol3fol4abc.txt" specified in the connection was not valid.

More Information:

1. Full Permission are given on this network folder.
2. Package executes successfully from SSIS development solution (BIS solution)
3. Deployed packed executes successfully from the Database Server.
4. From Development pc packege executes successfully.
5. Other packages deployed on the same server executed suucessfully with same configuration and scenario.

Only this package is not executing.


-- the only differece with this package with other is -

using ".txt" extension in Flat file connection and using VB Script task


Can any one suggest the appropirate solution for this problem...

Thanks
Tarang Pandya

View 21 Replies View Related

RS2k Issue: PDF Exporting Report With Hidden Columns, Stretches Visible Columns And Misplaces Columns On Spanned Page

Dec 13, 2007

Hello:

I am running into an issue with RS2k PDF export.

Case: Exporting Report to PDF/Printing/TIFF
Report: Contains 1 table with 19 Columns. 1 column is static, the other 18 are visible at the users descretion. Report when printed/exported to pdf spans 2 pages naturally, 16 on the first page, 3 on the second, and the column widths have been adjusted to provide a perfect page span .

User A elects to hide two of the columns, and show the rest. The report complies and the viewable version is perfect, the excel export is perfect.. the PDF export on the first page causes every fith column, starting with the last column that was hidden to be expanded to take up additional width. On the spanned page, it renders the first column on that page correctly, then there is a white space gap equal to the width of the hidden columns and then the rest of the cells show with the last column expanded to take up the same width that the original 2 columns were going to take up, plus its width.

We have tried several different settings to see if it helps this issue or makes it worse. So far cangrow/canshrink/keep together have made no impact. It is not possible to increase the page size due to limited page size selection availablility for the client. There are far too many combinations of what the user can elect to show or hide to put together different tables to show and hide on the same report to remove this effect.

Any help or suggestion on this issue would be appreciated

View 1 Replies View Related

Get Just Filename

May 23, 2008

If you use "SELECT filename FROM sys.sysdatabases" this will return
the full path , such as "E:MSSQLdatamyData.MDF" ,

is it possible to return just the "myData.MDF" part of it?
I know that you can parse the string , but is it stored somewhere else , or is there a command that will return just the physical file name ?

Jack Vamvas
--------------------
Search IT jobs from multiple sources- http://www.ITjobfeed.com

View 1 Replies View Related

Add Seq# To Filename

Mar 25, 2008

Hi Guys, got a question that I'm not sure there is an answer to other than 'No Way'.

I have to export a file whose filename must include a sequence number. I have created the table to hold the seq# and the code to increment it. My problem is how do I include the seq# in the output filename. I am using the Flat File Destination tool for exporting. should I be using another tool?

Any suggestions?

Thanx,
Trudye

View 2 Replies View Related

Logical Filename

Jun 19, 2002

Hello,

Is there any way to change the logical filename of exsiting database

Thanks
Lara

View 1 Replies View Related

Getting FILENAME Into @variable In SQL

Oct 10, 2001

Does anyone know how to execute a directory listing of a file and return the file name to a variable in SQL? For instance, there's a file called c:datach20011010.txt and i execute the following:
xp_cmdshell 'dir  c:datach*.txt'

or any other transact sql or procedure, how can i get the filename into a variable...all in sql?

FYI - I need to pass a filename to a process so that it can bcp the data into a temp table. But I don't know the filename at the time the process is setup/scheduled.

TIA,
Mike Nolen

View 3 Replies View Related

Get Filename Dynamiccaly

Jul 26, 2007

Hi,
I am using a foreach loop to go through the .txt files inside a folder.
Using a variable I can pickup the filenames the loop is going through.
At present there is a sql task inside the foreach loop which takes the filename as a parameter and passes this filename to a stored procedure.
Now I would like to add one extra step before this sql task. Would like to have a dataflow with flatfile source which connects to oledb destination.

The question is:
While in the loop, how is it possible to pass the filename to the flatfile source using the FileName variable which I have created?

Please note, this is a different question to my other post.

Many Thanks

View 1 Replies View Related

Ssis - Filename

Jul 26, 2007

Hi,
I think I may have mis-guided some of you in my previous post.
So I thought I explain it properly this time in a new post...

Here is the description of the ssis package:

Inside the connection manager there is a connection to the sql server database and a flat file connection.

The flat file connection inside the connection manager has the expression set
i.e. ConnectionString set to @[User::FileName]

And so there is nothing inside the connectionstring property of this flatfile connection.

Inside control flow:

1)

Dataflow which contains a flat file source and an ole db destination

The flatfile source is supposed to pickup the .csv file that gets passed to the ssis package.
Then the ole db destination is where the .csv gets imported into a sql server table.

2)

Back in the control flow, there is a task that calls a stored procedure with the parameter which is set to FileName

The question is:
How does this FileName parameter gets set before it is passed to the stored procedure?

Many thanks

View 1 Replies View Related

How To Read Filename

Mar 28, 2008

HI,

I am writing data from a file in to a table and i have a field in that table for filename. How to read the file name to write in that table.

Thanks in advance.

View 4 Replies View Related

Get Filename Dynamically

Jul 26, 2007



Hi,
Using a ssis package I have several tasks.
A variable is also created called FileName.
There is a flat file connection called InputFileName.
initially when I designed the package, I hardcoded the pass of one of the .csv files into the path of the flatfile connection.

There is a dataflow which has flatfile source and oledb destination. These two basically pickup the file and import into the database using mapping.

So therefore the package works and data gets imported into the database.

Then I used the variable to make the filename dynamic. So I removed the hardcoded connectionstring in the InputFileName.

Is this the right thing to do to make the package dynamic? I would like to pass in any .csv filename and so the package runs.
My question is now that the connectionstring is deleted but instead placed an expression for the filename, then how does the system know which file to use?

Thanks

View 1 Replies View Related

Pass Filename

Jul 11, 2007

Using SSIS foreach loop I get the files names inside a folder on the network.
How do I pass this variable i.e. file name to a stored procedure?
Thanks

View 9 Replies View Related

Looking For A Filename With A Certain String

Feb 27, 2008

Hi, I want to get my SSIS package to look for a file in a named directory that has a ceratin string in the filename.
example - My file is in a folder called data and the filename is 'System_UT_INCR_BOOKINGHEADER_20080214000000.TXT' Every day the fiel name changes to reflect the current date. I need my package to search for the String "BOOKINGHEADER". I know I need to create a variable with that value but I am not sure (using the example below) how to write the code to do this.




Imports System.IO

Imports System

Imports System.Data

Imports System.Math

Imports Microsoft.SqlServer.Dts.Runtime

Public Class ScriptMain



Public Sub Main()

Try

File.Move(Dts.Variables("Source").Value.ToString, Dts.Variables("Destination").Value.ToString)

Dts.Events.FireInformation(0, "", "File Moved Succesfully", "", 0, True)

Catch ex As Exception

Dts.Events.FireError(1, "", "Source file or destinations does not exist", "", 0)

End Try

Dts.TaskResult = Dts.Results.Success

End Sub

End Class

View 3 Replies View Related

T-sql Check A Filename

Sep 11, 2007

I take a backupfile every night and its named like 20070911_xvall.bak.
Now I need a procedure for an automatic restore in another sql server but I have to do a check to se that the date of the backupfile is the same as actual date so it can¨t happened that an older backupfile being restored.
Is it a good way to take actual date och build up the wanted filename and how can I then check if the file exist, its stored on another computer?
Anyone who has some sample I can start with?
Thanks

View 10 Replies View Related

Filename In Subscription

Feb 15, 2006

Hello,

I have a question regarding the report file which is included in an email, when a subscription is created:

Is it possible to programmatically add something to the name of the created file of the subscription? I want to have one parameter of the report, which is a date, added at the end of the filename to let the clients distinguish between different report files.

Thank you in advance.

Sandra Geisler

View 2 Replies View Related

Filename In SSIS

Apr 28, 2008

i have four text file which comes in different format , one of the fields i need to generate is the source Filename without extension as one of the coloums in the target tables.

The name of the file is requirment in the destination, how could i read the file name of the text file source and make it a coloumn and insert it into target.

Please advise



View 12 Replies View Related

The Database Filename Can Not Contain The Following 3 Characters: [ ] And '

Aug 3, 2006

How do I correct this error: 
"The database filename can not contain the following 3 characters: [ (open square brace), ] (close square brace) and ' (single quote)" ?
Where is the database stored and/or how can I change the relevant settings?
I have Both Visual Web Developer Express and SQL server express.
Exception detail:
System.Web.HttpException was unhandled by user code  Message="The database filename can not contain the following 3 characters: [ (open square brace), ] (close square brace) and ' (single quote)"  Source="System.Web"  ErrorCode=-2147467259  StackTrace:       at System.Web.DataAccess.SqlConnectionHelper.CreateMdfFile(String fullFileName, String dataDir, String connectionString)       at System.Web.DataAccess.SqlConnectionHelper.EnsureSqlExpressDBFile(String connectionString)       at System.Web.DataAccess.SqlConnectionHelper.GetConnection(String connectionString, Boolean revertImpersonation)       at System.Web.Profile.SqlProfileProvider.GetPropertyValuesFromDatabase(String userName, SettingsPropertyValueCollection svc)       at System.Web.Profile.SqlProfileProvider.GetPropertyValues(SettingsContext sc, SettingsPropertyCollection properties)       at System.Configuration.SettingsBase.GetPropertiesFromProvider(SettingsProvider provider)       at System.Configuration.SettingsBase.SetPropertyValueByName(String propertyName, Object propertyValue)       at System.Configuration.SettingsBase.set_Item(String propertyName, Object value)       at System.Web.Profile.ProfileBase.SetInternal(String propertyName, Object value)       at System.Web.Profile.ProfileBase.set_Item(String propertyName, Object value)       at System.Web.Profile.ProfileBase.SetPropertyValue(String propertyName, Object propertyValue)       at ProfileCommon.set_MyNewProperty(String value) in c:WINDOWSMicrosoft.NETFrameworkv2.0.50727Temporary ASP.NET Fileslesson04385e3cebf08b8b90App_Code.jqcpv0qn.0.cs:line 24       at _Default.Page_Load(Object sender, EventArgs e) in D:Daniel's DocumentsVisual Studio 2005WebSitesLesson04Default.aspx.vb:line 15       at System.Web.UI.Control.OnLoad(EventArgs e)       at System.Web.UI.Control.LoadRecursive()       at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
Thanks in advance
 

View 3 Replies View Related

Store A Filename In A Database

Dec 13, 2006

how can I  store a filename in the database, i have some GIF files which i want to show up on report, how can i specify those filename with a path in the database.
i tried manually entering the path c:Dataimages.gif but it didnt work. Can someone pls tell me how to do it.
 
Regards,
Karen

View 5 Replies View Related

Inserting Filename Into Database

Mar 7, 2008

I have a page called 'upload.vb', which is the code for a file upload project I am working on.  I am trying to write the filenames to an SQL database that I have built, but I keep getting this error: Compiler Error Message: BC30201: Expression expected. It doesn't seem to like the @ on line 46 in the VALUES part of my INSERT statement. Can anybody shed any light on this. Thanks.  1 Imports System
2 Imports System.Data
3 Imports System.Configuration
4 Imports System.Web
5 Imports System.Web.Security
6 Imports System.Web.UI
7 Imports System.Web.UI.WebControls
8 Imports System.Web.UI.WebControls.WebParts
9 Imports System.Web.UI.HtmlControls
10 Imports System.IO
11 Imports System.Data.SqlClient
12
13 ''' <summary>
14 ''' Upload handler for uploading files.
15 ''' </summary>
16 Public Class Upload
17 Implements IHttpHandler, IReadOnlySessionState
18
19 Public Sub New()
20 End Sub
21
22 #Region "IHttpHandler Members"
23
24 Public ReadOnly Property IsReusable() As Boolean Implements System.Web.IHttpHandler.IsReusable
25 Get
26 Return True
27 End Get
28 End Property
29
30
31
32 Public Sub ProcessRequest(ByVal context As HttpContext) Implements IHttpHandler.ProcessRequest
33
34 If context.Request.Files.Count > 0 Then
35 ' get the applications path
36 Dim tempFile As String = context.Request.PhysicalApplicationPath
37 ' loop through all the uploaded files
38 Dim j As Integer = 0
39 While j < context.Request.Files.Count
40 ' get the current file
41 Dim uploadFile As HttpPostedFile = context.Request.Files(j)
42 ' if there was a file uploded
43 If uploadFile.ContentLength > 0 Then
44
45 uploadFile.SaveAs(String.Format("{0}{1}{2}", tempFile, "Uploads", uploadFile.FileName))
46 SqlDataSource.InsertCommand = "INSERT INTO tblDocuments(TheFileName) VALUES ('" & @TheFileName & "')"
47
48 End If
49 System.Math.Max(System.Threading.Interlocked.Increment(j), j - 1)
50 End While
51 End If
52 ' Used as a fix for a bug in mac flash player that makes the
53 ' onComplete event not fire
54 HttpContext.Current.Response.Write(" ")
55 End Sub
56 #End Region
57
58 End Class
    

View 10 Replies View Related

How To Load XML From Filename And Path

Sep 6, 2005

Hi,
I have inherited a database that has a table called "Resources" that contains a field called "FilePath". FilePath is a VarChar(100) and contains the server path and filename of an XML file on the server hard disk.
I need to join the data in the XML with rows in the "Resources" table (and other tables).
Is it possible to get a Stored Procedure to load the XML file into a temporary table?
Is loading it into a table the best way to do it - or can I join directly to the XML file somehow?
What is the best approach? (I know nothing about XML in SQL Server yet)
Thanks in advance,
Chiz.

View 3 Replies View Related

Changing Source Filename In DTS

Dec 15, 2005

Hi!

Is there a way I can make the source file in my DTS dynamic so that every time I run it using ASP I can tell it which file to use?

View 1 Replies View Related

Using DTS .. Dynamic Dest Filename

Jan 30, 2006

I need to use DTS to create a dynamic destination filename based on the value of a field. I tried creating a DTS package using the wizard. It works fine if I wanted a static filename for the destination filename. I tried creating a Dynamic Properties Task by selecting Connection2/OLEDB Properties/Data Source and then using a SQL Statement to return a value for the name of the file. It doesn't seem to run the query everytime the DTS is ran. The first time I run it it names the file correctly but after that it keeps naming the file the old value from the SQL statement. Any idea what I need to do to fix this?

View 5 Replies View Related

Question On Getting The Date Value Into A Filename

Dec 18, 2006

I am running the following sqllitespeed backup script on Windows 2003 Server
against SQL Server 2000



sqllitespeed -Bdatabase -T -DNorthwind -FH:MicrosoftSQLServerBACKUPSDATABACKUPSNorthWi ndorthwind.bak


How could I place the date variable into the output filename?

I've tried variations of %date% etc but nada.

Any thoughts?

Thanks in advance.

Gerry

View 3 Replies View Related

Extracting Filename From Path

Nov 8, 2013

I have to extract only the filename from the below filepath.

The first part prodserverexport always remains the same. A new folder is created prodserverexport 20071001, prodserverexport 200710012 etc each time the file is dropped . I want to extract only the part after that namely 20071001-200001-e430f8fd-PREC272.wma and like wise and dump it into a table.

prodserverexport2007100120071001-200001-e430f8fd-PREC272.wma
prodserverexport2007100220071002-013203-d00b2007-PREC120.wma
prodserverexport2007100220071002-032038-18381b92-PREC207.wma
prodserverexport2007100820071008-144758-16359a7b-PREC224.wma
prodserverexport2007100920071009-170426-4ed3535c-PREC97.wma

View 7 Replies View Related

Updating Field But Not Filename

Jan 22, 2007

I want to change the following field in the database - text field.

Want it to be like this,

C:ProgramFilesHEATHEATSelfServiceattachmentsWinter019997.htm

want it to be H:2007Winter019997.htm

My aim is to move the files from C: to H: drive and update the database to reflect this. Thanks

Thsi is my code;

declare @str varchar(1000)
UPDATE heatgen
set @str = 'c:Program FilesHEATHEATSelfServiceattachmentsWinter019997.htm'
select reverse(@str)
select charindex('', reverse(@str))
select right(@str, charindex('', reverse(@str)))
select 'H:2007' + right(@str, charindex('', reverse(@str)))

SET gdetail = 'H:2007' + RIGHT(gdetail, CHARINDEX('', REVERSE(gdetail)))

The field is text I get error

Line 9: Incorrect syntax near '='.

Thanks.

View 19 Replies View Related

Variables Holding Filename

Feb 8, 2007

I already posted this question in the Wrong Forum.

However I was wondering if it is possible to create a variable that holds the filename as an expression. I am using a For each loop to pick up files and i want to insert the 'Filename' as a colum so that i can differentiate among the rows in my destination Table.

Using the 'Derived Colum' in DTS I can link the colum to the variable. However i do not know how to create the variable which will store the filename for each file....

Any Clues...
Would really appreciate the help.....

View 2 Replies View Related

How To Read A Filename Into A Variable

Jan 14, 2008

I'm trying to read the filename from a file that I'm downloading by FTP (FTP Component) into a string variable so I can later use it for another part of the process, how can I do this?

View 2 Replies View Related







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