For Each File - Limiting Files
Nov 21, 2006
Thanks everyone
I have another question. If I use FOr Each Loop Container (For each file Enumerator), it will select all the files in that folder. What if I want to select just 100 files (assuming 500 files in the folder)
How do i do this??
Thanks
View 1 Replies
ADVERTISEMENT
Dec 24, 2007
Hi,
I have a small requirement in SSIS Error Logging Mechanism.
Presently in my SSIS package i am using a File Connection Manager for creating a Log file.
I have a problem on this regard. Every time when i am executing my DTS package, the error log messages are getting appended to my error log at OS level (say D:error_messg.log). And for this reason whenever my DTS package is getting executed the size of the file is keep on increasing and there by killing my disk space.
I have a requirement for this error logging mechanism. At any time my log file should not exceed more than 20MB.
Or can we remove the log events a week ago or say more than 2 days or say. Just ensuring the log file do not fill up the disk space eventually.
How can we do this?
Any suggestions are greatly appreciated.
Thanks & Regards
View 1 Replies
View Related
Apr 9, 2008
I am using sql 2000 SP4 and I am really struggling finding some dead locks. I can enable Startup Parameters T1204 and T3606 which gives me a partial picture.
But then I need to run a profile for deadlocks etc. This is where I have a problem what Events and Data columns do I need?
Also I have an extremely heavy loaded server; if I run a full profile I will grind the server to a halt.
I can get away with running a duration trace and setting duration > 3000. But I find that if I add more events and data columns the duration > 3000 no longer stops the flood.
This is because if the field you are filtering by has no value it will include it in the trace. Which is a real problem.
So has anyone got and advice on how I can set up a profile to help me find dead locking but wont cripple my server.
Many thanks
View 3 Replies
View Related
Mar 13, 2008
In the For Loop, How to Iterate from Older flat files to Newer flat files based on File's Timestamp. If there are some older files in that folder, it should be processed first and then continue with the newer one.
Any Suggestions?
View 3 Replies
View Related
May 27, 2015
I need to move specific files from a server to another server on a monthly basis. There are hundreds of files that are in the source directory and I need to move approximately 40 of those to the destination server. I would like to easily add or delete the file list as needed. I have seen where several variables were created for for each file name (and one for the path) and the ForEach Loop would go through them. With 40 or more I was thinking that I could make a connection to an Excel spreadsheet or text file with a record for each file name and read in and and move to the next record and make that value become the content of a "FileName" variable. Then if I wanted to add another file name I could just add another record to spreadsheet/text file or remove and the package would handle automatically....
View 10 Replies
View Related
Oct 10, 2007
Hi All,
I my requirement I need to read all the files from folder (one by one) and insert data from those files into the database table . I am facing one issue here . If suppose while executing if any of the file fails its not executing the other files. Package stops execution.
I cannot use Redirect rows option beacuse as per requirment if file has some Data problem , I am suppose to ignore the file instead of Data Rows.
Is there is any property in for each file task .....kindly suggest
Regards
Shagun
View 1 Replies
View Related
Jul 30, 2007
I have a huge MDF File - 120 GB File (Had setup as 1 MDF initially) -- Did not anticipate that the DB would grow to that size!!
Anyways.. I heard that the general performance woul grow if i had them as "File Groups"..
Is there anyway - to split the existing MDF file into Mutliple files as a File Group?
Where should i start? Can someone please direct me..
View 1 Replies
View Related
Apr 29, 2014
Why shrinkfile empty file does not redistribute data evenly in the primary file group with multiple files:
Please run the script attached to see what the end result is.
This is what I set up last night on my test machine.
1) Create database [FGTest] size 200MB
2) Create table called TEST on primary
3) Insert 40MB of data into test
4) Create another file group called temp in primary size 200MB
5) Shrinkfile('FGTest',emptyfile) so that all data is transfered from FGTest into temp file group.
6) Add another 2 files called DATA2 and DATA3. Both are 200MB.
7) We now have 3 empty files that I want data distributed evenly on. FGTest, DATA2 & DATA3
8) Shrinkfile('temp',emptyfile) to move all the data from temp over the 3 file groups evenly
I would expect at this stage to have the following:
FGTest = 13MB,
DATA2 = 13MB,
DATA3 = 13MB
(40MB of data over 3 files should be about 13 MBish in each file)
What I actually end up with is this:
FGTest = 20MB
DATA1 = 10MB
DATA2 = 10MB
It looks as though SQL Server is allocating 50% of all data to the original file and then 50% evenly over
the remaining files in PRIMARY.
View 3 Replies
View Related
Sep 3, 2007
I'm trying to decide whether MS SQL will allow me to accomplish the following objectives at no cost, or whether I'd eventually have to pay for an MS SQL upgrade to accompish my objectives.
I have big, unrealistic dreams. I want to create a humorous newsblog into which I would post more than a dozen times a day. Most of the posts would have large photographs. Presumably, I'd archive the posts by subject and ranking and 'most viewed," etc., using a database.
1) Will the space limitations of the MS SQL Express edition be an issue after a while?
2) Could I hire a web developer to help me from a remote location, once the website is large enough to warrant expansion? Or does the MS SQL Express edition allow only one user? I read something I didn't understand about CPU restrictions.
3) I'm confused because web hosts advertise the availability of MS SQL databases on their server...so does that mean I wouldn't have to buy an upgrade if it became neccessary? (I know, I'm shockingly uneducated.)
4) I'm going to buy Office 2007. Is it important to purchase a package that includes Microsoft Access, given my goals?
5) Any other thoughts in plain english on how the MS SQL express edition imposes limitations....basically, I don't understand how MS SQL Express might limit me down the road if the site were actually a success. What would have to happen before I would be forced to spend a lot of money on an upgrade later?
I'm almost completely new to computing. I've read a bunch of criticisms of MS SQL Express on internet forums that I didn't understand, but that really made me worried about my decision to go with Microsoft Products and Asp.net web hosts. (I understand some people have an irrational dislike of Microsoft, but there was A LOT of bashing.)
View 5 Replies
View Related
May 31, 2004
Hi,
please do help. Have been wrestling with this for about 3 hours and read a buncha forums + searched the tutorial lists.. AARRGH!
Anyhow,
I have to paginate a datalist (and I really can't use a datagrid because of the layout, blame the bluddy graphic designer)
I want to return the top 8 rows, the next 8 top rows and so on.
This is the sql string I have:
'retrieve pagination in order to construct the rest of the sql string
Dim startrec As Integer
If pageno = 1 Then
startrec = 0
Else
startrec = (pageno - 1) * pagesize
End If
' this builds the sql string, getting ONLY the records we need for this. Page size is a constant expressed on the base page
' startrec is the record where I want to start in the db.
strsql = "select top " & pagesize & " * " & strsqlbasic & " and itemID>" & startrec & " order by itemnotes1 asc"
noresults.text = strsql & " <br> " & searchwhat & searchfor
strsqlbasic is constructed elsewhere and is just the 'from X where y = var
Of course, this returns all records where the value of itemID is greater than the value of startrec. How would I change this so it returns the next 4 rows starting from the row number given by the value of startrec?
thanks for any help.
View 3 Replies
View Related
Mar 23, 2001
I was wondering if there is a way to select ranges of rows, for instance:
I want rows 5-10 of a database, how would i select that?
I know in MySQL you do a "limit #,#", no clue about SQL Server.
View 3 Replies
View Related
Nov 23, 1998
Orcale uses a psuedo colum ROWNUM to limit the number of rows returned by a query. Does MSSQL server 6.5 provide some similar feature (or any indirect way of doing that).
View 1 Replies
View Related
Jun 13, 2007
Hi
I have a problem on microsoft sql server 2000.
I need to limit the amount of resources(eg cpu, mem..) a query uses
Is there a way to do this in SQL server 2000
Thks in advance
:eek:
View 1 Replies
View Related
May 24, 2008
I'm trying to write a query where if the value of one of the paramters is equal to "-1" it will not include one of the search criteria. For example I have a param called "Gender". 0 = Male and 1 = Female. If the value of the "Gender" param is "-1" I'd like it to find either Males or Females.
Code (please not this doesn't compile):
SELECT
[UserID],[Gender]
FROM
[table_user]
WHERE
Country = @Country
AND IsOnline = @IsOnline
IF (@Gender != -1)
AND Gender = @Gender
Obviously this doesn't work, but I think it conveys the gist of what I'm trying to do. Does the secret lie in default parameters? Or is my IF syntax just flat out wrong?
Thanks!
View 3 Replies
View Related
Sep 22, 2005
I am trying to convert some mySql code to sqlserver and was amazed to see that sqlserver has no functionality to specify the rows of a select statement. In mySql its e.g. "SELECT * FROM table LIMIT 20, 10" this returns ten rows starting from row 21. Using TOP in sqlserver only returns the top n rows but what if I want row 20 to 30? Is there an easy way that I have just missed or does one realy have to do something like "SELECT TOP 60 * FROM myTable WHERE id NOT IN (SELECT TOP 40 id FROM myTable);"?
Hope you can reply with good news...
Ed
View 3 Replies
View Related
Aug 18, 2007
Hello everyone.. I'm working here on a little problem which's driving me nuts : I have two tables :EQUIPMENT :
-EQID
-EQName
-EQblabla QUALITYCHECK :
-QCID
-EQID <---- Is connected with EQUIPMENT
-QCDATE
-QCACTION
-QCnextdate They're needed to manage Qualityactions on some machines we own. Every year, we do quality actions on every machine, after then, we Inserta new QUALITYCHECK-entry into our database and automatically theQCnextdate is generated with QCdate+365days. So far, so easy. So now, how will i do a query against the DB with the NEWEST QUALITYCHECK-entrys for every machine ? The result has to besmth. like that : EQID | EQName | QCDATE | QCNextdate
1 | machine 1 | 21.12.2006 | 21.12.2007
2 | machine 2 | 21.06.2006 | 21.06.2007
3 | machine 3 | 21.11.2006 | 21.11.2007
4 | machine 4 | 21.12.2005 | 21.12.2006
5 | machine 5 | 23.10.2006 | 23.10.2007
AND NOT
EQID | EQName | QCDATE | QCNextdate
1 | machine 1 | 21.12.2006 | 21.12.2007
1 | machine 1 | 21.12.2005 | 21.12.2006
1 | machine 1 | 21.12.2004 | 21.12.2005
1 | machine 1 | 21.12.2003 | 21.12.2004
2 | machine 2 | 21.06.2006 | 21.06.2007
2 | machine 2 | 21.06.2005 | 21.06.2006
2 | machine 2 | 21.06.2004 | 21.06.2005
2 | machine 2 | 21.06.2003 | 21.06.2004etc..
I tried several things with top 1, subquerys, distinct etc..But unfortunatly it seems that im not capable to solve the problem..I would be thankful for any suggestions !
View 3 Replies
View Related
Aug 25, 2004
Hello.
I am trying to limit the number of records to start in a position and show me "n" records. Here is an example query:
SELECT TOP 60 * FROM Entries WHERE Id NOT IN ( SELECT TOP 45 Id FROM Entries ORDER BY Id DESC ) AND Static = False AND Authorized = False ORDER BY Id DESC
It's not working correctlly. Any ideas?
Thanks in advance.
View 4 Replies
View Related
Aug 5, 2004
Hello,
We are migrating from VB6/MySQL to VB6/MS SQL.
The application retrieves limited records for paginated results.
This way we can access large databases, but only return rows for one screen.
For example:
Select row 1 - 10, then 11 - 20 then 21 to 30 etc.
With MySQL we can use LIMIT and OFFSET and it works great.
MySQL
SELECT <columns> FROM <tables> [WHERE <condition>] [ORDER BY <columns>]
[LIMIT [offset,]howmany>]
Does anybody know how we can do something similar with MS SQL?
Any feedback is appreciated!
Thank you,
Edi
View 2 Replies
View Related
Feb 16, 2007
I know how to do this in MySQL; but I was hoping there was a way to do it in MS SQL.
I want to be able to limit the number of rows an UPDATE or DELETE will effect regardless of the WHERE clause. I want to do this as a stop gap in the event that there is a logical error in the WHERE clause that would make it effect more rows than is humanly intended.
If I write a complex query that I know should drill down to only affecting one row, I just want to lock it in before I run it on database and take the risk of damaging some data.
In MySQL you would just do something like this:
Code:
DELETE FROM table_name WHERE ... LIMIT 1;
The only thing close to LIMIT I could come up with for MS SQL was TOP but it seems to only work for SELECT.
Any ideas would be greatly appreciated.
I ask this because if you screw up; manually saving 1, 2 or even 5 rows is a lot easier than having to rescue a whole table of data (even if it on a development server).
View 2 Replies
View Related
Sep 7, 2006
I have a table that looks like
CP | P | ST | Date
where each letter represents a column. I need a SELECT statement that results one row if there is an entry with a date within the last 6 mo for each CP,P,ST combination.
example:
cp1, p1, st1, 1/1/6
cp1, p1, st1, 4/1/6
cp1, p2, st1, 3/1/6
would return just the first and third row...
thanks.
any ideas?
View 2 Replies
View Related
Apr 2, 2015
Let me start off with my table layouts.
CREATE TABLE [dbo].[Competition] (
[Id] INT IDENTITY (1, 1) NOT NULL,
[Name] NVARCHAR (150) NOT NULL,
[Remarks] NVARCHAR (350) NULL,
[Start] DATETIME NOT NULL,
[IsActive] BIT NULL,
[End] DATETIME NOT NULL,
[Code] ....
Then here is my query with the problem below. The problem is that multiple EntryImages can relate to a single Entry. My goal is to only select one Row for each Entry (using @EntrySelection) but when I join to EntryImages I always get back multiple rows when an Entry has multiple EntryImages.
Declare@EntrySelection int= 10
select top (@EntrySelection)
[dbo].Entries.Id,
[dbo].Entries.CatchDate,
[dbo].Entries.CompetitionId,
[dbo].Competition.Name,
[Code] ....
View 2 Replies
View Related
Jul 23, 2005
We currently have a routine that "forks" out (to use the unix term)TSQLcommands to run asynchronously via SQL Agent jobs. Each TSQL commandgets its own Job, and the job starts immediately after creation.Sometimes we can have too many of these jobs running at the same, andthe box crawls to a slow speed until the jobs finish up.Is there a way we can limit the number of active jobs running under theSQL Agent at one time? Or is there away to limit the number of active(runnable) processes on SQL Server, in general?
View 2 Replies
View Related
May 25, 2006
Hello,i am in a problem that i am having a table with 100 rows while i ampresenting in report i want to limit rows to be 10 in a page in thereport like that i want to get 10 pages .Please say me the procedurefor this.Thanks,Baba.
View 1 Replies
View Related
Jul 28, 2007
SQL Server 2000 SP4. I built a large DTS package that grabs a numberof tables from an Oracle DB, does some scrubbing and date verificationand loads to a SQL Server DB. Most of the tables are full refresh anda few are incremental.Main DW: DwSQLStaging Area: DwLoadAreaSQLThe DW is about 60 Gigs. The Staging Area is about 80 Gigs. This isall good.However, the log file for the staging area is 50 Gigs and I'm tryingto find ways to not require such a large log file. I tried adding afew "BACKUP LOG DwLoadAreaSQL WITH TRUNCATE_ONLY" statements in theDTS package but figured out that because it's 1 DTS package it's all 1transaction. I've thought about breaking it up into multiple DTSpackages and truncating the log between running them but was hoping toavoid this. To be clear, I know how to shrink DB's and LogFiles...that's not the issue.Any Ideas? Thanks.
View 2 Replies
View Related
Aug 15, 2007
Hi,
I have a matrix object in a report that sometimes runs off the side of the page based on the underlying data. Essentially if there are more than 11 columns it stretches out my page.
How can I fix this? Ideally, I would like to show only the Top 11 results but cannot seem to figure out how (or where, or on what data element) to properly set a filter.
Thanks.
Brad
View 1 Replies
View Related
Jul 4, 2007
Is there any way to limit the content that is placed into the Progress Tab during execution of a package in debug mode?
My problem is that I have a complex package that puts lots of info in there. This package is called in a loop from another package. Each time the package is called, the new info is added to the existing info in the Progress Tab. Eventually the instance of Dev Studio hangs when it gets too much content in that screen.
The only solution would be if I can limit the output content of that screen or turn it off.
All suggestions appreciated.
View 13 Replies
View Related
May 9, 2006
I am using an UDL file to connect to an ORACLE database. In UDL GUI the test of the connection is ok. However, in the Connection Manager, when I set the File Name property to the UDL file name and I test the connection, I get the message 'The connection failed because of an error in initializing provider. The ConnectionString property has not been initialized.'
View 2 Replies
View Related
Aug 14, 2004
hi,
im doing network monitoring app where basically i run a checks on servers every few minutes and log the data to a table. Naturally the table can get big, quite quickly. What I want is to be able to overwrite the table data at the start of each new day. Alternatively, rollup the data into a daily or weekly packets and then overwrite table data. How do i do this?
View 1 Replies
View Related
Sep 26, 2007
Hello all, I have a table called jobs that has a total column which contains integers between 0 and 25. I have a deal worked out with a client that caps the total per job at 9. How do I sum every entry to get the months total while capping any day whose total is over 9. I have tried looping it in php which I can't get to work, seems like it should be part of the query structure anyway.
Just to clarify: If I had 4 days last month whose totals were 4, 6, 10 and 17. I would need 10 and 17 to cap out at 9 and the total = 28 not 37.
Thanks for your time.
Tim
View 2 Replies
View Related
Jul 26, 2007
Ideally, I'd like to move away from using SQL-based logins for our internal applications and take advantage of integrated security instead.
Defining AD groups and their permissions in SQL is simple and getting the application to work with that is not an issue.
Where I'm having difficulty, though, is in isolating the accessibility in integrated security. Because the SQL-based login was isolated from the windows user, they could only get access to the sql server via our app -- their normal windows accounts had no access.
If we switch to use only windows authentication, the user would be able connect fine from our application and have rights to various tables. The issue is that they could also connect via Enterprise Manager, Excel, or any other tool. Is there any way to limit the exposure so that we can take use of AD for our access but further limit to allow connections based upon the application? I realize that this could be impersonated, but it's still better than nothing...
--Kevin Fairchild
View 5 Replies
View Related
Jul 23, 2005
Hello,I am running SQL Server 2000. I would like to know whetherMicrosoft Transact-SQL has a method for limiting the resultset from a query in a way analogous to MySQL's LIMIT keyword,so that, for instance, if the result set contains 10,000 rows,then only the first 10 rows from the record set are output.Thank you,Best Regards,Neil
View 2 Replies
View Related
Oct 5, 2007
1) How can I keep my package from running more thatn 1 instance at a time?
I tried changing "MAXCONCURRENT" to "1" in my DTEXEC command in batch file, however, this doesn't limit the # of instances. (If I run the batch file twice, one after the next, I get 2 instances running simultaneously).
2) What "executable files" is this definition referring to?
MAXCONCURRENT is defined as:
"Specifies the number of executable files that the package can run concurrently. The value specified must be either a non-negative integer, or -1. A value of -1 means that SSIS will allow a maximum number of concurrently running executables that is equal to the total number of processors on the computer executing the package, plus two."
Thx,
Mojo
View 3 Replies
View Related
Feb 13, 2008
How can I restrict the number of records in a table in SQL Server 2005, please?
Thanks
View 5 Replies
View Related