Showing posts with label connection. Show all posts
Showing posts with label connection. Show all posts

Friday, March 9, 2012

File->Open->File always opens new Connection/window

In Query Analyzer, a File->Open would replace the current query with a new query (after appropriate warning if necessary)

In Management Studio, File->Open->File always creates a new connection in a new query window. This is a pain a majority of the time as I want to replace current query with another. It seems like the File->Open->File with New Connection would be used for creating a new connection. I do see the difference between the two option, just that the first is too close to the second. It is annoying as I have to go find and then close my prior query window.

I've searched but cannot find a way around this. Any help would be most appreciated

Thanks

Carol

Download Service Pack 2:

http://www.microsoft.com/technet/prodtechnol/sql/2005/downloads/servicepacks/sp2.mspx

|||

Good thought but same behavior. I am running Microsoft SQL Server Management Studio 9.00.3042.00

But it sounds like this works differently for you than for me. Can you verify this and if so, can you think of anything you may have done to alter the default behavior?

Thanks
Carol

|||

I didn't read you question correctly. Sorry.

Before SP2 you had to connect. log in, for each file you opened. After SP2 you can open without loging in each time.

Each file opens in a new window.

|||

This doesn't feel like a very popular scenario to me. Most MDI interfaces these days open new windows instead of replacing the content of the current window. I'd suggest that if this is an important scenario to you that you report it on Microsoft Connect and have others vote on it.

Microsoft Connect:
http://connect.microsoft.com/SQLServer/Feedback/

Paul A. Mestemaker II
Program Manager
Microsoft SQL Server Manageability
http://blogs.msdn.com/sqlrem/

|||

Paul,

Thanks for the response. I found an existing Microsoft Connect thread (127103) where the request stated "In SQL Server 2000 - Query Analyzer when you open a saved SQL script the script will open over the top of the current window. If the current window has an unsaved or modified script then it will prompt you to save before overwriting the contents of the window with the opened script. This has two advanatages to the user:
i) there are not multiple screens opened
ii) the script opens in the current database"

You posted a reponse on March 31, 2006 stating
"This has been addressed for SP2. Our fix should make it into CTP1 for Service Pack 2. If you could, please install the CTP1 when it is available and verify that your specific issue with Open File has been resolved. With this fix, we've also improved areas such as DDE, Drag and Drop and sqlwb.exe command line behavior."

There is a follow-up response by Microsoft on July 24, 2006 that goes into specifics. Reading this, I believe that SP2 provided improvements, but did not address the original request, which is to open a script over top of the current window. So while having it not always ask for connection info is definitely an improvement, we still would like it to not open a new window.

ID 127103 is closed but had a 4.56 rating. Would you recommend I open a new one?

Thanks
Carol

Friday, February 24, 2012

File Metadata and the Foreach Loop Container

Hello,

I want to set up a Foreach loop container to loop through several flat files. I have a connection manager set up for individual flat files. The metadata for the files is all the same. They are fixed width files, and contain sixty five columns.

I didn't see a place in the container properties to configure the metadata of the files. How can a Foreach Loop Container 'know' the metadata of the flat files that I want to loop through?

Thank you for your help!

cdun2

If you are going to iterate through a number of files, you need t use a ForEach loop container that uses file enumerator . Then you need to create a single data flow with a single Flat file connection manager (using an expre ssion in the connection manager will do the trick of changing the name of the file on each iteration).

The metadata of the file has nothing to do with the ForEach loop container (It is defined in the connection manager though).

|||

cdun2, Jamie Thomson has some great examples of SSIS on his blogs page. This one refers to enumerating files using a ForEach Loop container (not quite exactly what you are attempting to do, but gives you an Idea of how to use the foreach container.

http://blogs.conchango.com/jamiethomson/archive/2005/05/30/1489.aspx

Can you outline your process? If you are going to do processing on each flat file, you probably want the processing within the ForEach loop.

|||

Actually, here is another example:

http://www.sqlis.com/55.aspx

|||

Thank you for your input! I'll see if I can run with the resources you have provided here.

cdun2

|||

Another approach is to use a multi flatfile connection.

To use that you need to create a connection string with all the filenames concatenated with a "|" (pipe). You just use it as if you are loading a single flatfile into a table. It also lets you add the filename as a column so that you know what file a particular row is coming from.

Check it out.

|||

I tried to implement this by following SSIS Tutorial Lesson 2 and the pkg only processed the last file in the list. From one I can tell from the project log, it didn't even loop through the other files, though it did process the last file by inserting its rows into the table, as expected.

Any ideas on why this would be happening? It seems like such a simple example... Thanks.

File Metadata and the Foreach Loop Container

Hello,

I want to set up a Foreach loop container to loop through several flat files. I have a connection manager set up for individual flat files. The metadata for the files is all the same. They are fixed width files, and contain sixty five columns.

I didn't see a place in the container properties to configure the metadata of the files. How can a Foreach Loop Container 'know' the metadata of the flat files that I want to loop through?

Thank you for your help!

cdun2

If you are going to iterate through a number of files, you need t use a ForEach loop container that uses file enumerator . Then you need to create a single data flow with a single Flat file connection manager (using an expre ssion in the connection manager will do the trick of changing the name of the file on each iteration).

The metadata of the file has nothing to do with the ForEach loop container (It is defined in the connection manager though).

|||

cdun2, Jamie Thomson has some great examples of SSIS on his blogs page. This one refers to enumerating files using a ForEach Loop container (not quite exactly what you are attempting to do, but gives you an Idea of how to use the foreach container.

http://blogs.conchango.com/jamiethomson/archive/2005/05/30/1489.aspx

Can you outline your process? If you are going to do processing on each flat file, you probably want the processing within the ForEach loop.

|||

Actually, here is another example:

http://www.sqlis.com/55.aspx

|||

Thank you for your input! I'll see if I can run with the resources you have provided here.

cdun2

|||

Another approach is to use a multi flatfile connection.

To use that you need to create a connection string with all the filenames concatenated with a "|" (pipe). You just use it as if you are loading a single flatfile into a table. It also lets you add the filename as a column so that you know what file a particular row is coming from.

Check it out.

|||

I tried to implement this by following SSIS Tutorial Lesson 2 and the pkg only processed the last file in the list. From one I can tell from the project log, it didn't even loop through the other files, though it did process the last file by inserting its rows into the table, as expected.

Any ideas on why this would be happening? It seems like such a simple example... Thanks.