Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 link a text file to sql server

Author  Topic 

ajazz
Starting Member

2 Posts

Posted - 2013-12-04 : 14:28:39
hi everyone

how to link a text file in sql server

and how to save/reuse the import specifications

TG
Master Smack Fu Yak Hacker

6065 Posts

Posted - 2013-12-04 : 15:27:05
when you say, "link a text file" do you mean import the file to a table?
If so you can use the import wizard (right-click yourDatabase | Tasks | Import Data...)

To save/reuse I think you need to use SSIS to create a package which can be re-run manually any time or scheduled with a sql job.

Be One with the Optimizer
TG
Go to Top of Page

ajazz
Starting Member

2 Posts

Posted - 2013-12-04 : 16:12:00
link is different then import

in ms-access we have link and import

link is to link with the data source file. you cannot delete the data

how to use ssis, may u pls tell me

i wish to attach the text file. is it possible ?
Go to Top of Page

TG
Master Smack Fu Yak Hacker

6065 Posts

Posted - 2013-12-04 : 16:30:36
>>i wish to attach the text file. is it possible?
No. Sql Server does not have the "link" type functionality like ms-access does.

>>how to use ssis, may u pls tell me
I can't explain it all in this thread. Open google and search for "SSIS Tutorial". You'll find lots of information.

EDIT:
Here's Books Online section on Sql Server Inegration Services

Be One with the Optimizer
TG
Go to Top of Page

Natalia89
Starting Member

12 Posts

Posted - 2013-12-04 : 16:31:20
I have a table that contains empid, name, salary, hiredate, positionand supervisor (which includes empid not the name) how do i list the empid and name of all supervisors ? the output has to have to columns supervisor( and a list of their emid) and their names. Thats the create statement used to create the employee table:
/* Create table Employee */
IF OBJECT_ID('Employee', 'U') IS NOT NULL
DROP TABLE Employee
GO
CREATE TABLE Employee (
emp_id NCHAR(5),
name NVARCHAR(20),
position NVARCHAR(20),
hire_date DATETIME,
salary MONEY,
bcode NCHAR(3),
supervisor NCHAR(5)
)

i have tried a variety of statements using having statement and count but the dont seem to work:/

select emp_id, name from employee where position='manager'; i tried this but it doesnt work anoune smart that knows how to do it?


saddf
Go to Top of Page

TG
Master Smack Fu Yak Hacker

6065 Posts

Posted - 2013-12-04 : 16:38:03
Natalia89,
please start a new thread for this (unrelated) question. Maybe title it "how to do a self join". Perhaps that is enough of a hint that you don't need to post anymore

Be One with the Optimizer
TG
Go to Top of Page

badlydressedboy
Starting Member

4 Posts

Posted - 2013-12-05 : 00:28:29
quote:
Originally posted by ajazz



i wish to attach the text file. is it possible ?



Import the file to a table using the import wizard (right click on your database in management studio->tasks->import data)

Performance Tuning & Monitoring Software: unspammed
Go to Top of Page

Paul J. Brooks

7 Posts

Posted - 2013-12-05 : 10:22:57
This is very good approach for every one and beneficial for every one.Programing is the main part of IT.i wanna discus on this topic and any body online so reply me i m waiting.
unspammed
Go to Top of Page
   

- Advertisement -