scripting

a MYSQL script to convert the column names to lowercase

亡梦爱人 提交于 2019-12-18 13:36:08
问题 I am looking for a single MYSQL script to convert ALL column names in a database to lowercase in one go... I have inherited a MYSQL database that has a lot of mixed case column names (150 tables with a strange naming convention) and I don't want to go through manually each table by table to do this. Has anyone got such a script? Thanks 回答1: You can solve this task by building a script, starting with the output from this statement: SELECT table_name, column_name, data_type FROM information

How to determine the session id on remote machine for usage with psexec -i using script/powershell/…?

試著忘記壹切 提交于 2019-12-18 12:35:31
问题 I am in need of a script or powershell command that will be able to determine the session id of a specific logged in user on remote machine, to be later used as parameter to the psexec -i execution of remote gui process on that session of that user on the remote machine. So far i managed to use psexec \\remoteMachine -u user -p pswrd query session to get list of sessions on the remote machine: SESSIONNAME USERNAME ID STATE TYPE DEVICE console 0 Conn wdcon rdp-tcp#919 user 1 Active rdpwd rdp

Running JavaScript downloaded with XMLHttpRequest

↘锁芯ラ 提交于 2019-12-18 12:27:45
问题 I have a site that loads information using the XMLHttpRequest when a user clicks a link. The system works well but I would like to be able to execute JavaScript gathered in this process. This is a problem as I would like to download the scripts 'on demand' if it were, rather than loading them all when the page is loaded. Thanks for any help 回答1: I believe the recommended solution is something like this: function include(scriptUrl) { var xmlhttp = new XMLHttpRequest(); xmlhttp.open("GET",

.net scripting languages [closed]

匆匆过客 提交于 2019-12-18 12:27:18
问题 Closed . This question is opinion-based. It is not currently accepting answers. Want to improve this question? Update the question so it can be answered with facts and citations by editing this post. Closed 5 months ago . what do people use for scripting in .net apps. New question after MS drops IronPython IP used to be my favorite; then Lua What do I mean by scripting. I mean I have a large system management tool that allows users to plugin bits of smartness, this include assemblies and

Schedule scripts without using CRON

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-18 12:16:22
问题 I know there are many posts about using CRON to run a php file. But, in the world of shared hosting, and ease of setup for a user, I don't want to have to mess with that. I found another solution online that has to do with sockets. Just wanted to get everyones take on this, and tell me if this is a good or bad idea. Sounds like it works well. Thoughts? //Open socket connection to cron.php $socketcon = fsockopen($_SERVER['HTTP_HOST'],80,$errorno,$errorstr,10); if($socketcon) { $socketdata =

HOWTO: Detect bash from shell script

£可爱£侵袭症+ 提交于 2019-12-18 11:57:33
问题 The scenario is that users are asked to source a script file: $ source envsetup.sh This script file may use bash only feature so we have detect the running shell is bash or not. For other shells that share common syntax with bash, for example, sh, zsh, ksh, I'd like to report a warning. What is the most reliable way to detect the current shell across Linux, Cygwin, OS X? What I know is $BASH, but I am wondering the chances it could fail. 回答1: There are a bunch of environment variables that

HOWTO: Detect bash from shell script

二次信任 提交于 2019-12-18 11:57:03
问题 The scenario is that users are asked to source a script file: $ source envsetup.sh This script file may use bash only feature so we have detect the running shell is bash or not. For other shells that share common syntax with bash, for example, sh, zsh, ksh, I'd like to report a warning. What is the most reliable way to detect the current shell across Linux, Cygwin, OS X? What I know is $BASH, but I am wondering the chances it could fail. 回答1: There are a bunch of environment variables that

Can I get the absolute path to the current script in KornShell?

流过昼夜 提交于 2019-12-18 11:49:42
问题 Is it possible to find out the full path to the script that is currently executing in KornShell (ksh)? i.e. if my script is in /opt/scripts/myscript.ksh , can I programmatically inside that script discover /opt/scripts/myscript.ksh ? Thanks, 回答1: You could use: ## __SCRIPTNAME - name of the script without the path ## typeset -r __SCRIPTNAME="${0##*/}" ## __SCRIPTDIR - path of the script (as entered by the user!) ## __SCRIPTDIR="${0%/*}" ## __REAL_SCRIPTDIR - path of the script (real path,

Generate SQL server scripts from command line?

帅比萌擦擦* 提交于 2019-12-18 11:25:23
问题 In Microsoft SQL Server Management Studio 2008 there is a "Generate scripts..." option under the Tasks menu. I'm just wondering if this tool is available from the command line somehow? It looks similar to the sqlpubwiz.exe command line tool that was available for SQL Server 2005, but I can't find this executable anywhere in the SQL 2008 installation. 回答1: The script generating options of Management Studio are just a wrapper around the SMO scripting capabilities. Simple scripts are obtained by

Can I create a One-Time-Use Function in a Script or Stored Procedure?

徘徊边缘 提交于 2019-12-18 11:15:59
问题 In SQL Server 2005, is there a concept of a one-time-use, or local function declared inside of a SQL script or Stored Procedure? I'd like to abstract away some complexity in a script I'm writing, but it would require being able to declare a function. Just curious. 回答1: You can call CREATE Function near the beginning of your script and DROP Function near the end. 回答2: You can create temp stored procedures like: create procedure #mytemp as begin select getdate() into #mytemptable; end in an SQL