SQL Questions


How to remove specific lines from a text files using either vbs or bat.
We have a text file that is a result of an export from an application we have. We use the following bat file to rename and remove blank lines from it based on the way it exports the export options/format cannot be changed. I would like a way to add to this bat file a [...]

Answer Question   |  November 9, 2010  5:07 PM
Batch file, Batch job, SQL, Text manipulation, VBS, Visual Basic Script, Windows Server 2003 Standard Edition
asked by:
1,050 pts.

SQL Server 2005 Enterprise Edition SP3 Performance
We have SQL SERVER 2005 SP3 Enterprise 32-bit running on a windows server 2003 Enterprise 32-bit with 32GB of RAM and 8 dual core processors. Our CPU, RAM, and I/O are always through the roof and the application is always running slow. We use AWE for buffer cache the maximum memory is 28GB, the PAGEIOLATCH_SH [...]

Answer Question   |  January 31, 2011  3:27 AM
SQL, SQL performance, SQL Server, SQL Server 2005, SQL Server 2005 SP3, SQL Server Enterprise Edition
asked by:
585 pts.

SQL SERVER 2005 Database Options
We have a database in production that is 500GB, what are the pros and cons for setting the ”Page Verify” option to ”NONE” on the database for best performance? How will ”TORN_PAGE_DETECTION” and “CHECKSUM” affect performance?

Answer Question   |  October 28, 2010  3:08 PM
SQL, SQL Database, SQL Server, SQL Server 2005, SQL Server 2005 Database
asked by:
585 pts.

SQL Server 2005 Memory
I have a server with 8 dual core processors, 32GB of RAM, windows server 2003 32bit, sql server 2005 enterprise, and a 500GB database running on it. 1. How does sql server use memory in this case? 2. I have heard from sql server pro’s that sql server can only use 4GB of RAM is that [...]

Answer Question   |  October 26, 2010  1:54 PM
SQL, SQL 2005, SQL Server, SQL Server 2005, SQL Server memory
asked by:
585 pts.

Why does SQL server use no more than 500MB in RAM?
Why does sql server use no more than 500mb in ram? We have sql server 2005 running on server 2003 32bit with 32GB of ram and in the task manager under processes, Mem Usage sqlservr.exe is only using 430, 268 K. SQL Server min memory is set to use 25GB and max is set to use [...]

Answer Question   |  October 15, 2010  5:50 PM
CPU, RAM, SQL, SQL Server, SQL Server 2005, SQL Server memory, Windows Server 2003 32-bit
asked by:
585 pts.

Copy a SQL Binary Large Object (BLOB) from one database to another
Is there  a way to find out the name of a Blob stored in a database. I am trying the code below and apparently the name is not correct. SQL> Declare   2   tpsr Blob;   3   spsr blob;   4  Begin   5   Select ’8502′ into tpsr from ca90joetmp.spec_form_psr where spec_form_id = ’90710′;   [...]

Answer Question   |  October 14, 2010  7:01 PM
Binary Large Object, BLOB, SQL, SQL Database Transfer
asked by:
15 pts.

NTVDM encountered a hard error installing SQL 2000 onto Windows Server 2003
Trying to install SQL server 2000 on windows 2003 Server SP2 I got ntvdm encountered a hard error. Please help

Answer Question   |  October 14, 2010  2:07 PM
NTVDM, NTVDM HARD ERROR, ntvdm.exe error, SQL, SQL Server 2000, WEBPASS, Windows Server 2003 SP2
asked by:
5 pts.

SQL Server date format
Hello, I have a problem when i am inserting a string date ie 19/9/2010, which is stored in table as 9/19/2010.  i want to insert dd-mon-yyyy format. can i insert dd-mon-yy format,please replay. 

Answer Question   |  April 19, 2011  11:28 AM
SQL, SQL Server, SQL Server DateTime, String manipulation
asked by:
75 pts.

openquery no records returned SQL Express 2008
I run theis procedure against a link server (Quickbooks) It runs with no errors but will not return records. SELECT   *   FROM QODBC …Customer

Answer Question   |  October 10, 2010  10:33 PM
openquery, SQL, SQL Express 2008, SQL Query
asked by:
5 pts.

Help needed for connect statement using sqlrpg
Hi All, I need to do some checking in 2 different AS400 servers. I will read the data from one server(say local) then using connect type 2, connect to the other server(say remote), check the data and then returns back to my local server. I’m using sqlrpg for this and created 2 pgms for this. One will [...]

Answer Question   |  October 21, 2010  9:39 AM
AS/400, AS/400 Server, RPG, SQL, SQLRPG
asked by:
80 pts.

SQL Server Profiler
What numbers are considered high when using sql server profiler for reads, writes, and duration

Answer Question   |  October 8, 2010  10:00 PM
SQL, SQL 2005, sql 2005 Performance Issues, SQL Profiler, SQL Server, SQL Server 2005
asked by:
585 pts.

Upgrading from SQL Server 2000 to SQL Server 2005
We want to upgrade our SQL Server 2000 to SQL 2005. What should we watch out for and what is the actual procedure for the upgrade? Will it require another server or can the upgrade be done in place?

Answer Question   |  October 4, 2010  2:29 PM
SQL, SQL Server, SQL Server 2000, SQL Server 2005, SQL Server 2005 upgrade, SQL Upgrades
asked by:
1,110 pts.

Row by Row Stored Procedure in SQL Server 2008 R2
Hi All, hopefully someone will be able to help me here – i am nearly there but can’t get it right, i am trying to create a stored procedure that when runs will do a query and then send send an email out for each of the rows that it returns. e.g. if i have [...]

Answer Question   |  October 4, 2010  1:36 PM
SQL, SQL Server 2008, SQL Server 2008 R2, SQL stored procedures, Stored Procedures
asked by:
65 pts.

How to count the common column rows in the table for each column and row…..
I have a table and that table have columns like d1,d2,d3,d4……. d1      d2    d3    d4 ————————— 200   300   100  300 100   200   101  101 300   —    300  200 how can i display the output like below…  for each row…. ColumnD1 Count 200    3 100     3 300     4 Please help me on this,…………….i am new to the [...]

Answer Question   |  October 1, 2010  5:51 PM
SQL, SQL 2008, SQL Column Headings, SQL Server 2008
asked by:
15 pts.

Embedded SQL in RPGLE
I am trying to get some counts and totals from one file and put them in another. My SQL statement works fine with STRSQL, not in the RPGLE. Do I have to declare/set a cursor, exec sql and close the cursor just to put the total in another file? C/EXEC SQL C+ INSERT INTO outputfile [...]

Answer Question   |  September 29, 2010  2:02 PM
Embedded SQL, MySQL, RPGLE, SQL, SQL statements
asked by:
165 pts.

MSQL Auditing
Hello. I’m dot.net developer, and i’m working a lot with MSQL. My current task is when some user executes select query on database, i should ”catch” the query data. What do i mean is if select query is “select * from UsersTbl where UserID = 5″, i have to get  ’5′. Does somebody have any idea where to start??? Thanks [...]

Answer Question   |  April 9, 2011  8:25 AM
Auditing, dot.net, MySQL, MySQL query, SQL, SQL audit, SQL Query
asked by:
5 pts.

Production SQL Database has been restored with Old database backup
Dear Expert, I need your Advice, today in morning i run Symantec backup restore on SQL 2008 server where i overwrite the production Database with Old backup. Is there any way i can retreive the old Database until yesterday. i dnt have any backup of New database which i accidentally overwritten.   Please help me

Answer Question   |  September 27, 2010  4:33 PM
Exchange, SQL, SQL 2008, SQL Database, SQL Server 2008, Symantec, Symantec Backup Exec
asked by:
5 pts.

SQL Server I/O
Hello, we have a database that contains three tables. Each table has more than 25,000,000 rows in them. All three tables are in the same file group, array, and drive. Our daily Avg physical I/O is 1,000,000. Our users are complaining that the system is slow daily. Everytime a user writes to any of thos [...]

Answer Question   |  September 24, 2010  8:36 PM
Average Disk Queue Length, SQL, SQL Server, SQL Server 2005
asked by:
585 pts.

SQL RPGLE – How to override data set data structure at run time
I currently have an SQL RPGLE routine that receives a SELECT statement as a parameter and then fetches the data set into a data structure based on the file. This only works over a single file as the datastructure is created at compile time and has to be based on filea. I would like to [...]

Answer Question   |  September 23, 2010  1:43 PM
iSeries, RPGLE, SELECT statement, SQL, SQL Select statement problem, SQLRPGLE
asked by:
20 pts.

Migrate MYSql database to SQL 2005
We are looking to migrate from MySql to a full blown iteration of SQL 2005. Are there tools in place that will allow us to migrate our data and tables or are we on our own for getting our data into the MS database?

Answer Question   |  September 21, 2010  3:14 PM
MySQL, MySQL Database, MySQL functions, SQL, SQL 2005, SQL Server 2005, SQL Server migration, Windows
asked by:
9,815 pts.