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
 SQL Server 2008 Forums
 Transact-SQL (2008)
 SQLCMD

Author  Topic 

xpandre
Posting Yak Master

212 Posts

Posted - 2015-03-11 : 14:37:10
Hi,

Can we use SQLCMD to execute scripts @ an HTTP location?

Thanks
Sam

gbritton
Master Smack Fu Yak Hacker

2780 Posts

Posted - 2015-03-11 : 14:53:18
SQLCMD can execute a script against a SQL Server. If the same server also hosts a web server, then the answer should be yes. However, this is not a common production scenario. Tell us more about what you are trying to accomplish.
Go to Top of Page

xpandre
Posting Yak Master

212 Posts

Posted - 2015-03-11 : 15:07:26
Actually we are trying for a deployment automation.

I check-in code into SVN.

A build process picks it up from SVN and pushes it to my artifactory repository (eg : http://artifacts/database/release1/Deploy/*.sql)

A deployment process picks up all sqls from this location and does the deployment (I am planning to use sqlcmd)



Go to Top of Page

gbritton
Master Smack Fu Yak Hacker

2780 Posts

Posted - 2015-03-11 : 15:39:23
OK -- well SQLCMD can process input files specified like this:
-i C:\<filename>

-i \\<Server>\<Share$>\<filename>

-i "C:\Some Folder\<file name>"

Note the HTTP is not there. basically SQLCMD just tries to open the file. Which will work if the file is local or mapped or on a UNC share. I don't believe it will use HTTP to get files. No, I am certain it won't
Go to Top of Page
   

- Advertisement -