Showing posts with label t-sql. Show all posts
Showing posts with label t-sql. Show all posts

Tuesday, March 27, 2012

FTP from within T-SQL

I am using SQL 2000 on a Win 2k server. I have read some where that
you can fire FTP commands from within t-sql statements.

Something like a stored proc that gets called by a job every night
that would build a recordset and then ftp it out to another server as
a txt file.

I understand that DTS can do something like this, but I would like to
see if it can be handled from within a t-sql procedure.

Curious and stubborn!

Any help would be greatly appreciated.

Thanks,
Davefunkdm1@.yahoo.com (Dave) wrote in message news:<f5174e0f.0405101837.5f6c1e53@.posting.google.com>...
> I am using SQL 2000 on a Win 2k server. I have read some where that
> you can fire FTP commands from within t-sql statements.
> Something like a stored proc that gets called by a job every night
> that would build a recordset and then ftp it out to another server as
> a txt file.
> I understand that DTS can do something like this, but I would like to
> see if it can be handled from within a t-sql procedure.
> Curious and stubborn!
> Any help would be greatly appreciated.
> Thanks,
> Dave

You could use FTP from TSQL in a couple of ways, although it's
debatable if you should or not. The simplest is probably to use
xp_cmdshell to run an external batch file or script which does the
FTP. A more complex option is to use the sp_OA% procedures to work
with a COM component which can do FTP.

If you want to get results into a file, it may be easier to use
bcp.exe or osql.exe in a batch file to get the result set from the
procedure directly into a file, rather than drive it from the stored
procedure itself.

DTS is often a better general option, although the FTP task can only
GET, not PUT. There is an alternative implementation that will do
both, however:

http://www.sqldts.com/?302

Simon

Monday, March 19, 2012

From databasediagram to T-SQL

Hello, i have made a diagram in a SQL Express database.
i would like to know how to get this to T-SQL CREATE TABLE script?
Cool [H]I don't think you can use SQL Express to do it but we are still in beta so use the link below and download the developer edition to do it. How you use the OLTP(online transaction processing) management studio it is like your Enterprise manager in SQL Server 2000. Hope this helps.
http://www.microsoft.com/sql/2005/productinfo/ctp.mspx#EBAA|||

Thanks i understand. I think this is a pretty imporant feature. Because if i have made a Table Diagram in VWD and would like to show it to a friend, i want to be able to convert this diagram to a SQL CREATE TABLE txt script. so my friend can just copy this SQL txt script into his VWD and show up exactly the same tables.

|||Hello, i noticed that i actually can get this diagram to a T-SQL CREATE TABLE script, by clicking on the "Generate change script", but this "menubutton" is only available if i made a change to the database, and because of this i cannot just generate the script when i want to, i have to make changes to the database to do it, i think this is a unnecessary step, this "menubutton" "generate change script" should be available all the time, and it should be renamed to "generate script" so i can generate the T-SQL script whenever i want to.|||Try the post below and test drive the latest CTP, it may be different. Hope this helps.
http://forums.asp.net/1052509/ShowPost.aspx