The scripting tag has no wiki summary.
0
votes
0answers
23 views
File Maker Script Relative Cell Value [migrated]
I'm new to FileMaker as well as Database administration in general.
In my table, every Record contains a link to an Adobe Illustrator file and two Photosho files. The layout speciies a button for ...
1
vote
1answer
31 views
Drop database from remote that has connected users
I have a "small" problem. There is a database server that contains a database where some test frontends are connected to. I want to update that database from a dump + some scripts to the most recent ...
3
votes
1answer
89 views
Variable substitution in psql when using \copy
I'm using the psql command \copy and I would like to pass a variable to it from the shell (for table name) like I've done when scripting queries. I've read in the documentation for psql that:
The ...
2
votes
1answer
47 views
How to create an object and then alter it
I'm using sql server 2012:
I would like to script out creation of an object(if it doesn't exist first), and then alter it.
I'm trying to avoid the usual drop/create as it would impact stats. It ...
2
votes
2answers
207 views
Perl vs Ksh for Unix Database Administration
I realize this is a somewhat more subjective question, but I am looking to the community for guidance.
Our company is fairly new to having DBAs. We used to use DB2 for i on the IBM's iSeries servers, ...
0
votes
2answers
363 views
Reloading .sql file from java into PostgreSQL - Windows
I am trying to reload a .sql script file into PostgreSQL from my sample Java application.
Script is successfully executed from console as well as from pgAdmin tool. But from Java, it hangs...
This ...
2
votes
2answers
155 views
Defrag a HEAP by creating clustered index and immediately dropping it
I'm writing a script which intends to defrag a HEAP based table by creating a dummy col with a clustered index and then immediately dropping it. (It's someone else's app and I don't want to make any ...
2
votes
2answers
1k views
How to store single result in variable and reuse it in a query (Oracle)?
I have a query like
SELECT id FROM xyz WHERE ...;
which has a more or less complex WHERE clause and returns exactly one row with one column (ID). I need this ID for several later queries in a ...
3
votes
2answers
240 views
How to compare two SQL Servers instance level objects for a migration?
I'm currently working on a SQL Server migration (from a SQL Server 2005 to a 2008 R2 server, on a new physical server).
The databases themselves will be transferred using a database backup and ...
1
vote
1answer
90 views
Regularly import tab-seperated log file to MySQL
I'm looking to keep arpwatch entries in a MySQL database to crossreference with other information I'm storing based on mac addresses. I've manually imported the arpwatch database into my mysql ...
0
votes
2answers
100 views
Auto Script DB Objects for SVN
My Boss requires that we keep up to date scripts of all database objects in svn. This results in constantly trying to find the object in the current script and copy and pasting the changes.
Is there ...
2
votes
2answers
186 views
Save Results of DBCC ShrinkFile
When we execute the following command:
DBCC SHRINKFILE('MyDB_log', 1)
We get the following results in SSMS:
DBID | Field | CurrentSize | MinimumSize | UsedPages | Estimated Pages
...
3
votes
2answers
525 views
Easy way to check connectivity to SQL Server from client
For troubleshooting purposes, I would like to be able to check if a client can connect to a SQL Server instance, independent of the application that possibly can't connect to the SQL Server.
Is there ...
-1
votes
1answer
98 views
Selecting just one table from Oracle view [closed]
I am creating a view to ease my manual selecting because I only want to fetch data from DB where it is meeting certain criteria which are present in several tables, so it is containing a lot of joins.
...
2
votes
3answers
138 views
What is running right now?
I know I can use "show processlist" to see what is running when I'm in the office. How can I see what is running when I'm not there.
Something is running on my server at 3am every morning that is ...
1
vote
1answer
779 views
Drop multiple databases in one script
I am trying to figure out how to drop multiple databases on PostgreSQL in one sql script. I preferably need it to work both when executed in pgAdmin console, and when used in psql command line tool. ...
4
votes
1answer
326 views
How, if possible, can an .sql file be executed against an oracle database from a bash script
Is it possible to execute an sql file (a text file containing several SQL statements) against an oracle database from a bash shell command line (e.g. no graphical GUI and no interactive clients)
...
2
votes
0answers
771 views
SQL*Plus, @, and relative paths
Somehow, it seems that SQL*Plus (at least on Windows) is unable to locate a script with a relative path when called with @@ and when the path starts with a single or double dot.
For example, under ...
1
vote
2answers
205 views
PostgreSQL Database Migration
How can I migrate data from on PostgreSQL database to another PostgreSQL database? Is there any technique to migrate data with SQL scripting?
6
votes
2answers
1k views
Is there any collection of PowerShell scripts that help the task of SQL Server maintenance?
I've been studying PowerShell and I've been (slowly) getting it into my day-to-day DBA tasks.
So far I've seen a bunch of disconnected PowerShell scripts for many disparate administration activities.
...
3
votes
2answers
287 views
Scrubbing Names via SQL Query/Batch
We have sensitive information (names of people) and we're looking to put into place a script to "scrub" of the names. Has anybody come up with a good algorithm to do this, something other than just ...
1
vote
1answer
104 views
Is it possible to allow write-through computed columns for legacy code that expects a column to be read/write?
I have this existing table for IP storage:
CREATE TABLE [dbo].[IPAddresses](
[ID] [int] IDENTITY(1,1) NOT NULL,
[IPv4Address] [varchar](15) NULL,
[IPv6Address] [varchar](45) NULL,
...
1
vote
2answers
1k views
Exporting table records to an INSERT script
I'm setting up a test environment for development and need to export some static data from tables in Production. Ideally the exported product would take the form of a script with all the required ...
1
vote
3answers
579 views
SQL Server 2008 R2 Express Edition - generating database create script
I need to script a database schema out to T-SQL for inclusion source control. The Express version of SSMS doesn't seem to let you script the entire database, just individual tables. Are there any free ...
8
votes
2answers
1k views
Script out Oracle DDL in an automated fashion
Oracle SQL Developer is able to export DDL through Tools -> Database Export... This works very well, but requires manual intervention.
I know of DBMS_METADATA.get_ddl(), but have found that the ...
14
votes
3answers
394 views
Alternatives to concatenating strings or going procedural to prevent SQL query code repetition?
Disclaimer: Please bear with me as someone who only uses databases a tiny fraction of his work time. (Most of the time I do C++ programming in my job, but every odd month I need to search/fix/add ...
4
votes
2answers
240 views
How to manage my own scripts
Every administrators, developers have their own collection of scripts (some patterns). Time to time they are dismissed from one job and they are employed to other one. Is there any good, easy used, ...
12
votes
2answers
11k views
How to pass in parameters to a SQL Server script called with sqlcmd?
Is it possible to pass parameters to a SQL Server script? I have a script that creates a database. It is called from a batch file using sqlcmd. Part of that SQL script is as follows:
CREATE DATABASE ...
