i have 2 tables unittypes,rules unittypes has unitid and description unitid description A1 description1 A2 description2 A3 description3 rules has id unitid 1 A1,A2 2 A1,A3 i am trying to get it to get a resultset like 1 description1,description2 2 description1,description3 the sql i wrote was select r.unitid ,(select distinct description from unittypes where unittypes.unitid [...]
CREATE VIEW [dbo].[vwResults] AS SELECT r.ResultsPK, b.PersonID, dbo.ltcPerson.FirstName, dbo.ltcPerson.LastName, dbo.ltcPerson.PersonFriendlyID, b.DateCreated, b.FormName, r.FieldName, r.ValueString, r.ValueNumber, r.ValueDate, r.ValueTextInt, r.ValueBit, b.UserID, b.BatchID, b.ParentID, r.Active, CASE WHEN b.ParentID = 0 THEN 0 ELSE 1 END AS IsChildRecord, CAST(b.PersonID AS varchar(4)) AS PersonIDStr FROM dbo.ltcBatch b INNER JOIN dbo.ltcResults r ON b.BatchID = r.BatchID INNER JOIN dbo.ltcPerson ON b.PersonID [...]
I want to query an SQL server database for specific tables and their descriptions. How do I do that? Is there a special tool needed to do this?
Hii.. IT Professional Helper, may i asked 1 question and hope IT Professional Helper can help me to answer my question? The Question is : Cm.CommandText = “Update Reminder Set IsDatang = 0, IsValid = 1 Where TglReminder – TglDatangKembali > 7″ Cm.Execute If i get the error : Arithmetic overflow error converting expression to [...]
Hi, I have migrated a database from 2000 to 2005, updated the statistic and rebuild the index. When I run the following query “select top 500 * from myview order by name”, it is extremely slower in 2005 than 2000. The myview simply does an inner join with 2 table. The name is varchar(50). Strangely [...]
I am getting an error while running a qurey for excuting against OLE DB provide’ADSDSOobject’ Please advice Thanks Rajaa
We have a very huge SQL Server database, with approximately 700GB of data. Due to this, queries are running very slow. Could you please suggest few tips to improve performance?
I have a set of records in a SQL query result. I only want to see one record, per the data field “ID”. I am getting 2 records for some ID’s, as there is one field that is different in the 2 records. This happens even if I start the query out with SELECT, DISTINCT, [...]
I need a T-SQL query to find a list of all database names and sizes from multiple SQL 2005 servers that are connected in a local network. Does one exist?
I have string like ’1,2,3,45,6,7,8′ I want to insert each comma separated value in a table column…my output look like this: COLUMN 1 2 3 45 6 7 8
How do I run a query that queries a SQL Server database and an Oracle server database, on two different servers, and uses all the data?
Hello I have used text-function of SQL server 2005. I have ran my codes on a table with 800,000 records to serach for some specific words ( a list of 3milion words) in that. it took about 4 hours to be executed. Now I have some part of that table ( 1/8 of that including [...]
I have a table with Inventory transacation records. The table contains both Shipment (outgoing) and Receiving (incoming) transactions. I’m trying to write a report that lists both Sales Orders that result in Shipment records and Purchase Orders that result in Receiving records. If I link the Inventory Transaction table to the Shipment (Sales Order) tables [...]
Hello All, I have a requirement with sql server. Please find below the same. In database say we have a column named “Name” in a table. The records that are available in the table are say like Column_Name = Names Lean Metric Sequence Lean Operation Metric Lean Cleaning and so on…. Now, through some application [...]
I have a query for finding the fith lowest salary in a SQL database, and I am not able to understand how this query will be processed internally. It is: select * from emp a where 5= (select count(distinct sal) from emp where a.sal>=b.sal) Can you explain this to me?
What is the difference between Outerjoin and Left outerjoin.
How would I write a query to store an image file in a SQL Server 2005 table?
I am using OPENROWSET to output the result of a number of SQL SELECT statements into a spreadsheet. It works for most of the SELECT statements, but there are 4 random queries out of 82 that take more than an hour to execute. This is the code: insert into OPENROWSET(‘Microsoft.Jet.OLEDB.4.0′, ‘Excel 8.0;Database=D:MGTempESWIConvAuditQueriescnvWriteOff.xls;’, ‘SELECT Phone, Member, [...]
I have a stored procedure that runs on my Production database in 0.394 seconds. However, when I try to run the SP on a DEV box it takes well over 15 minutes to run *every* time. I have checked indexes and everything seems to be identical (I did a backup/restore to the Dev box in [...]





