Hi,
I'm updating a database with a sql file .I was wondering how to call a sql file inside a sql file .
The sql files are used for updating databases .
Maybe use xp_cmdshell to load the text of the sql file into a record w/ a 8000 varchar field size ... if the text is small enough to fit. Then dynamically build the query, w/in the query, by pulling that value from the table.
I am not failiar w/ using other "larger" fields to do this if the sql file is greater than 8000 characters ... But I am SURE some of you other gurus are!
Actually I can run a sql file from a query analyzer which can be done by opening from the menu->file ->open . I'm curious how to call a sql file or query file from another sql or query file.
Thanks!
Actually all this exercise is for updating a production database in a streamlined manner .
1.creation of new sql stored procedures
2.updates of old stored procedures
3.create/update tables
4.adding indexes
I was planning on having a bat file and then call all the sqlscripts inside that bat file . I did
try to use OSQL and it seem to work when i call a file inside that bat file.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.