Help optimizing query
I have quite a complex query that is used to match up certain people to orders (jobs). The problem is all the data that needs to be collected from various tables, and I've tried to consolidate the...
View ArticleException Details: System.ArgumentException: Keyword not supported: 'unicode'.
VB: OracleException Details: System.ArgumentException: Keyword not supported: 'unicode'.Source Error: Line 12: Inherits DBConnection Line 13: Public Sub ses_test_insert(ByVal p_userid As Integer, ByVal...
View Articlequery help, getting the row that fits the date
Here is a sample datasetCREATE TABLE #TESTDATA ( TableID INT IDENTITY(1,1), SomeCode VARCHAR(50), SomeDescription VARCHAR(50), EffectiveFrom DATE ) INSERT #TESTDATA...
View ArticleHow to rewrite this query without sub query please help me
Hello All Good Evening,Could you please help me with this query, how can i write this query without sub query, or how can write this query another waysplease help me select planno, status1, count(*)...
View Articlesubquery returned more than 1 value on an insert into
I have a simple query to insert data from one table to another and I am expecting multiple rows to be inserted but I get an error about subquery returned more than 1 value. When I change the is not...
View ArticleConcatenate in sql server
Hello,i have a table which contain two field customer and phonenumber and following record.Now i want a query for customer-wise phone number with Concatenating . similiar like attached image.i am...
View ArticleHow to spool the result of an query into a file in sql 2000
Hi All,I have an SQL query which iterates through number of times for checking on some conditions and will return results each time. I wants to save the results into an different xml file each time. I...
View ArticleUsing a LIKE statement (fuzzy match)
I need to match two tables together using the Name columns. Seems easy enough, but I need to use a LIKE statement or something.See below examples:Table A contains:Name John Smith Julian Blaney Daniel...
View ArticleTrouble running a script to (re)create a database
I have used the "Generate Scripts" wizard/thingy to create a script to create a database (Meterbilling), build the tables etc.To run this from .net using SqlCoomand.ExecuteNonQuery I know I have to...
View ArticleMAX Rate and Max Hours
Hi AllBeen working on my T-SQL skills using the AdventureWorks 2008 database.I want to get the Employee with the highest rate as well as the highest SickLeaveHoursThis is what I have so far, am I...
View ArticleSQL 2008 union all numeric column
Hi guys, I'm struggling with an union all. I tried to union a column float with a null column:SELECTcolumn1,column2,''AS'column 3'FROMtable aUNION SELECTcolumn1,column2,column3FROMtable bIf column 3...
View ArticleDatabase recovery
himy database was suspected then i turn it to the emergency mode therafter what i have to do for recoverplease answer this
View ArticleCopy data in existing table into same table with self reference
HelloFollowing is the example table.SelfRefTableId Name ParentId Year1 GrandParent null 20132 Parent 1...
View ArticleTree Query Problem
I've problem with tree query where if a level > 3 the result for top level is incorrect. Here's the query with correct result where level of depth just 3 level :--select *from tblBOMStructed DECLARE...
View ArticleSchema conversion not enable in ssma migration..?
i connected oracle and sql server in ssma tool. I have a table in oracle called customer and i have a db in sql called users. I opened oracle table and sql db in ssma tool. But i am not able to convert...
View ArticleCan we de-dupe on the Name, first line of address and postcode in SQL SERVER !!
Hi Friends I have 7K records in my Table. the Columns are ID, Name, Address 1 , Address 2, Address 3, postcode. how can we de-dupe on the name , Address 1 and postcode Can you please advise me How can...
View Articleupdate one table with the max value of another table
CREATE TABLE [dbo].[General]( [a_id] int NOT NULL, [a_date] datetime NOT NULL, [c_date] datetime NULL) CREATE TABLE [dbo].[Specific]( [a_id] int NOT NULL, [a_date] datetime NOT NULL, [b_id] int NOT...
View ArticleProcedure stop executing
I have stored procedure:CREATE PROCEDURE [dbo].[mysp] @saID INT AS DECLARE @msg VARCHAR(4000), @message NVARCHAR(255), @counter INT BEGIN TRY SET @tranCounter=@@TRANCOUNT SET @message='SA ' +...
View ArticleSQL SELECT
I am trying to select which clients invoices are sent to their invoice client (an alternate client who pays the bill) and whic are sent to the client himself. The client table has a client_number and...
View Article