DTS Import Stores The Last {LF} In Table.

Sep 7, 2006

Hi i have a csv file where the last column usually happens to be null. So my file is like this:
1,2,3,,{LF}
4,5,6,,{LF}
7,8,9,,{LF}
{CR}

I run the dts export from csv file to db and it doesnt save the last row (column5) in the table us null. instead it stores the {LF} character. Ascii =10. How can i resove this problem.
the csv comes from a third party application. the DTS needs to un automatically and somehow resolve that last problem on its own. but how??? is there a code that can trim the last character in the last line to delete the last {LF} or some query in DTS that can achive this.....

View 4 Replies


ADVERTISEMENT

Table Which Stores Report Name

Feb 5, 2008

Hi All,

Please let me know within Reporting server database which table stores the actual report name,keywords and author of the report.

I want to search the report based on the report name using my own custom code.It will be helpfull if i get the table name so that i can fire select query.

Thanks in advance,
Prabhanjana

View 1 Replies View Related

Should I Have A Table That Stores A Subset Of Data From Other Tables???

Mar 21, 2007

DB design question

I have multiple tables with information about a user. The tables are Roles, Users, Groups and Profiles.

For a user session I need information from all those tables. Would it be better to make a table called UserSession and collect the necessary data from the above mentioned tables and stick them in one the UserSession table or should I just write a query that goes out and gets the data from the different tables.

What is better practice and what is faster?

View 4 Replies View Related

SQL Server Import And Export Wizard Fails To Import Data From A View To A Table

Feb 25, 2008

A view named "Viw_Labour_Cost_By_Service_Order_No" has been created and can be run successfully on the server.
I want to import the data which draws from the view to a table using SQL Server Import and Export Wizard.
However, when I run the wizard on the server, it gives me the following error message and stop on the step Setting Source Connection


Operation stopped...

- Initializing Data Flow Task (Success)

- Initializing Connections (Success)

- Setting SQL Command (Success)
- Setting Source Connection (Error)
Messages
Error 0xc020801c: Source - Viw_Labour_Cost_By_Service_Order_No [1]: SSIS Error Code DTS_E_CANNOTACQUIRECONNECTIONFROMCONNECTIONMANAGER. The AcquireConnection method call to the connection manager "SourceConnectionOLEDB" failed with error code 0xC0014019. There may be error messages posted before this with more information on why the AcquireConnection method call failed.
(SQL Server Import and Export Wizard)

Exception from HRESULT: 0xC020801C (Microsoft.SqlServer.DTSPipelineWrap)


- Setting Destination Connection (Stopped)

- Validating (Stopped)

- Prepare for Execute (Stopped)

- Pre-execute (Stopped)

- Executing (Stopped)

- Copying to [NAV_CSG].[dbo].[Report_Labour_Cost_By_Service_Order_No] (Stopped)

- Post-execute (Stopped)

Does anyone encounter this problem before and know what is happening?

Thanks for kindly reply.

Best regards,
Calvin Lam

View 6 Replies View Related

Stores Procedure

May 5, 2005

I am trying to select the HdwId value of a table named "tblHdw" and trying to insert it into the HwdId field in a table named "tblLoc". 

If you have any suggestions?

Thanks,
MattyPee

View 1 Replies View Related

Use VB DLL In A Stores Procedure?

Feb 14, 1999

I read in a technical journal (somewhere) that it is possible to create a ActiveX DLL in Visual Basic and use the DLL in a stored procedure. There were some limitations (because of stored procedures) but this is still a very powerful feature. Has anyone ever heard of this or read about this? Is there s source for explanation and examples?

Thanks, Rich.

View 1 Replies View Related

Returing ADO Recordset From Stores Procedure

Nov 24, 2003

I have a Stored Procedure that I am calling from ADO 2.7 in Visual Basic. The process works fine when the stored procedure has records to return. However , when the recordset is return emtpy ADO does not recognize the recordset as being open and empty. For example:
VB Code to open recordset:
Set rstClass1 = New ADODB.Recordset
With rstClass1
.CursorLocation = adUseServer
Set .ActiveConnection = DBConn
.Source = strRecordSource
.LockType = adLockOptimistic
.CursorType = adOpenKeyset
.Open
If Not .EOF Or Not .BOF Then

The program bombs on the If Not .EOF statement with Error 3704 -
"Operation is not allowed when the object is closed.


When I run the Stored Procedure In QA using an ID that I know will NOT return any records the result window returns nothing. I noticed that on some of my other SP's the result window will at least return the column titles. These SP's also do not produce the 3704 error in ADO.

Is there a command or a certain method to construct my SP so that is will return enough for ADO to know that the recordset did open its just empty?

The SP is ugly looking but I will post if need be.

View 3 Replies View Related

I Need To Know Where Mssql Server Stores Its Data.

Jan 19, 2008

Hello,I need to learn where mssql server stores its data. I knew it was inProgram filesCommon filesBut I cant find.. Its urgent pls..Thanx

View 4 Replies View Related

Date Format SSRS Stores In DB

Feb 25, 2008



Hi,
I have report scheduled in a SSRS. SSRS creates a job and from MSDB.DBO.SysJobActivity the

Next_Scheduled_Run_Date column provides the next execution date of the report.

Can any one tell me what is the date format that SSRS stores is it a getdate() or a UTC Date??

View 1 Replies View Related

Pass Sorting Parameter To Stores Procedure

Feb 23, 2004

I used Datagrid to show "Title", "Location" and "Date", It works very well.
I want to sort DataGrid data, that is when user click the "Title", "Location" or "Date",
my asp.net code will through class and send "Sort" parameter to stores procedure to get the new data and bind to DataGrid.

Here is my stores procedure:

CREATE Procedure JobSearch
(
@Search varchar(150),
@Sort varchar(50)
)
AS

SELECT
JobTitle,
JobLocationCity,
JobLocationState,
PostDate

FROM
Job

WHERE
JobTitle LIKE '%' + @Search + '%'
OR
JobKeywords LIKE '%' + @Search + '%'

IF @Sort = "Title"
ORDER BY JobTitle
IF @Sort = "Location"
ORDER BY JobLocationState, JobLocationCity
IF @Sort = "PostDate"
ORDER BY PostDate DESC

When I test stores procedure in SQL Server, I got the error about "Error 156: Incorrect syntax near the keyword 'ORDER' ".

Who has experience about stores procedure, please help me to correct this error.

View 12 Replies View Related

Using A Variable That Stores The Query String For WHERE Condition

Feb 20, 2001

Hi, I was wondering if someone could help out. I need to create a stored procedure, but before i do so, I need to know if I can store a conditional expression in a string and just use that variable as my condition for the WHERE clause. The reason I ask this is because I am trying to create a stored procedure that queries different things depending on what the inputs are.

View 2 Replies View Related

Stores Procedure - Must Declare Scalar Variable

Apr 7, 2015

I am creating a SP below and it keep saying must declare scalar variable @comments,I have already declared @comments varchar (255)

error---> (Msg 137, Level 15, State 2, Procedure CheckPatientComments, Line 26
Must declare the scalar variable "@commnets".
)

quote:
CREATE PROCEDURE [dbo].[CheckPatientComments] (@enc_id varchar(36) OUTPUT, @data_ind CHAR(1) OUTPUT)
AS
BEGIN
DECLARE
@comments varchar(255)

[code]....

View 2 Replies View Related

Help With 2 Datetime Fields-1 Stores Date, The Other Time

Jun 9, 2006

Hi,We have a lame app that uses 2 datetime(8) fields, 1 stores the date, theother the time.example query:select aud_dt, aud_tmfrom ordersresults:aud_dt aud_tm2006-06-08 00:00:00.000 1900-01-01 12:32:26.287I'm trying to create a query that give me records from the current date inthe past hour.Here's a script that gives me todays date but I cannot figure out the time:select aud_dt, aud_tm, datediff(d,aud_dt,getdate()), datediff(mi, aud_tm,getdate())from orderswhere (datediff(d,aud_dt,getdate()) = 0)results:aud_dt aud_tmdatediff(0=today) timediff (since 1900-01-01)2006-06-08 00:00:00.000 1900-01-01 12:32:26.287 055978689I added this next part to the above query but it does not work since thedate/time is from 1900-01-01and (datediff(mi, aud_tm, getdate()) <= 60)Thanks for any help.

View 2 Replies View Related

Activated Stores Procedure And Batch Processing

Aug 2, 2006

Hi There

2 Questions :

1. Almost in every SB example you will see this sql :

BEGIN TRANSACTION

WAITFOR (

RECEIVE TOP (1)

@MessageType = message_type_name,

@Message = message_body

FROM [Queue1]

WHERE conversation_handle = @ConversationHandle

), timeout 5000;

If this sql in an activated sp do you really have to have the waitfor ? Since the sp will only be fired if there is a message on the queue ?

2. It is reccomended that for high volume SB apps you do not do a top(1) receive but process batches. Exactly what is the best practice to do this. Receive a batch into a table variable and then what ? Process through it with a cursor ? That is not very efficient either, i would just like some insight into batch queue processing as everywhere i have seen uses top (1) from the queue ?

Thanx

View 3 Replies View Related

Transact SQL :: Inventory Difference Between Rows Between Stores

May 8, 2015

how to measure a change in inventory over various stores.  My sql2008R2 express db gets a new row of data everyday from each store(about 40 stores) for a single product stock count "OnHand" and if there is any new stock on order.  When the new stock arrives it is added to the "OnHand" count.   I want to measure the delta change per day,per store.  I'm stuck on how to separate the stores and how to query the delta of stock.My data base looks like this
                               
TimeStamp Store
OnHand OnOrder
2015/04/22 18   1 - Concord
12
     0
2015/04/23 11   1 - Concord
11
 
[code]....

View 17 Replies View Related

Multiple Stores Orders To Sink Up With Main Server

May 4, 2007

Hello,

Say there are 10 retail store locations that need to push their daily sales to the main server at the head office.

What techniques are used to accomplish this? I'd imagine the transaction rows would have to be some sort of a GUID.

What options are there? What techniques are used to ensure each stores orders have indeed been pushed to the main server?

View 3 Replies View Related

Execute SQL Task With Full Result Set Stores Data As What?

Oct 22, 2007

Howdy all,

I have an Execute SQL Task that may return a result set. If it returns a result set, I'd like to log a failure in my package with the results visible.

I have logging turned on and that's working great. I've read about assigning results to a user variable of type Object and that's great. I can shred my results, thanks Jamie, with a Foreach loop no problem. Within that loop, I've got some VB that manipulates the values and will call Dts.Events.FireError as appropriate. However, VB is frowned upon here so my boss has asked that I push the VB logic into a Control Flow item.

I've built custom components already so I've got some familiarity with the process. Where I'm stuck at is figuring out _what_ the actual object type is in my code. The Connection manager is Native OLE DBSQL Native client. My Execute SQL Task uses a connection type of OLE DB with a Full result set. Results are stored in a variable named ErrorResultSet. Within the Execute method, I currently have this code set up in an attempt to pick apart the object and discover the available methods.





Code Block
Variables _variableCollection = null;
if (variableDispenser.Contains("ErrorResultSet"))
{
variableDispenser.LockForRead("ErrorResultSet");
}
variableDispenser.GetVariables(ref _variableCollection);

// Iterate through the variables that we were
// able to lock. Assigning values to entities as
// available.
foreach (Variable _en in _variableCollection)
{
switch (_en.Name)
{
case "ErrorResultSet":
Object _rs = _en.Value;
System.Type _type;
_type = _rs.GetType();
System.Data.DataSet _realResults;
_realResults = _rs as System.Data.DataSet;
// My expectation is that the cast of _realResults would
// not fail.
break;
}
}
// unlock before we go
_variableCollection.Unlock();
return DTSExecResult.Success;







At this point, my assumption is that the unboxed type of the recordset is not in the System.Data.DataSet inheritance chain as the cast failed. Anyone have insight into what it is? I can't seem to get any hits on google for what it's using behind the scenes in the Foreach ADO Enumerator.


Beyond the immediate question, anyone have thoughts on how else I can solve the problem? I had thought perhaps the task could raise an event if it returned rows but it didn't seem to have that functionality. Even if that had worked, telling the logging provider to capture the result set into the log might have been too much for native functionality. Another option I was thinking about would be to continue using the Enumerator and my custom component is a pure rewrite of the current Script task with the obvious downside being that I'd lose the generic-ness I was hoping to get with being able to hit my dataset.

View 8 Replies View Related

Spaced Used By Col In Index Page Is Total Length Of Col Or Data It Stores In It

Apr 9, 2015

i have one col in a nonclusted index which is bigint 8 bytes follwoing result shows min_record_size_in_bytes and max_record_size_in_bytes is 20 that is 12+8 page size is 8 kB. does that mean a record will use 20 bytes in a page or it will only use the space equalent to data stored in the col.what i have seen is page count is same weather i put some data in the col or null

select * From sys.dm_db_index_physical_stats(9,343,null,null,'DETAILED')
database_idobject_idindex_idpartition_numberindex_type_descalloc_unit_type_descindex_depthindex_
levelavg_fragmentation_in_percentfragment_countavg_fragment_size_in_pagespage_countavg_page_
space_used_in_percentrecord_countghost_record_countversion_ghost_record_countmin_
record_size_in_bytesmax_record_size_in_bytesavg_record_size_in_bytesforwarded_
record_countcompressed_page_count
999208304101HEAPIN_ROW_DATA102.9527559055118116253.187540514.196627131208358500016516516500
9992083041141NONCLUSTERED INDEXIN_ROW_DATA202553.21699.3544600938967585000202020NULL0
9992083041141NONCLUSTERED INDEXIN_ROW_DATA2101115.510254509513221600262626NULL0

View 1 Replies View Related

Stores In Australia That Sell SQL Server 2005 Developer Edition

Oct 25, 2007

Does anyone know which stores in Australia sell SQL Server 2005 Developer Edition. I want to buy it from a store not online, thanks...

View 1 Replies View Related

Reporting Services :: Connect 2 Stores Procedures In Report Builder

Aug 1, 2015

I have created two stored procedures.....

1) atmWonOpportunities_Users
2) atmWonOpportunities_Data (startdate and enddate parameters)

In (1) I created a filtered list of all user names associated with a certain business unit and saved it  to a temp table.
in (2) I create a filtered query listing all won opportunities during a period of time (date start and date end paramters)

In the report, I have 3 parameters, startdate, enddate and username (dropdown list).

When I run the report I select a startdate, enddate and username. I click the View Report button and get the same results for any one of the usernames I pick which is wrong.

View 4 Replies View Related

How Do I Convert A Unix Date/Time Field To A Date When The The SQL DB Stores That Data As Char 11?

Nov 13, 2007

Hi there.
I'm trying to extract data from my SQL server & everything in the script I've got is working (extracting correct data) except for one field - which is for the most part it's off by +2 days (on a few occasions - I see it off by just +1 day or even +3, but it's usually the +2 days).

I'm told that it's due to the conversion formula - but - since SQL is not my native language, I'm at a bit of a loss.

The DB table has the date field stored as a type: CHAR (as opposed to 'DATE')
Can anyone out there help?

Please advise. Thanks.

Best.
K7

View 1 Replies View Related

Import Into More Than 1 Table

May 15, 2007

Hi everyone,

im trying to import data using a query...how ever i can only insert data into one table, and i need to insert data into many...this is at the part where you map the fields...

is there a way to do this? or something similar?

Thanks, Justin

View 3 Replies View Related

Import Table

Nov 27, 2005

hi,
i want to import from excel, data into an existing table in access (overwriting..) using sql. can anyone help me with the right code??
thanks

View 6 Replies View Related

Import Data From Another Table

Sep 20, 2006

HelloI have created a table in mssql.2000 which holds details of names etc.  I have also included categories of interest. However the table is growing very big and unmanageable as the list of interest expand.Instead I would like to create seperate tables for each category of interest within the same database and populate the table with names taken from the Names_Table I could then indicated yes or no if any name is interested in this category.for example:  Art_category.  However, I am unsure how I can import the column of names from the Names_Table to polulate the NameID column in the Art_category table.I would appreciate advice and possibly a link to  step by step tutorial.Thanks.Lynn

View 3 Replies View Related

Import Txt File Into Sql Table Using Vb.net

May 3, 2007

hi!
my problem both concerns vb and sql. the problem is I have a text file delimited with semicolon. I have to enter this data into Sql table.
for example;
item description  ;code1;code2;code3;
there are too many lines like this. The code should enter the table these values.Table name is products, column names are desc,code1,code2,code3
I am using vb.net and sql server
thanks all!
 

View 13 Replies View Related

How To Import CSV File In To SQL Table

Apr 7, 2004

Any body know How to Import CSV file in to SQL table using asp.net

View 13 Replies View Related

Export And Import Table?

Oct 19, 2013

I have a table that contains about 50 millions of records and i would like to know which is the fastest method to export this table - bcp, DTS/SSIS, impot and exports wizard? What is the best way to import text file to SQL Server?

View 2 Replies View Related

Import Table To Csv File

May 28, 2008

hi
can any help
i have import table to csv file to append , replace, delete condition

View 5 Replies View Related

Import Access Table Using DTS

Feb 12, 2007

I want to import an Access table into a SQL table. Some of the integer Access fields have a null value, but when they are imported I want them to be 0 or zero in my SQL table. How can I do this please ?

View 3 Replies View Related

Import Csv File To Table

Nov 7, 2007

Hi.I would like to import the pprice.csv to table test3 on test database.
I've run this query:

BULK INSERT test..test3 FROM 'c:pprice.csv'
WITH (
FIRSTROW = 2,
MAXERRORS = 0,
FIELDTERMINATOR = ',',
ROWTERMINATOR = ' '
)


It has no error.but 0 rows effected.it means doesnt work correct.
what should I do?
thanks.
Amen

View 5 Replies View Related

Import From Excel To More Than One Db Table

Feb 7, 2008

Hi,

I have a large excel file that contains some contact information and includes the following columns:
Company Name, Company Fax, Company Address, Contact Person

In the db I have 3 tables that I need to insert into:
Company table
id ([uniqueidentifier] NOT NULL DEFAULT (newid())
Company Name nvarchar (200)
Company Fax nvarchar (200)
Company Address nvarchar (200)

Contact table
id ([uniqueidentifier] NOT NULL DEFAULT (newid())
Contact Name nvarchar (200)

Contact_Company table
id ([uniqueidentifier] NOT NULL DEFAULT (newid())
contact_id [uniqueidentifier] NOT NULL,
company_id [uniqueidentifier] NOT NULL,


In addition, the excel file will contain the company name more than once (for every contact person in company new row with company name).
I need to insert into table Company the company only once.
I then need to insert the Contact details into the table Contact
Finally, i need to insert into Contact_Company table both the company_id and contact_id

Problems:
-How do i insert into Company table the company only once from excel?
-How do i insert into Contact_Company the correct contact_id and company_id so that the right contact person will be assigned to the company?

Thanks for the help




Whisky-my beloved dog who died suddenly on the 29/06/06-I miss u so much.

View 3 Replies View Related

Import From Excel To More Than One Table

Feb 8, 2008

Hi,

I have a excel file that contains some contact information and includes the following columns:
Date, Name, Address, Zip, City and phone

In the db I have 2 tables that I need to insert into, the statment of the first table is:

CREATE TABLE [TMsalg].[SQLUser].[tbl_Customer] (
[CustomerID] int NOT NULL,
[Name] varchar (50) NULL,
[Adress] varchar (100) NULL,
[ZipCode] varchar (50) NULL,
[City] varchar (50) NULL,
[Phone] varchar (50) NULL
)

and the other statment is:
CREATE TABLE [TMsalg].[dbo].[Order_Ernering] (
[OrderID] int NOT NULL,
[Customer_id] int NULL,
[Name] nvarchar (100) NULL,
[Adress] varchar (100) NULL,
[ZipCode] varchar (10) NULL,
[City] varchar (100) NULL,
[Phone] varchar (10) NULL,
)

Problems:
-How do i insert into tbl_Customer table the custom only once from excel?
-How do i insert into Contact_Company the correct customer_id and company_id?

Thanks for the help

View 4 Replies View Related

How To Import Csv File Into A Table

Mar 18, 2008

hi,
i have a project requirement that i need to import csv file data into a table.
Please help me out?




Raghu sunkara.

View 3 Replies View Related







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