I run a SQL query to select a few colums of data using a select statement, I want the output to be stored in the new table which can be defined in the SQL statement how can I do it?
maybe you can help me with a little SSIS task. I want to fetch some wmi infos from serveral servers with the wmi reader. to read something is no problem, but whats the best way to bring them to a table or the control flow? Read from the generated file cant be a way. I also tried the variable. How do I get them to data flow. I tried a script task but i cant read the resultset. What format has the variable? ado.net, ado? Whats the best way to get the results into a table?
I am creating queries and reports in an Access front end (let the groans begin)...it is what they gave me to work with!
This particular query is pulling information from several different tables and manipulating it the way I want. However, there is one table that I am trying to pull info from that has the data arranged differently than all the others.
e.g.:
Name Drive Capacity Free_Space Computer A C 40 10 Computer A D 200 175 Computer B C 80 55 Computer B D 500 445 Computer B E 500 365
I want that to look like:
Computer A C 40 10 D 200 10 Computer B C 80 55 D 500 445 E 500 365
I would prefer to do this within the existing query, without creating a new (permanent) table because the info needs to be real-time.
I have Lookup task to determine if source data should be updated to or insert to the customer table. After Lookup task, the Error Output pipeline will redirect to insert new data to the table and the Output pipeline will update customer table. But these two tasks will be processing at the same time which causes stall on the process. Never end.....
The job is similiart to what Slow Changing Dimention does but it won't update the table at the same time.
Row 1 with identity 1 has rolled over to new quarter row 4 with identity 4 ( qtr fields are changed ) Row 2 with identity 2 has rolled over to new quarter row 5 with identity 5. Same with last row as well.
Here, i have another table called "ident_map" with columns like (old identity, new identity ) and during rollover i am supposed to load ident_map table with old and new identity. So after rollover is complete, ident_map table should look like
1,4 2,5 3,6
I know using output clause I can capture the new identity values. 4,5,6 in this case. But is there any way to capture both old identity and new identity during rollover so that i can load the ident_map table with old and new identity.
Hello All, I am migrating data from one database to another. I am using Multicast to seperate (legal street,legal mail and legal city) and (mail_street,mail_state,mail_zip,mail_city) also later after UNION of the above I am doing two lookups as I had to get contact ID and Customer ID from other two tables. In UNION i am matching (Mail street legal street) and so on.
I am getting double the data in the output. my input data is 1000000 and im gettin 2000000.
Hi everyone, While creating a stored prodecure, I now that it is possible to use an output parameter which is a table. However, I do not know how to do it ?? In other words, I would like to return a table but as an output parameter, so how can this happen ?
First some background info. SQL Express Visual Studio 2005
VB.Net
Data.SQLClient Namespace
Well I was using the OUTPUT option in my program and it was great, i was returning my PrimaryKey from the newly inserted row. (I am using paramaters in my program and running a sqlCommand.ExecuteScalar)
I added trigger to the tblInfo, that after a Insert,Update, Delete it would perform a audit on the table saving the old info that was overritten, type of action taken (insert, update or delete), and who did it.
Well my OUTPUT didn't like that says, it can't do a OUTPUT on a table with a trigger.
--Error msg Msg 334, Level 16, State 1, Line 1 The target table 'tblInfo' of the DML statement cannot have any enabled triggers if the statement contains an OUTPUT clause without INTO clause.
So what am i supose to do? I want the audit to occur, but I walso want the primarykey without doing a select (maxID) which could potentially get the wrong id (multiuser).
I used the oTable.Script method to output the DDL for a Sql Server 2000 user defined table. The result is DDL with an error. I don't think the problem is with DMO itself so I posted this here. Note the 'TEXTIMAGE_ON ' clause. The table does not have a text column, and the DDL will not execute.
CREATE TABLE [MyTable] ( [FilterID] [int] IDENTITY (1, 1) NOT NULL , [LoanAgentID] [int] NOT NULL , [Key] [varchar] (16) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL , [IsActive] [int] NOT NULL , [tStamp] [timestamp] NOT NULL , [Formula] [varchar] (4000) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL , [_AuditAddDt] [datetime] NOT NULL , [_AuditUpdateDt] [datetime] NOT NULL , CONSTRAINT [PK_MyTable] PRIMARY KEY CLUSTERED ( [FilterID] ) WITH FILLFACTOR = 90 ON [PRIMARY] ) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY] GO
Server: Msg 1709, Level 16, State 1, Line 1 Cannot use TEXTIMAGE_ON when a table has no text, ntext, or image columns.
I've been looking into using the ability to select the table of an OLEDB destination task based on a package variable but would like to know if this could be utilised in the following example.
I have a CSV file (potentially there are many) with a number of rows. The rows do not necessarily contain the same number of elements. Each row has an EventID and this is used to determine the database table that the row is to be inserted in.
Initially i thought about using a conditional split to send each row down the path relating to its event ID. There would be multiple destinations depending on the table. With the possibility of 60 to 70 different event ID's this is very quickly going to get out of hand in the designer. I'd like to know if it would be possible to set up a case statement (or similar) in a script component and specify the table name as a variable depending on the event ID. I'd then use this table variable to set the destination task's table property.
Does this sound like a possibility or do i have to go down the route of multiple paths?
I want to retrieve staff who attend less than 80% for a meeting type assuming we have 10 meetings per list.
Meeting Table:
staffID list date ------------------------ 1 A 2013-01-15 2 B 2013-01-17 1 B 2013-01-17 1 A 2013-01-18 2 B 2013-01-19 1 A 2013-01-20 2 C 2013-01-21
* 1 - Dan * 2 - Jane
When the staffID occur 3 times (70%), query will Output:
staffName list Participation% ------------------------ Dan A 70
SELECT a.staffName, b.list, (100 - ((COUNT(c.staffID) * 100) / 10)) AS 'Participation%' from Staff AS a, listType AS b, Meeting AS c where a.staffID = c.staffID AND b.list = c.list GROUP BY a.staffName, b.list HAVING COUNT(c.staffID) > 2
Server: Msg 8928, Level 16, State 1, Line 1 Object ID 1513928615, index ID 0: Page (3:33709) could not be processed. See other errors for details. Server: Msg 8944, Level 16, State 1, Line 1 Table error: Object ID 1513928615, index ID 0, page (3:33709), row 0. Test (ColumnOffsets <= (nextRec - pRec)) failed. Values are 95 and 30. DBCC results for 'Result'. There are 41589306 rows in 660667 pages for object 'Result'. CHECKTABLE found 0 allocation errors and 2 consistency errors in table 'Result' (object ID 1513928615). repair_allow_data_loss is the minimum repair level for the errors found by DBCC CHECKTABLE (LASAR2.dbo.Result ).
Is there an example anywhere of how to output selected fields in a sql table to a text file with fixed length fields. ie pad data out to required length.
I am trying to create a csv file without the field header information. First, I hid the table header row, then each column header separately, then removed the table header alltogether, but when I print to a CSV file the field headers still show up. This file is going to be use as input to another application and they do not want the header information.
Hi Friends, I am new to reporting services . In Excel reports we can create pivot tables and manipulate data easily. Is it possible to create the pivot table in HTML output in SQL Server 2005 without changing the existing procedure or function? I wonder if there is any drag and drop facility to do the same in HTML report. Hope , some one might have dealt with this.
hi, good day, can we output data from sql query into file ? for example, if i have a select sql statement which capture many records and i would like to output it into "tab" elimiter text file format
select hierarchy.hiername,devicefail.deviceid ,sum(DATEDIFF(minute,started,ended)) as duration ,100 - SUM(datediff(minute,started,ended))/(672 * 60.0000)*100 AS Uptime from devicefail LEFT JOIN device ON device.deviceid = devicefail.deviceid LEFT JOIN hierarchy ON device.hierlevel = hierarchy.hierlevel where devicefail.started >= '2013-02-01 00:00:00'and devicefail.ended <='2013-02-28 23:59:59' and devicefail.componentid like 201 or devicefail.componentid like 0 group by devicefail.deviceid,hierarchy.hiername,devicefail. componentid order by hiername
Hi, Is it possible to store the output of a SQL Server 7.0/6.5 System Stored Procedure (eg. xp_fixeddrives, sp_spaceused, etc.) in a table, possibly with a Select Into? All help will be greatly appreciated. Thanx in advance. Craig
Currently running Sql Server 2005Is it possible to issue the delete command and capture the affected rows asxml types that will be stored in an audit table with an xml column?Something along the lines of:delete from source_tableoutput(deleted.*into audit_table (xml_audit_column)for xml auto)where source_table.column = @delete_value