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
 Connecting to a DSN Source

Author  Topic 

my_xr6_turbo
Starting Member

4 Posts

Posted - 2012-08-10 : 22:32:57
Hey guys, I'm super new to SQL. I know what I need to do but I just don't know the commands. Can someone help me with the command to connet to an DSN Source. Here is the query I have at the moment but I know it's wrong.

Insert into Absences ([StdID], [Date], [Approved], [Absences])
Select [stdid], [date], [approved], [absences]
FROM Absences IN '' [ODBC;DSN=OldData;];

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2012-08-10 : 22:37:52
you should be using openrowset i guess

http://msdn.microsoft.com/en-us/library/ms190312.aspx

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page

my_xr6_turbo
Starting Member

4 Posts

Posted - 2012-08-15 : 02:19:28
Great I now have it working, but I'm getting a funny error.

Here is the query:
select * from OPENQUERY(NEXUS,'select ABS from ABS')

Error:
Msg 7347, Level 16, State 1, Line 1
OLE DB provider 'MSDASQL' for linked server 'NEXUS' returned data that does not match expected data length for column '[MSDASQL].ABS'. The (maximum) expected data length is 119, while the returned data length is 120.
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2012-08-15 : 10:22:23
are you trying to insert this somewhere?

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page

my_xr6_turbo
Starting Member

4 Posts

Posted - 2012-08-15 : 17:20:09
I will be inserting it into a table but at the moment I'm just trying to get the query to work.
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2012-08-15 : 22:52:21
might be of help

http://social.msdn.microsoft.com/Forums/en/sqlservermigration/thread/446e129b-dc86-4f7f-b217-ffc08d874b31

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page
   

- Advertisement -