S+ has a native SQL Server driver, so it should be pretty easy. Here
is some code I used on version 6.2 to connect to a database on a
server. Since your running the database on the local machine you will
have to adjust that, but I am not sure how.
sqlText <- paste("select trt, datadate from roger_return_1m where
gvkey='",gvkey,"' order by datadate",sep="")
output <- importData(type="DIRECT-SQL", user="xfl", password="xfl",
server="rinnycs0059", database="xf", table="", sqlQuery=sqlText)
HTH,
Roger
On 6/8/05, Arjun Bhandari <arjun_bhandari@yahoo.com> wrote:
> Hi,
>
> I have an sql server running on my machine, but when I
> try to use the import data feature to import from one
> of the databases i have created on the server, i
> cannot see the database. is there any change that
> needs to be done to the settings such that i can see
> that database and write sql queries on the tables in
> that database.
>
> I am using s+ version 6.2
> Best Regards,
> Arjun
>
> __________________________________________________
> Do You Yahoo!?
> Tired of spam? Yahoo! Mail has the best spam protection around
> http://mail.yahoo.com
> --------------------------------------------------------------------
> This message was distributed by s-news@lists.biostat.wustl.edu. To
> unsubscribe send e-mail to s-news-request@lists.biostat.wustl.edu with
> the BODY of the message: unsubscribe s-news
>
|