SQL scripts Questions


Validate SQL and display the output
I have a screen where the user can enter an SQL script, I need to validate whether the SQL query is a valid one, if so then display the output on to the screen. I am planning to execute a SQL prepare statement out of the script entered and then use SQLCOD to determine whether [...]

Answer Question   |  January 29, 2013  8:14 AM
SQL Query, SQL scripts, SQLRPGLE
asked by:
1,955 pts.

Update a Date_Time Field
I’m trying to update a DATE_TIME field to a NULL value. When I run the script below I get an error. Any ideas on what I’m missing? UPDATE Orders SET CONFIRMATION_DATE_TIME = ‘ ‘ WHERE ST_ID = 102690 ERROR: Msg 245, Level 16, State 1, Line 1 Syntax error converting the varchar value ‘Ê’ to [...]

Answer Question   |  March 31, 2012  3:05 PM
Scripts, SQL, SQL 2005, SQL scripts, SQL Server 2005
asked by:
130 pts.

Update SQL Server 2005 Scripts
I don’t right code & don’t have the confidence to try on my own so, I’m asking for help. I need to run an update script to clear out the data from iweb_conf_demo.Attendee_ribbons. Then I’ll need to run multiple scripts to update multiple records on the same field iweb_conf_demo.Attendee_ribbons for different groups of registrants. For [...]

Answer Question   |  March 31, 2012  1:19 PM
SQL, SQL scripts, SQL Server 2005, SQL Server Scripts
asked by:
130 pts.

Running a script against local SQL servers
Hi guys i am trying to run a script against local servers stored on a txt file i have already used osql to list the output to a text file. but after this probs

Answer Question   |  May 22, 2011  7:59 PM
SQL, SQL Scripting, SQL scripts, SQL Server, Windows XP
asked by:
5 pts.

Create QA database with only some production tables
I have a large database with some tables that have largely static data. I need to make a new database on a different server with the same table structure with the static data tables intact (keys, etc.). The other tables must be empty. They’re all in the same filegroup in the original database. I’ve done [...]

Answer Question   |  December 16, 2010  1:50 PM
Clone database, Filegroup, QA, SQL scripts, SQL Server 2008, SQL Server tables
asked by:
5 pts.

mssql login script
Hello, Can anyone give me a simplet powershell script to check login attempt to remote MSSQL database.For eg: if i have a database “db” in remote sql server say 192.168.1.10 which having username”test” and password as “password”.If the login is successful its output should shows as “OK” in powershell prompt itself or  as “FAIL”,if it [...]

Answer Question   |  February 18, 2010  8:29 PM
MSSQL, PowerShell Scripts, SQL 2005, SQL scripts, Windows Server 2008
asked by:
5 pts.

SQL Script with hyphen in the value set
We have a particular piece of malware that will put some binary code in the HKLM/System/ControlSet001/Services/{5083B7D5-47AF-8FF9-657C651C2B10}/ I am using an sql script along with Microsofts logparser to parse some data out of the registry on a windows box and I am having trouble with the last bit of the code. The data is located at [...]

Answer Question   |  January 23, 2010  9:03 PM
SQL Scripting, SQL scripts
asked by:
5 pts.

Retreiving AS/400 SQL scripts
When I start sql on our iSeries, the system returns my previous scripts I have run. Which fle do these live in in the iSeries and can I report on them?

Answer Question   |  October 12, 2009  2:33 PM
i570, iSeries SQL, SQL commands, SQL scripts
asked by:
10 pts.

dba deleting data
Is part of a DBA’s job to delete production data using SQL scripts?

Answer Question   |  August 26, 2010  7:49 PM
Database Administrator, DBA, SQL scripts
asked by:
5 pts.

SQL script to disable views after a demo period.
Hi, I have a sql view that I created for someone on a test basis. I want to create something (stored procedure, trigger, etc) that will delete or disable this view after a 30 day trial period. I prefer to make the view unvisible even to the “sa” administrator so that the view can not [...]

Answer Question   |  June 23, 2009  3:25 PM
SQL, SQL scripts, SQL Server 2005
asked by:
5 pts.

runScript() returning null
Hello to all of the participants. This is my first blog. This is a program to execute .sql file which contains bunch of sql statements. I have used iBatis package it’s compling and executing with out any mistakes, but resulting nothing. I have tried in both 2.3 and 2.0 release also. Can any one make [...]

Answer Question   |  June 1, 2009  1:13 PM
iBATIS, SQL scripts, SQL statement
asked by:
5 pts.

Display Query for OS/400 SQL script
Is it possible to view the SQL that is generated by a query created in Query for OS/400. I have the query defined as I want it and would now like to give the SQL script to my development team to use in automating reports by accessing the database directly.

Answer Question   |  May 19, 2009  3:15 PM
OS/400, OS/400 Query, Query for OS/400, SQL scripts
asked by:
75 pts.

How to run SQL script with parameters in CL
I have to call an sql script with parameters from an existing cl program that runs daily (in batch). If I call it from the cl program, it is giving me this error “Pointer not set for referenced location referenced”.

Answer Question   |  March 24, 2009  11:48 PM
AS/400 Control Language, CL, SQL, SQL scripts, SQL/400
asked by:
Ara
5 pts.

Send a email with attachment?
How do I send a email with attachment in a sql script using SQL2000

Answer Question   |  February 25, 2009  2:30 PM
SQL 2000, SQL scripts
asked by:
20 pts.

SQL Cursor to use or not to use
Hi, I’ve been told to never use cursor in SQL, because of possibility of memory leak, etc. But I have no idea of how to implement my script without them. My script doesn’t execute anything on the database, it simply use cursor to create another TSQL script that does the execution. EG. open cursor to [...]

Answer Question   |  January 7, 2009  1:39 PM
SQL, SQL Cursors, SQL scripts, T-SQL
asked by:
290 pts.

deployment
While running the setup on client machine, An error Number 5 occurred telling – “An error has occurred while establishing a connection to the server. When connecting to SQL server 2005., this failure may be caused by the fact that under default settings SQL server does not allow remote connections. (Provider: Named pipes provide, error:40 [...]

Answer Question   |  November 20, 2008  1:58 PM
SQL error messages, SQL scripts, SQL Server 2005
asked by:
5 pts.

SQL script output to a file
I am running ad hoc SQL scripts in iSeries Navigator (V5R4) and need to direct the output to a text file. Is there a way to do this? TIA… Steve B

Answer Question   |  December 15, 2008  4:54 PM
AS/400 database, AS/400 DB2, iSeries database, iSeries DB2, iSeries Navigator, SQL scripts, V5R4
asked by:
415 pts.

Read Only Table
I create a table in sql server 2k5, the script is look like this: CREATE TABLE [dbo].[tb1PmtD]( [PmtDLU] [int] NOT NULL, [PmtDInvLU] [int] NOT NULL, [PmtDAmount] [money] NOT NULL ) ON [PRIMARY] GO ALTER TABLE [dbo].[tb1PmtD] WITH NOCHECK ADD CONSTRAINT [tb1Pmttb1PmtD] FOREIGN KEY([PmtDLU]) REFERENCES [dbo].[tb1Pmt] ([PmtID]) ON UPDATE CASCADE GO ALTER TABLE [dbo].[tb1PmtD] CHECK CONSTRAINT [...]

Answer Question   |  September 10, 2008  9:08 PM
File permissions, Microsoft Access, SQL scripts, SQL Server 2005
asked by:
40 pts.

SQL Script
I am trying to write a sql script that will ask for a date range each time it’s run. How do I do this?

Answer Question   |  August 29, 2008  2:16 PM
Date calculation, SQL scripts
asked by:
5 pts.

Migrating shell scripts
We have to move more than 250 shell scripts from a unix to a linux environment, and also 100 sql scripts. Could you please give me some steps or a check list to follow to migrate these from unix to linux?

Answer Question   |  August 4, 2008  4:35 PM
Migration, Scripts, Shell scripts, SQL, SQL scripts, Unix
asked by:
110 pts.