SQL Command Not Properly Ended

Mar 11, 2008

Hi i given my query here. in that joings betweens tables is correct, but i am getting the following error
ora-00933 sql command not properly ended
can we have exists function inside if condition??

select distinct loc.authorization from account acct, location loc, iom_order iom
where loc.location_id = acct.location_id and acct.account_id = iom.account_id and iom.iom_order_id =140

if(loc.authorization is null and exists(
select distinct line.INTRALATA_PIC_FREEZE ,line.INTERLATA_PIC_FREEZE
from line line, iom_order iom, activity act
where ((line.INTRALATA_PIC_FREEZE='F' or line.INTERLATA_PIC_FREEZE='F')and line.line_id = act.component_id and act.component = 23 and act.iom_order_id = 140)
union all
select distinct trunk.INTRALATA_PIC_FREEZE ,trunk.INTERLATA_PIC_FREEZE
from trunk trunk, activity act
where ( (trunk.INTRALATA_PIC_FREEZE='F' or trunk.INTERLATA_PIC_FREEZE='F')andtrunk.trunk_id = act.component_id and act.component = 25 and act.iom_order_id = 140)
select distinct rcf.INTRALATA_PIC_FREEZE ,rcf.INTERLATA_PIC_FREEZE
from remote_call_fwd rcf, activity act
where((rcf.INTRALATA_PIC_FREEZE='F' or rcf.INTERLATA_PIC_FREEZE='F')and rcf.remote_call_fwd_id = act.component_id and act.component = 24 and act.iom_order_id = 140)
select distinct tsg.INTRALATA_PIC_FREEZE ,tsg.INTERLATA_PIC_FREEZE
from nodal_tsg tsg, activity act
where ((tsg..INTRALATA_PIC_FREEZE='F' or tsg.INTERLATA_PIC_FREEZE='F')and tsg.nodal_tsg_id = act.component_id and act.component = 5 and act.iom_order_id = 140))) Then
select distinct loc.authorization from order2misc o2m, location loc, iom_order iom where loc.location_id =
o2m.serv_loc_id and iom.iom_order_id =140
else
select distinct loc.authorization from account acct, location loc, iom_order iom
where loc.location_id = acct.location_id and acct.account_id = iom.account_id and iom.iom_order_id =140
end if;

View 1 Replies


ADVERTISEMENT

SQLCMD Command Prompt Window Not Functioning Properly

Sep 15, 2007

The MSDN Library topic Using the sqlcmd utility(SQL Server Express) states "To access the sqlcmd utility, click Start, click Run, and type sqlcmd.exe."

A command prompt window opens with "SQLCMD" in the title bar. I cannot enter anything in the command prompt window and the window remains open for only about five or six seconds.

The version I have installed is MS SQL Server 2005 Express with SP2. The cumulative updates package 3 does not list this problem, so I did not install it.

View 1 Replies View Related

Open-ended Querying Of DB (???)

Nov 1, 2004

I am working on a project with a couple of hundred tables and views. There is one primary table around which all other tables revolve with the primary table having somewhere around 42 to 45 million records. Some of the related tables can have many times this number of records. The data is static in that it only changes at specific intervals (once a month or so) when more records are added and some “old� records are removed.

My problem is that users need to query these tables without any major restrictions. I mean, the front end will allow users to create almost any selection criteria form the many columns in the DB. The selection of values will be controlled via drop-downs and lists from where the user will select the criteria. The other consideration is that the grouping can be for any value and up to ten levels deep. Our users are not sophisticated enough to create their own SQL-like queries so we have to guide them through the process of selecting the values…

I am trying to create stored procedures that will allow this behavior but I continue to run into the problem of how to properly join the tables when the combinations are almost endless. My conclusion is that although it seems this seems to be a case where D-SQL is a good choice, there are some draw-backs I am not sure we can afford, specifically the security issues. Furthermore, the creation of a D-SQL “code-generator� seems like almost impossible task and time is of the essence.

Has anyone here had any experience with a similar situation that can shed some light?

View 5 Replies View Related

The Transaction Ended In Trigger

May 3, 2006

During some non working days i got rid of old merge replication that I had and started new one. Today 5 of my 6 servers are working normally, but on the 6th one I am getting following error:



The transaction ended in trigger. The batch has been aborted. Table [dbo.A...] into which you are trying to insert, update, or delete data is currently being upgraded or initialized for merge replication. On the publisher data modofocations are disallowed until the upgrade completes and snapshot has succesfully run. On subscriber data modifications are disallowed until the upgrade completes or the initial snapshot has been successfully applied and it has synchronized with publisher.

Although this message is descriptive ebough, I must say that my publisher says that whole process of synchronyzing and initializing data with subscriber is done. In fact it allready did more than 100 cycles of replication.



Any idea why I get this?



Thanks,

Aleksandar

View 4 Replies View Related

The Transaction Ended In The Trigger

Mar 4, 2008

I have a SSIS-trigger problem.

There's a trigger defined on a table that doesn't allow inserting or updating a field if the value inserted already exists in the table. Here's the trigger:




Code Snippet
set ANSI_NULLS ON
set QUOTED_IDENTIFIER ON
go
ALTER TRIGGER [tUI_ID_ISIN] ON [dbo].[T_table]
FOR INSERT, UPDATE
AS
--IF ((SELECT TRIGGER_NESTLEVEL()) = 1)
BEGIN
declare @ISIN varchar(12)
set @isin = (select id_isin from inserted )
if not @isin is null
begin
if exists (select 1 from t_titoli, inserted where t_table.cd_isin = @isin and t_table.cd_titolo <> inserted.cd_titolo)

begin
Raiserror ('ID ISIN alredy exists!', 16,1)
rollback tran
end
end
END



it all works fine when the user inserts/updates the record from the front end.

When I run the SSIS that inserts records into the table, I get the following error: The transaction ended in the trigger. The batch has been aborted.

There are no records that should fail the control. In other words, all ISINs are unique.

Any ideas?

View 20 Replies View Related

SQL Server 2005 Evaluation Version Period Ended

Apr 10, 2008

HI All,

WE were using SQL Server 2005 Evaluation Edition having one user database created for application testing and also using reporting services for dashboard purposes.

Now our Evaluation period ended However we have already purchased SQL Server 2005 standard license for actual implimentation.

Can anyone guide me step by step how to seamlessly upgrade from evaluation version to the license version of SQL Server 2005 standard.

its somewhat urgent so i request quick help on this

Thanks in advance.

View 3 Replies View Related

SQL 2012 :: Select Statements And Ended Up Seeing Multiple Cached Instances Of Same Stored Procedure

Nov 24, 2014

I ran the below 2 select statements and ended up seeing multiple cached instances of the same stored procedure. The majority have only one cached instance but more than a handful have multiple cached instances. When there are multiple cached instances of the same sproc, which one will sql server reuse when the sproc is called?

SELECT o.name, o.object_id,
ps.last_execution_time ,
ps.last_elapsed_time * 0.000001 as last_elapsed_timeINSeconds,
ps.min_elapsed_time * 0.000001 as min_elapsed_timeINSeconds,
ps.max_elapsed_time * 0.000001 as max_elapsed_timeINSeconds

[code]...

View 4 Replies View Related

Defining Command,commandtype And Connectionstring For SELECT Command Is Not Similar To INSERT And UPDATE

Feb 23, 2007

i am using visual web developer 2005 and SQL 2005 with VB as the code behindi am using INSERT command like this        Dim test As New SqlDataSource()        test.ConnectionString = ConfigurationManager.ConnectionStrings("DatabaseConnectionString1").ToString()        test.InsertCommandType = SqlDataSourceCommandType.Text        test.InsertCommand = "INSERT INTO try (roll,name, age, email) VALUES (@roll,@name, @age, @email) "                  test.InsertParameters.Add("roll", TextBox1.Text)        test.InsertParameters.Add("name", TextBox2.Text)        test.InsertParameters.Add("age", TextBox3.Text)        test.InsertParameters.Add("email", TextBox4.Text)        test.Insert() i am using UPDATE command like this        Dim test As New SqlDataSource()        test.ConnectionString = ConfigurationManager.ConnectionStrings("DatabaseConnectionString").ToString()        test.UpdateCommandType = SqlDataSourceCommandType.Text        test.UpdateCommand = "UPDATE try SET name = '" + myname + "' , age = '" + myage + "' , email = '" + myemail + "' WHERE roll                                                         123 "        test.Update()but i have to use the SELECT command like this which is completely different from INSERT and  UPDATE commands   Dim tblData As New Data.DataTable()         Dim conn As New Data.SqlClient.SqlConnection("Data Source=.SQLEXPRESS;AttachDbFilename=|DataDirectory|Database.mdf;Integrated                                                                                Security=True;User Instance=True")   Dim Command As New Data.SqlClient.SqlCommand("SELECT * FROM try WHERE age = '100' ", conn)   Dim da As New Data.SqlClient.SqlDataAdapter(Command)   da.Fill(tblData)   conn.Close()                   TextBox4.Text = tblData.Rows(1).Item("name").ToString()        TextBox5.Text = tblData.Rows(1).Item("age").ToString()        TextBox6.Text = tblData.Rows(1).Item("email").ToString()       for INSERT and UPDATE commands defining the command,commandtype and connectionstring is samebut for the SELECT command it is completely different. why ?can i define the command,commandtype and connectionstring for SELECT command similar to INSERT and UPDATE ?if its possible how to do ?please help me

View 2 Replies View Related

Using A Variable In SSIS - Error - Command Text Was Not Set For The Command Object..

Nov 4, 2006

Hi All,

i am using a OLE DB Source in my dataflow component and want to select rows from the source based on the Name I enter during execution time. I have created two variables,

enterName - String packageLevel (will store the name I enter)

myVar - String packageLevel. (to store the query)

I am assigning this query to the myVar variable, "Select * from db.Users where (UsrName = " + @[User::enterName] + " )"

Now in the OLE Db source, I have selected as Sql Command from Variable, and I am getting the variable, enterName,. I select that and when I click on OK am getting this error.

Error at Data Flow Task [OLE DB Source [1]]: An OLE DB error has occurred. Error code: 0x80040E0C.
An OLE DB record is available. Source: "Microsoft SQL Native Client" Hresult: 0x80040E0C Description: "Command text was not set for the command object.".

Can Someone guide me whr am going wrong?

myVar variable, i have set the ExecuteAsExpression Property to true too.

Please let me know where am going wrong?

Thanks in advance.








View 12 Replies View Related

Do Somebody Know How Long (in Chars) Script(command) Can Be Solved By SQL Command?

Aug 30, 2004

Do somebody know how long (in chars) script(command) can be solved by SQL Command?
Thanks

View 1 Replies View Related

What Command Is Used To Get Back The Privileges Offered By The GRANT Command?

Mar 10, 2007

reply.

View 1 Replies View Related

Command Text Was Not Set For The Command Object Error

Sep 19, 2006

Hi. I am writing a program in C# to migrate data from a Foxpro database to an SQL Server 2005 Express database. The package is being created programmatically. I am creating a separate data flow for each Foxpro table. It seems to be doing it ok but I am getting the following error message at the package validation stage:

Description: An OLE DB Error has occured. Error code: 0x80040E0C.

An OLE DB record is available. Source: "Microsoft SQL Native Client" Hresult: 0x80040E0C Description: "Command text was not set for the command object".

.........

Description: "component "OLE DB Destination" (22)" failed validation and returned validation status "VS_ISBROKEN".

This is the first time I am writing such code and I there must be something I am not doing correct but can't seem to figure it out. Any help will be highly appreciated. My code is as below:

private bool BuildPackage()

{




// Create the package object

oPackage = new Package();

// Create connections for the Foxpro and SQL Server data

Connections oPkgConns = oPackage.Connections;

// Foxpro Connection

ConnectionManager oFoxConn = oPkgConns.Add("OLEDB");

oFoxConn.ConnectionString = sSourceConnString; // Created elsewhere

oFoxConn.Name = "SourceConnectionOLEDB";

oFoxConn.Description = "OLEDB Connection For Foxpro Database";

// SQL Server Connection

ConnectionManager oSQLConn = oPkgConns.Add("OLEDB");

oSQLConn.ConnectionString = sTargetConnString; // Created elsewhere

oSQLConn.Name = "DestinationConnectionOLEDB";

oSQLConn.Description = "OLEDB Connection For SQL Server Database";

// Add Prepare SQL Task

Executable exSQLTask = oPackage.Executables.Add("STOCK:SQLTask");

TaskHost thSQLTask = exSQLTask as TaskHost;

thSQLTask.Properties["Connection"].SetValue(thSQLTask, "oSQLConn");

thSQLTask.Properties["DelayValidation"].SetValue(thSQLTask, true);

thSQLTask.Properties["ResultSetType"].SetValue(thSQLTask, ResultSetType.ResultSetType_None);

thSQLTask.Properties["SqlStatementSource"].SetValue(thSQLTask, @"C:LPFMigrateLPF_Script.sql");

thSQLTask.Properties["SqlStatementSourceType"].SetValue(thSQLTask, SqlStatementSourceType.FileConnection);

thSQLTask.FailPackageOnFailure = true;



// Add Data Flow Tasks. Create a separate task for each table.

// Get a list of tables from the source folder

arFiles = Directory.GetFileSystemEntries(sLPFDataFolder, "*.DBF");

for (iCount = 0; iCount <= arFiles.GetUpperBound(0); iCount++)

{


// Get the name of the file from the array

sDataFile = Path.GetFileName(arFiles[iCount].ToString());

sDataFile = sDataFile.Substring(0, sDataFile.Length - 4);

oDataFlow = ((TaskHost)oPackage.Executables.Add("DTS.Pipeline.1")).InnerObject as MainPipe;

oDataFlow.AutoGenerateIDForNewObjects = true;



// Create the source component

IDTSComponentMetaData90 oSource = oDataFlow.ComponentMetaDataCollection.New();

oSource.Name = (sDataFile + "Src");

oSource.ComponentClassID = "DTSAdapter.OLEDBSource.1";

// Get the design time instance of the component and initialize the component

CManagedComponentWrapper srcDesignTime = oSource.Instantiate();

srcDesignTime.ProvideComponentProperties();

// Add the connection manager

if (oSource.RuntimeConnectionCollection.Count > 0)

{


oSource.RuntimeConnectionCollection[0].ConnectionManagerID = oFoxConn.ID;

oSource.RuntimeConnectionCollection[0].ConnectionManager = DtsConvert.ToConnectionManager90(oFoxConn);

}

// Set Custom Properties

srcDesignTime.SetComponentProperty("AccessMode", 0);

srcDesignTime.SetComponentProperty("AlwaysUseDefaultCodePage", true);

srcDesignTime.SetComponentProperty("OpenRowset", sDataFile);

// Re-initialize metadata

srcDesignTime.AcquireConnections(null);

srcDesignTime.ReinitializeMetaData();

srcDesignTime.ReleaseConnections();

// Create Destination component

IDTSComponentMetaData90 oDestination = oDataFlow.ComponentMetaDataCollection.New();

oDestination.Name = (sDataFile + "Dest");

oDestination.ComponentClassID = "DTSAdapter.OLEDBDestination.1";

// Get the design time instance of the component and initialize the component

CManagedComponentWrapper destDesignTime = oDestination.Instantiate();

destDesignTime.ProvideComponentProperties();

// Add the connection manager

if (oDestination.RuntimeConnectionCollection.Count > 0)

{


oDestination.RuntimeConnectionCollection[0].ConnectionManagerID = oSQLConn.ID;

oDestination.RuntimeConnectionCollection[0].ConnectionManager = DtsConvert.ToConnectionManager90(oSQLConn);

}

// Set custom properties

destDesignTime.SetComponentProperty("AccessMode", 2);

destDesignTime.SetComponentProperty("AlwaysUseDefaultCodePage", false);

destDesignTime.SetComponentProperty("OpenRowset", "[dbo].[" + sDataFile + "]");



// Create the path to link the source and destination components of the dataflow

IDTSPath90 dfPath = oDataFlow.PathCollection.New();

dfPath.AttachPathAndPropagateNotifications(oSource.OutputCollection[0], oDestination.InputCollection[0]);

// Iterate through the inputs of the component.

foreach (IDTSInput90 input in oDestination.InputCollection)

{


// Get the virtual input column collection

IDTSVirtualInput90 vInput = input.GetVirtualInput();

// Iterate through the column collection

foreach (IDTSVirtualInputColumn90 vColumn in vInput.VirtualInputColumnCollection)

{


// Call the SetUsageType method of the design time instance of the component.

destDesignTime.SetUsageType(input.ID, vInput, vColumn.LineageID, DTSUsageType.UT_READWRITE);

}

//Map external metadata to the inputcolumn

foreach (IDTSInputColumn90 inputColumn in input.InputColumnCollection)

{


IDTSExternalMetadataColumn90 externalColumn = input.ExternalMetadataColumnCollection.New();

externalColumn.Name = inputColumn.Name;

externalColumn.Precision = inputColumn.Precision;

externalColumn.Length = inputColumn.Length;

externalColumn.DataType = inputColumn.DataType;

externalColumn.Scale = inputColumn.Scale;

// Map the external column to the input column.

inputColumn.ExternalMetadataColumnID = externalColumn.ID;

}

}

}

// Add precedence constraints to the package executables

PrecedenceConstraint pcTasks = oPackage.PrecedenceConstraints.Add((Executable)thSQLTask, oPackage.Executables[0]);

pcTasks.Value = DTSExecResult.Success;

for (iCount = 1; iCount <= (oPackage.Executables.Count - 1); iCount++)

{


pcTasks = oPackage.PrecedenceConstraints.Add(oPackage.Executables[iCount - 1], oPackage.Executables[iCount]);

pcTasks.Value = DTSExecResult.Success;

}

// Validate the package

DTSExecResult eResult = oPackage.Validate(oPkgConns, null, null, null);

// Check if the package was successfully executed

if (eResult.Equals(DTSExecResult.Canceled) || eResult.Equals(DTSExecResult.Failure))

{


string sErrorMessage = "";

foreach (DtsError pkgError in oPackage.Errors)

{


sErrorMessage = sErrorMessage + "Description: " + pkgError.Description + "";

sErrorMessage = sErrorMessage + "HelpContext: " + pkgError.HelpContext + "";

sErrorMessage = sErrorMessage + "HelpFile: " + pkgError.HelpFile + "";

sErrorMessage = sErrorMessage + "IDOfInterfaceWithError: " + pkgError.IDOfInterfaceWithError + "";

sErrorMessage = sErrorMessage + "Source: " + pkgError.Source + "";

sErrorMessage = sErrorMessage + "Subcomponent: " + pkgError.SubComponent + "";

sErrorMessage = sErrorMessage + "Timestamp: " + pkgError.TimeStamp + "";

sErrorMessage = sErrorMessage + "ErrorCode: " + pkgError.ErrorCode;

}

MessageBox.Show("The DTS package was not built successfully because of the following error(s):" + sErrorMessage, "Package Builder", MessageBoxButtons.OK, MessageBoxIcon.Information);

return false;

}

// return a successful result

return true;
}

View 2 Replies View Related

How Do I Use &#34;sp_attach_db&#34; Properly?

Apr 23, 2001

how do i use "sp_attach_db" properly so that i can make a new database with only the .mdf file?

View 2 Replies View Related

How To Properly Use GO, BEGIN, END

Jan 12, 2008

I have writen a small program in a Query window that runs fine if I hilight and run small chuncks. (I have listed the statements with out the clauses so it is more easly viewed here.)

The problem is if I simply execute the Query window I get massive errors that don’t make sence. I am guessing I need some GO and BEGIN/END statements? But I don’t know where I should use them.

I would really appreciate a few pointers so I can just run the Query window.


drop table SourceFile
drop table ReferenceFile

SELECT TOP
INTO SourceFile
FROM

SELECT TOP
INTO ReferenceFile
FROM

-- test data
INSERT ReferenceFile
(AddressCleanedPK, New_First_Name, New_Last_Name, New_Address, Phone, Zip)
values ()
INSERT SourceFile
(AddressCleanedPK, New_First_Name, New_Last_Name, New_Address, Phone, Zip)
values (22)
-- test data


drop table MATCHTEST
SELECT TOP 1 AddressCleanedPK, New_First_Name, New_Last_Name, New_Address, Phone, Zip
INTO MATCHTEST
FROM AddressCleaned_npidata_20050523_20071112

DELETE MATCHTEST

ALTER TABLE MATCHTEST
ADD REF_ML VARCHAR(2)

INSERT MATCHTEST ()
SELECT
FROM ReferenceFile r
inner join SourceFile s
on s.New_Last_Name = r.New_Last_Name

select * from MATCHTEST

View 3 Replies View Related

Deploying IS Properly

Sep 11, 2007



Hi,

How do i deploy IS package properly? can i just copy the .dtsx and assign that in an sql jobs?

thanks a lot

cherriesh

View 3 Replies View Related

How To Build Properly

Jun 30, 2006



Hi,

I'm very new in SSIS. I've created 3 packages in the project. sometimes when i modified the project and save/save-all it, when i tried to build (isn't this used to deploy?), I am being asked by this:

Package 1 has been modified outside the source editor. Do you want to reload it?

When I press on yes, all my modifications were not save. If i answered no, the build process stops. i dunno if this is because the build process is already finished or it was terminated because i chose 'NO'. When i tried to rebuild it again, it will ask me the same question.

What is the proper way to save and build the project? When it says ' do you want to reload it?', does it mean reloading the old copy before modification?

Thanks!

cherrie

View 3 Replies View Related

Order By Not Working Properly

Jan 17, 2007

Hello, i have something like this, i want the annoucements (status = 0) to be on top, then topics with (status = 1) below, then the rest of the topics.
So i tried:
SELECT forum_topics.id, forum_topics.status, forum_topics.username AS starter, forum_topics.subject, forum_topics.closed, forum_topics.answerpostid, forum_topics.views, forum_topics.answers, forum_topics.lastanswer, forum_topics.lastanswerid, forum_topics.created AS started, forum_answer.username, forum_answer.answer, forum_answer.created FROM forum_topics LEFT OUTER JOIN forum_answer ON forum_answer.id = forum_topics.lastanswerid WHERE (boardid = @ID OR boardid = 0) ORDER BY (status) ASC, (created) ASC
Problem is that they are not sorted diffrently, when i change the (created) ASC to (created) DESC i get the same result and the rows are not sorted, they only get sorted by status so i have status=0 at the top, then status=1 then the rest. How do i get them to be sorted first by status ASC then by created ASC/DESC?
Patrick

View 1 Replies View Related

MDAC 2.6 SP1 Not Installing Properly

May 22, 2002

I installed MDAC 2.6 SP1 on my 2000 machine in order to get SQL server 7.0 to work properly on my machine. I'm trying to get installed on server which is on NT 4.0 SP6 so that when I save a DTS package on my 2000 machine and run it on the server it doesn't get the error client access ODBC driver not capable. I intalled MDAC 2.6 SP1 on the server but it doesn't look like its updating it. The install goes fine. I reboot but when I go into the ODBC connections and look at the driver for the client acceess it still has version 6.00.00.05 while my 2000 machine says 6.00.07.00

Any ideas on why its not updating. Can I just take the DWBODBC.DLL from my machine and copy it to the server?

View 1 Replies View Related

SQL Agent Not Starting Properly

Sep 28, 1999

We have SQL Server 7.0 running on an NT 4.0 sp5 box. Whenever we stop the SQL Server Service, we get the message that SQL Agent will also be stopped. If we do this, all the services seem to stop fine, but when we try to start the SQL Server Agent Service back up, it won't let us. In order for it to restart, we have to reboot the server so that it starts 'automatically'. Does anyone have any ideas as to why this is?

View 1 Replies View Related

Float Value Doesn&#39;t Come Up Properly...

Jun 19, 2001

I define one of my columns as FLOAT. Some of the values are negative and positive with precision 8 or 12. When I run updates against that column and then check the data all values are 0.

Any idea why?? I appreciate it.

Thanks,


David

View 1 Replies View Related

Trigger Not Inserting Properly

May 3, 2004

I have the following trigger that will insert the correctly if none of the items in the #tempKCS exist in the destination table. However if one of the items in the #tempKCS table do exist in the Sales table then the insert does not execute for the other itmes in the #temoKCS list that are not already listed in the Sales Table. Below is the trigger. Tell me where I am making my mistake. Thanks

CREATE TRIGGER [Insert_KCSales] on [dbo].[Reclines]
FOR INSERT, UPDATE
AS

SELECT KitItemSum.Date, Kits.KitItemNo AS ItemNo, (Kits.Quantity * KitItemSum.QtySold) As QtySold, ((Kits.[Percentage]/100) * KitItemSum.AmtSold) AS AmtSold, KitItemSum.Division, 0 AS QtyReturned, 0 AS AmtReturned Into #TempKCS
FROM (SELECT Summary.Recdate AS [Date], Summary.ItemNo, Sum(Summary.Qty) AS QtySold, SUM((Summary.Amount-Summary.DiscAmt)) AS AmtSold, Summary.Division
FROM (SELECT DISTINCT R.Recno, R.Recdate,I.RecLineNo, I.ItemNo, I.Qty, I.Amount, I.DiscAmt, I.Division FROM Inserted I
INNER JOIN Kits K ON I.ItemNo = K.MasterItemNo INNER JOIN Receipt R ON I.RecNo = R.RecNo INNER JOIN Items ON I.ItemNo = Items.ItemNo) AS Summary
GROUP BY Summary.RecDate, Summary.ItemNo, Summary.Division) AS KitItemSum INNER JOIN Kits ON KitItemSum.ItemNo = Kits.MasterItemNo;

INSERT INTO Sales ([Date], ItemNo, Division, QtySold, AmtSold, Qtyreturned, AmtReturned)
SELECT [Date], ItemNo, Division, QtySold, Amtsold, Qtyreturned, Amtreturned
FROM #TempKCS
WHERE NOT EXISTS (SELECT S.[Date], S.[ItemNo] FROM Sales S INNER JOIN #TempKCS KCS on S.ItemNo = KCS.ItemNo AND S.[Date] = KCS.[Date]);

View 1 Replies View Related

SQL Server Is Not Working Properly

Apr 21, 2008

Hello friends, I have developed an ASP.NET 2.0 application. The problem is that the IIS server returns the next error:

SQL Server does not allow remote connections

Sometimes returns:

SQL Server does not exists.

My question is if there is any known bug with ASP.NET and SQL Server. My sql server have activated the Remote Connections (its working properly on other web page).

Its a problem of the number of connections??
Its a problem ofbad configuration??
Its a IIS problem??

Please bring me some help.

View 8 Replies View Related

Report Service Not Act Properly

Jul 18, 2007

Hi,

We installed SQL Server 2005 on windows 2000 with IIS 5. After installation, I can see report manager using http://localhost/reports. But I can only the top part. There's no My Reports or anything, just "Home / My subscriptions / Help".

Is there anything wrong and how to fix it?

Any help would be appreciated.

Thanks

View 5 Replies View Related

How To Properly Restore Transaction Log

Jul 20, 2005

Hi,Currently, I am on SQL2000 SP3 and Windows 2003.I am trying to restore the full database backup and transaction logbackup on the development server. The full database restore is not aproblem, but the transaction log restore happened during the day is.Everytime when I try to compare the transaction in the database(select the last update date from one of my table as a benchmark, thenbackup the transaction log for restore) to the development db with therestored transaction log, I got none of the transaction from the logbackup.What did I do wrong? Is my concept about using the transaction logrestore wrong?Thanks in advance.

View 4 Replies View Related

Help Joining Tables Properly.

Jul 20, 2005

I have about 7 tables I need to join, but am having a lot ofdifficulty with the joins, that I need some help on.I'll provide the details of four tables to illustrate the scenario.I have one table called Product, which contains a complete list ofproducts.I have another table called Date, which contains a complete list ofdates.I have a table called sales, which contains Product, date and Qty.I have a table called Purchases which contains product, date and qty.I want to link my Purchases and sales tables to my Product and datetables.On each row I want product from the Product table, Date from the datetable, Sales Qty from the sales table and Purchases Qty from thePurchases table.I've been messing around with full outer, inner joins etc, but can'tget it right.All help greatfull.Regards,Ciarán

View 5 Replies View Related

SP2 Not Installed Properly.(Urgent Pls Help)!!!!

Aug 31, 2007

Hi,

I have 2 servers running in a clustered mode(active/active). In which we installed SP2 on peak production time but somehow it resulted in failure i.e it installed partially and sql server is unstable as of now. I'd like to know if it would be fine to restart the server without full installation of SP2 and what could be the implications of a server restart in such a scenario.
Pls help urgent!!!!!!!

View 1 Replies View Related

Ragged Right Not Working Properly

Dec 25, 2007



Hi,
I am exporting a table to a fixed width flat file using "Ragged Right" format. Though i specify carriage return for the last column, the text file is not taking it up.

I am doing the following for connection
cmFlatFile.properties("Format").SetValue(cmFlatFile,"RaggedRight")
cmFlatFile.properties("RowDelimiter").SetValue(cmFlatFile,vbCrLf)

and while adding the column i am setting up the width as follows

vColumns = flatFileDestination.InputCollection(0).GetVirutalInput().VirtualInputColumnCollection

For cols = 0 to vColumns.Count -1
Dim col As IDTSConnectionManagerFlatFileColumn90 = ff.Columns.Add()
if cols = vColumns.Count - 1 Then
col.ColumnDelimiter = vbCrLf
end if
cols.ColumnType = "FixedWidth"
cols.Columnwidth = 20
......
Next cols

Still the rows are exported next to each other just like when we use FixedWidth.

View 4 Replies View Related

SQL Configuration Does Not Work Properly

Jul 17, 2007

Hi,



I've my SSIS Packages, having multiple Configuration stored in SQL Server Table named [SSIS Configurations].

And it's devloped on BHUDEV Server ON Devlopmentdb Database. So durring development Default Cofigurations are set for BHUDEV Server.



Problem is that when I install my Package on SQL Server on different Server for example JOHN, and now my database is ProductionDB and [SSIS Configurations] table will be on ProductionDB database. And I've made required changes in [SSIS Configurations] table. So when I run the Package even then it picks configuration information from BHUDEV.Developmentdb.dbo.[SSIS Configurations] table. That's my problem.



But If when during execution time, I change the connection information then it works fine.



Please Help!



Bhudev

View 6 Replies View Related

Cannot De-install SQL 2000 Properly

Sep 5, 2007

Hi,
Long story, Ihad SQL 2000 happily installed and running for a long time. Attempted to load SQL 2005 alongside, but in retrospect see that I used the same install directory as SQL 2000. Found that the SQL 2000 databases still ran, in that I was able to run applications that rely on them. Enterprise manager ans Query Analyzer are still in the start/program list, but when I try to open them they say that the DSN isn't there, and the odbc driver is missing. Also if I try to configure the system SQL DSN in ODBC datasources I get the same message. I guess the SQL 2005 install has scrambled the ODBC setup.Tried deinstalling SQL 2005, but the problem persists. Tried reloading mdac-typ, same problem. Tried reinstalling SQL2000, same problem. Tried fully deinstalling SQL2000 from Add/remove program, said it completed, but the shortcuts are still there, the applications that use the db's still work, only it no longer appears in Add/Remove programs.
Is there a command line string to manually remove it, or where do I go to repair my mdac, or is this what I actually want to do?

Thanks in advance

Hugh Esler

View 5 Replies View Related

Subreport Not Displaying Properly

Aug 24, 2007

Hi,
I am using a sub-report in my main report, passing a customerid parameter into the subreport. The subreport dataset then either returns rows, or it doesn't.

When the dataset returns rows, I am using either COUNT(field) or CountRows(dataset) in a textbox, which then displays fine.

However, if the dataset returns NO ROWS, i need the textbox to return a '0' - which it does if i run the subreport on it's own.

If i run the main report, and the subreport returns no rows, no matter what expressions I use to try and get the '0' to display on the main report....it doesn't.

As a test I also put a background colour on the text control in the subreport, and it looks like the whole text control is not displaying

This is only an issue when 0 rows are returned, but i must display a 0 in this case!?!

Help!

Cheers
Chris

View 8 Replies View Related

Logging Isn't Working Properly

Oct 2, 2007

Hi,

I have several packages where I set up a SQL Server log provider. The packages are all called from jobs.

However, for some reason, only ONE of the packages is logging to the sysdtslog90 table in my specified database.

All of packages have the identical set up for the logging. Here are my settings under logging:

PROVIDERS AND LOGS:
Name: SSIS Log Provider for SQL Server (box is checked)
Configuration: ServerName.DBName (I use this same connection for all the packages)

DETAILS:
OnError is checked

CONTAINERS:
All items are checked

So what's going on here? I have successfully logged to this table using test cases in BIDS, and as I mentioned, ONE of the packages is actually logging to the table when it's called from the job.

Thanks



View 5 Replies View Related

Dates Not Sorting Properly

Feb 12, 2007

I am trying to sort by a date and then use a secondary sort on another column date field. The first date sorts properly, but the second is not in sorted order. I have also tried ORDER BY first date, second date and that queries the information in sorted by the first date, but then not sorted by the second date. Any ideas?

BJ

View 1 Replies View Related

Execute Properly Even If No Parameter Value Is Supplies

Aug 16, 2007

 set ANSI_NULLS ONset QUOTED_IDENTIFIER ONgo-- =============================================-- =============================================ALTER PROCEDURE [dbo].[Product_FindByParameters](@Name Varchar(255),@ManufactureID bigint,@ShortDescription Varchar(255),@ManufactureProductID Varchar(255),@ItemsInStock bigint,@StorePartNumber  Varchar(255))        ASBEGIN    SELECT P.ProductId,P.StorePartNumber,P.ShortDescription,P.ManufactureProductID,P.Name,P.Price,P.ItemsInStock,M.ManufactureName FROM Product P left join Manufacture MON P.ManufactureID=M.ManufactureIDWHERE     ( P.Name like '%' + @Name + '%' OR @Name is null)AND (P.ShortDescription LIKE '%' + @ShortDescription + '%'  OR @ShortDescription is null)AND( P.ManufactureProductID LIKE  '%' + @ManufactureProductID + '%' OR @ManufactureProductID is null)AND (P.ItemsInStock=@ItemsInStock)AND (P.ManufactureID = @ManufactureID OR @ManufactureID is null)END--exec  [dbo].[Product_FindByParameters] 'Heavy-Duty ',7,'Compact Size','DC727KA' ,0,''--exec  [dbo].[Product_FindByParameters] 'Heavy',7,'','','',''--exec  [dbo].[Product_FindByParameters] 'Heavy','' ,'','','' ,'' First 2 exec statement  gives many data row as result,But why the last donot give any row ;(  ;(how can i rewrite the stored procedure, such  that it gives out put even if i don't supply  ManufactureID as inputkindly help me 

View 2 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved