Sunday, March 25, 2012
Attach and ODBC Database in Enterprise Manger (I think)
I can query its data along with data from the SQL database. How can I
attached this table in the Enterprise manager? Or maybe my thinking is
wrong and can't be done this way, so how do i do it? Sotred Procedures?
Views? Please help...
Thank you in advance for any help for I am in a real bind,
MikeI think what you are saying is you want to connect an ODBC datasource to you
r
SQL database. Is this correct?
"Michael Kintner" wrote:
> I have created an SQL database and would like to attach an ODBC database s
o
> I can query its data along with data from the SQL database. How can I
> attached this table in the Enterprise manager? Or maybe my thinking is
> wrong and can't be done this way, so how do i do it? Sotred Procedures?
> Views? Please help...
> Thank you in advance for any help for I am in a real bind,
> Mike
>
>|||Use can use Enterprise Manager to create a Linked Server. In the EM,
expand your database instance, then expand the Security node and then
right click on Linked Servers to create a new linked server. Fill-in
the blanks and you're done.
In Query Analyzer, you can query you linked server like:
select * from <linked_server_name>.<database_name>.<dbo>.<table_name>
Easy.|||YEs this is correct, I have an AS400 system I would like connect to my SQL
server and run views between both systems on my SQL server.
"Lontae Jones" <LontaeJones@.discussions.microsoft.com> wrote in message
news:2A5BEF15-D324-43AB-81A9-954257D496DD@.microsoft.com...
>I think what you are saying is you want to connect an ODBC datasource to
>your
> SQL database. Is this correct?
>
>
> "Michael Kintner" wrote:
>
Thursday, March 8, 2012
Assign Variable for FileName of Source File
I am wanting to capture the file name I am using to load data from and use it in a SQL statement to insert it along with the data that I load.
I am using a ForEach container to load all my .txt files but cannot figure out how to capture the name of each source file as it loops through the files and then add it to my insert statement that is populating my history table. I would think that the ForEach container has that information, but I do not see how to access it and assign it to a variable that I could use in my SQL statement.
Any ideas or suggestions?
The ForEach loop container can store the name of eac enumerated file into a variable. This article explains how to do that: http://blogs.conchango.com/jamiethomson/archive/2005/05/30/1489.aspx
Once its in a variable you can do pretty much anything you want with it and it seems you already know how to do that. If not, just reply here.
-Jamie
|||
Thanks for the link, but I have was able to setup a variable @.[User::FN] to the ConnectionString property associated with the flat file connection, and the looping and loading effort is working fine.
This may seem like a stupid question, and I apologize, but I cannot figure out how to reference that variable and use it in my execute SQL task that follows later and does my insert of the data into my table. What I want to do is something like this:
Insert into Table1 Select a, b, c, @.FN From Table2
The parser requires that I declare the variable and does not seem to recognize the @.[User::FN] variable.
Any suggestions?
|||Yes, use an expression. This (sort of) shows you how:
http://blogs.conchango.com/jamiethomson/archive/2005/12/09/2480.aspx
-Jamie