So to my fellow readers (mainly my partner and friends) prepare to be shocked ...
Dropping attached Sql Database
Here is the first one I made this week at work, nothing fancy just drops an attached database. I got sick and tired of constantly doing it and I did it infrequently enough that I forgot the syntax, but frequently enough for it to annoy me.
First you need to have the command in an .sql file
drop table Tablename
go
Then you need the actual batch file to run it
@echo off <--ED: Still no idea what this line actually does but all batch examples I've seen have them
sqlcmd -i Filename
Thats it. Simple right? but it saves me so much time.
Setting a local environment variable
So where I work you need to set environment variables to allow for fancy dev functions. However once they are set you never really need to bother with them again. Unless you reinstall your working environment. That is where I came up with the idea for the other one
@echo off
setx Variable value
Once again very simple, but its a start.
No comments:
Post a Comment