Multiple Stores Orders To Sink Up With Main Server

May 4, 2007

Hello,

Say there are 10 retail store locations that need to push their daily sales to the main server at the head office.

What techniques are used to accomplish this? I'd imagine the transaction rows would have to be some sort of a GUID.

What options are there? What techniques are used to ensure each stores orders have indeed been pushed to the main server?

View 3 Replies


ADVERTISEMENT

XML Data To SQL Server With Multiple Orders An Multiple Order Details??

Aug 5, 2004

Hi all!

I'm trying to get some XML data into SQL Server but i ran into problem when inserting the data (multiple orders with multiple order details) using a single sproc. Is it possible, or do I have to do in some other way? :confused:

I simplified my example to this:
-----------------------------
--CREATE PROCEDURE sp_InsertOrders AS

DECLARE @docHandle INT, @xmlDoc VARCHAR(4000), @orderID INT

--DROP TABLE #Orders
CREATE TABLE #Orders
(
OrderId SMALLINT IDENTITY(1,1),
FkCustomerID SMALLINT NOT NULL,
OrderDate DATETIME NOT NULL
)

--DROP TABLE #OrderDetails
CREATE TABLE #OrderDetails
(
OrderDetailsId SMALLINT IDENTITY(1,1),
FkOrderID SMALLINT NOT NULL,
ProductID SMALLINT NOT NULL,
UnitPrice SMALLINT NOT NULL
)

Set @xmlDoc = '
<Orders>
<Order CustomerID="1" OrderDate="2004-04-01">
<OrderDetails ProductID="6" UnitPrice="19"/>
<OrderDetails ProductID="3" UnitPrice="11"/>
<OrderDetails ProductID="9" UnitPrice="7"/>
</Order>
<Order CustomerID="2" OrderDate="2004-04-12">
<OrderDetails ProductID="2" UnitPrice="24"/>
<OrderDetails ProductID="4" UnitPrice="13"/>
</Order>
</Orders>'

EXEC sp_xml_preparedocument @docHandle OUTPUT, @xmlDoc

INSERT INTO #Orders (FkCustomerID, OrderDate)
SELECT CustomerID, OrderDate
FROM OpenXML(@docHandle, 'Orders/Order', 3)
WITH (
CustomerID INTEGER,
OrderDate DATETIME
)

SET @OrderID = @@IDENTITY;

--INSERT INTO #OrderDetails (@OrderID, ProductID, UnitPrice)
SELECT @OrderID AS OrderID, ProductID, UnitPrice
FROM OpenXML(@docHandle, 'Orders/Order/OrderDetails', 3)
WITH (
ProductID INTEGER,
UnitPrice INTEGER
)
-----------------------------

All orders are inserted first which makes the use of @@IDENTITY incorrect (it works fine if you insert a single order with multiple order details). Since it was quite some time since I last worked with SQL I am not sure if am doing it the right way... :confused: :confused: Anybody out there who knows how to solve the problem?

Cheers,
Christian

View 2 Replies View Related

SQL Server 2008 :: Creating Multiple Charts Based Off Of Main Chart

Jun 4, 2015

I have this main chart setup. It pulls data from a query based on the selected parameters.

I want to create multiple charts for every catagory in the result set.

On the main chart there is a catagory called "Missing".

I want a chart for this category to display when the main chart is loaded. So below the main chart it would show a chart for each of the categories on the main chart.

Basically this report returns information on a certain part number displaying its problem types. Then I want it to create other charts for each problem type displaying the problem sub-types.

View 1 Replies View Related

I Need To Know Where Mssql Server Stores Its Data.

Jan 19, 2008

Hello,I need to learn where mssql server stores its data. I knew it was inProgram filesCommon filesBut I cant find.. Its urgent pls..Thanx

View 4 Replies View Related

Stores In Australia That Sell SQL Server 2005 Developer Edition

Oct 25, 2007

Does anyone know which stores in Australia sell SQL Server 2005 Developer Edition. I want to buy it from a store not online, thanks...

View 1 Replies View Related

SQL Server 2012 :: Last Orders For Each CustomerID

Feb 27, 2015

I want to select last order's details for each customer

[URL] ...

I have one table. id is primary key. No Foreign Key

I could select last date and customerid but I want to see quantity, productid, total in last date for each customerid

[URL] .....

View 7 Replies View Related

SQL Server To Main Frame

Jun 23, 2004

I'm trying to send data from a table on SQL server to a DB2 table on the Main Frame and I get this error. Any ideas?

[IBM][CLI Driver][DB2]SQL0904N Unsuccessful execution caused by an unavailable resource. Reason code: "UPDATABLE WORKFILE", type of resource: "100", and resource name: "TEMP DATABASE". SQLSTATE=57011

View 4 Replies View Related

Deploying A Report To The Main Server

Oct 5, 2007



I have created several reports using SSRS which is installed in my local machine. But source data base is in the main server. Data source connection works properly. Report manager is also configured to local machine.

Now I tried to deploy these reports to main server. So I changed the target URL to http://mainservername/reportsserver in the internal report property change box. But it was not succeeded. I get a error message like this.



------ Build started: Project: Partner Reports -Internal, Configuration: Production ------

Build complete -- 0 errors, 0 warnings

------ Deploy started: Project: Partner Reports -Internal, Configuration: Production ------

Deploying to http://derby/ReportServer

Error rsRPCError : The report server cannot decrypt the symmetric key used to access sensitive or encrypted data in a report server database. You must either restore a backup key or delete all encrypted content. Check the documentation for more information. (rsReportServerDisabled)

Deploy complete -- 1 errors, 0 warnings

========== Build: 1 succeeded or up-to-date, 0 failed, 0 skipped ==========

========== Deploy: 0 succeeded, 1 failed, 0 skipped ==========


Reporting services was already installed in main server. Do I have to change settings of report configuration manager in my local machine?

View 4 Replies View Related

Data Migration From MAIN FRAMES To SQL Server 200

Oct 19, 2001

What are the tools available in MS SQL Server 2000 migrate data from Main Frames. Can we do with DTS if so are drivers available to connect to sql servers.

Can you let me the technies and tools available ?

Thanks in Advance

View 2 Replies View Related

Data Trasfer Between Host Server And Main Server

Jan 18, 2007

bab writes "My company is going to host our web application in a host server with the sql server DB needed for the application. what is the best way to transfer the data between host server and main server.

Any thought."

View 1 Replies View Related

Replicate To Other Server If Replication With Main Server Failed ...

Aug 16, 2007



Let say I've 4 server with MS SQL 2000 installed and I want all of them having the same data. So I'm using merge replication by assign one of them as publisher/distributor.
The problem is when ( let say ) server that have been assign as publisher/distributor down then all the other server cannot make replication.
My idea was to make it replicate to other available server ( among them ) if replication to main server failed.
Is it possible ?
If possible how to do it ?

Thanks.

View 1 Replies View Related

SQL Server Admin 2014 :: Can Use Different Index On Main DB And Mirror Database

Oct 31, 2015

We use SQL server always on feather on my database and we distribute statement on main database server and mirror database server for raise performance.

My police for split statement is DML (insert, update and delete) statement go to main DB and Read Data (select) statement go to mirror DB.

I want know can I use different index on main DB and mirror Database?

Because some index are used in mirror DB not used in main database.

View 3 Replies View Related

Is There Any Downside Having The SQL-server Installed On The Main Server?

Mar 13, 2006

Is there any downside having the SQL-server installed on the main/domain server? Or should you have a separate server just for SQL?

View 6 Replies View Related

Stores Procedure

May 5, 2005

I am trying to select the HdwId value of a table named "tblHdw" and trying to insert it into the HwdId field in a table named "tblLoc". 

If you have any suggestions?

Thanks,
MattyPee

View 1 Replies View Related

Use VB DLL In A Stores Procedure?

Feb 14, 1999

I read in a technical journal (somewhere) that it is possible to create a ActiveX DLL in Visual Basic and use the DLL in a stored procedure. There were some limitations (because of stored procedures) but this is still a very powerful feature. Has anyone ever heard of this or read about this? Is there s source for explanation and examples?

Thanks, Rich.

View 1 Replies View Related

DTS Import Stores The Last {LF} In Table.

Sep 7, 2006

Hi i have a csv file where the last column usually happens to be null. So my file is like this:
1,2,3,,{LF}
4,5,6,,{LF}
7,8,9,,{LF}
{CR}

I run the dts export from csv file to db and it doesnt save the last row (column5) in the table us null. instead it stores the {LF} character. Ascii =10. How can i resove this problem.
the csv comes from a third party application. the DTS needs to un automatically and somehow resolve that last problem on its own. but how??? is there a code that can trim the last character in the last line to delete the last {LF} or some query in DTS that can achive this.....

View 4 Replies View Related

Table Which Stores Report Name

Feb 5, 2008

Hi All,

Please let me know within Reporting server database which table stores the actual report name,keywords and author of the report.

I want to search the report based on the report name using my own custom code.It will be helpfull if i get the table name so that i can fire select query.

Thanks in advance,
Prabhanjana

View 1 Replies View Related

Returing ADO Recordset From Stores Procedure

Nov 24, 2003

I have a Stored Procedure that I am calling from ADO 2.7 in Visual Basic. The process works fine when the stored procedure has records to return. However , when the recordset is return emtpy ADO does not recognize the recordset as being open and empty. For example:
VB Code to open recordset:
Set rstClass1 = New ADODB.Recordset
With rstClass1
.CursorLocation = adUseServer
Set .ActiveConnection = DBConn
.Source = strRecordSource
.LockType = adLockOptimistic
.CursorType = adOpenKeyset
.Open
If Not .EOF Or Not .BOF Then

The program bombs on the If Not .EOF statement with Error 3704 -
"Operation is not allowed when the object is closed.


When I run the Stored Procedure In QA using an ID that I know will NOT return any records the result window returns nothing. I noticed that on some of my other SP's the result window will at least return the column titles. These SP's also do not produce the 3704 error in ADO.

Is there a command or a certain method to construct my SP so that is will return enough for ADO to know that the recordset did open its just empty?

The SP is ugly looking but I will post if need be.

View 3 Replies View Related

Date Format SSRS Stores In DB

Feb 25, 2008



Hi,
I have report scheduled in a SSRS. SSRS creates a job and from MSDB.DBO.SysJobActivity the

Next_Scheduled_Run_Date column provides the next execution date of the report.

Can any one tell me what is the date format that SSRS stores is it a getdate() or a UTC Date??

View 1 Replies View Related

Pass Sorting Parameter To Stores Procedure

Feb 23, 2004

I used Datagrid to show "Title", "Location" and "Date", It works very well.
I want to sort DataGrid data, that is when user click the "Title", "Location" or "Date",
my asp.net code will through class and send "Sort" parameter to stores procedure to get the new data and bind to DataGrid.

Here is my stores procedure:

CREATE Procedure JobSearch
(
@Search varchar(150),
@Sort varchar(50)
)
AS

SELECT
JobTitle,
JobLocationCity,
JobLocationState,
PostDate

FROM
Job

WHERE
JobTitle LIKE '%' + @Search + '%'
OR
JobKeywords LIKE '%' + @Search + '%'

IF @Sort = "Title"
ORDER BY JobTitle
IF @Sort = "Location"
ORDER BY JobLocationState, JobLocationCity
IF @Sort = "PostDate"
ORDER BY PostDate DESC

When I test stores procedure in SQL Server, I got the error about "Error 156: Incorrect syntax near the keyword 'ORDER' ".

Who has experience about stores procedure, please help me to correct this error.

View 12 Replies View Related

Using A Variable That Stores The Query String For WHERE Condition

Feb 20, 2001

Hi, I was wondering if someone could help out. I need to create a stored procedure, but before i do so, I need to know if I can store a conditional expression in a string and just use that variable as my condition for the WHERE clause. The reason I ask this is because I am trying to create a stored procedure that queries different things depending on what the inputs are.

View 2 Replies View Related

Stores Procedure - Must Declare Scalar Variable

Apr 7, 2015

I am creating a SP below and it keep saying must declare scalar variable @comments,I have already declared @comments varchar (255)

error---> (Msg 137, Level 15, State 2, Procedure CheckPatientComments, Line 26
Must declare the scalar variable "@commnets".
)

quote:
CREATE PROCEDURE [dbo].[CheckPatientComments] (@enc_id varchar(36) OUTPUT, @data_ind CHAR(1) OUTPUT)
AS
BEGIN
DECLARE
@comments varchar(255)

[code]....

View 2 Replies View Related

Help With 2 Datetime Fields-1 Stores Date, The Other Time

Jun 9, 2006

Hi,We have a lame app that uses 2 datetime(8) fields, 1 stores the date, theother the time.example query:select aud_dt, aud_tmfrom ordersresults:aud_dt aud_tm2006-06-08 00:00:00.000 1900-01-01 12:32:26.287I'm trying to create a query that give me records from the current date inthe past hour.Here's a script that gives me todays date but I cannot figure out the time:select aud_dt, aud_tm, datediff(d,aud_dt,getdate()), datediff(mi, aud_tm,getdate())from orderswhere (datediff(d,aud_dt,getdate()) = 0)results:aud_dt aud_tmdatediff(0=today) timediff (since 1900-01-01)2006-06-08 00:00:00.000 1900-01-01 12:32:26.287 055978689I added this next part to the above query but it does not work since thedate/time is from 1900-01-01and (datediff(mi, aud_tm, getdate()) <= 60)Thanks for any help.

View 2 Replies View Related

Should I Have A Table That Stores A Subset Of Data From Other Tables???

Mar 21, 2007

DB design question

I have multiple tables with information about a user. The tables are Roles, Users, Groups and Profiles.

For a user session I need information from all those tables. Would it be better to make a table called UserSession and collect the necessary data from the above mentioned tables and stick them in one the UserSession table or should I just write a query that goes out and gets the data from the different tables.

What is better practice and what is faster?

View 4 Replies View Related

Activated Stores Procedure And Batch Processing

Aug 2, 2006

Hi There

2 Questions :

1. Almost in every SB example you will see this sql :

BEGIN TRANSACTION

WAITFOR (

RECEIVE TOP (1)

@MessageType = message_type_name,

@Message = message_body

FROM [Queue1]

WHERE conversation_handle = @ConversationHandle

), timeout 5000;

If this sql in an activated sp do you really have to have the waitfor ? Since the sp will only be fired if there is a message on the queue ?

2. It is reccomended that for high volume SB apps you do not do a top(1) receive but process batches. Exactly what is the best practice to do this. Receive a batch into a table variable and then what ? Process through it with a cursor ? That is not very efficient either, i would just like some insight into batch queue processing as everywhere i have seen uses top (1) from the queue ?

Thanx

View 3 Replies View Related

Transact SQL :: Inventory Difference Between Rows Between Stores

May 8, 2015

how to measure a change in inventory over various stores.  My sql2008R2 express db gets a new row of data everyday from each store(about 40 stores) for a single product stock count "OnHand" and if there is any new stock on order.  When the new stock arrives it is added to the "OnHand" count.   I want to measure the delta change per day,per store.  I'm stuck on how to separate the stores and how to query the delta of stock.My data base looks like this
                               
TimeStamp Store
OnHand OnOrder
2015/04/22 18   1 - Concord
12
     0
2015/04/23 11   1 - Concord
11
 
[code]....

View 17 Replies View Related

Execute SQL Task With Full Result Set Stores Data As What?

Oct 22, 2007

Howdy all,

I have an Execute SQL Task that may return a result set. If it returns a result set, I'd like to log a failure in my package with the results visible.

I have logging turned on and that's working great. I've read about assigning results to a user variable of type Object and that's great. I can shred my results, thanks Jamie, with a Foreach loop no problem. Within that loop, I've got some VB that manipulates the values and will call Dts.Events.FireError as appropriate. However, VB is frowned upon here so my boss has asked that I push the VB logic into a Control Flow item.

I've built custom components already so I've got some familiarity with the process. Where I'm stuck at is figuring out _what_ the actual object type is in my code. The Connection manager is Native OLE DBSQL Native client. My Execute SQL Task uses a connection type of OLE DB with a Full result set. Results are stored in a variable named ErrorResultSet. Within the Execute method, I currently have this code set up in an attempt to pick apart the object and discover the available methods.





Code Block
Variables _variableCollection = null;
if (variableDispenser.Contains("ErrorResultSet"))
{
variableDispenser.LockForRead("ErrorResultSet");
}
variableDispenser.GetVariables(ref _variableCollection);

// Iterate through the variables that we were
// able to lock. Assigning values to entities as
// available.
foreach (Variable _en in _variableCollection)
{
switch (_en.Name)
{
case "ErrorResultSet":
Object _rs = _en.Value;
System.Type _type;
_type = _rs.GetType();
System.Data.DataSet _realResults;
_realResults = _rs as System.Data.DataSet;
// My expectation is that the cast of _realResults would
// not fail.
break;
}
}
// unlock before we go
_variableCollection.Unlock();
return DTSExecResult.Success;







At this point, my assumption is that the unboxed type of the recordset is not in the System.Data.DataSet inheritance chain as the cast failed. Anyone have insight into what it is? I can't seem to get any hits on google for what it's using behind the scenes in the Foreach ADO Enumerator.


Beyond the immediate question, anyone have thoughts on how else I can solve the problem? I had thought perhaps the task could raise an event if it returned rows but it didn't seem to have that functionality. Even if that had worked, telling the logging provider to capture the result set into the log might have been too much for native functionality. Another option I was thinking about would be to continue using the Enumerator and my custom component is a pure rewrite of the current Script task with the obvious downside being that I'd lose the generic-ness I was hoping to get with being able to hit my dataset.

View 8 Replies View Related

Spaced Used By Col In Index Page Is Total Length Of Col Or Data It Stores In It

Apr 9, 2015

i have one col in a nonclusted index which is bigint 8 bytes follwoing result shows min_record_size_in_bytes and max_record_size_in_bytes is 20 that is 12+8 page size is 8 kB. does that mean a record will use 20 bytes in a page or it will only use the space equalent to data stored in the col.what i have seen is page count is same weather i put some data in the col or null

select * From sys.dm_db_index_physical_stats(9,343,null,null,'DETAILED')
database_idobject_idindex_idpartition_numberindex_type_descalloc_unit_type_descindex_depthindex_
levelavg_fragmentation_in_percentfragment_countavg_fragment_size_in_pagespage_countavg_page_
space_used_in_percentrecord_countghost_record_countversion_ghost_record_countmin_
record_size_in_bytesmax_record_size_in_bytesavg_record_size_in_bytesforwarded_
record_countcompressed_page_count
999208304101HEAPIN_ROW_DATA102.9527559055118116253.187540514.196627131208358500016516516500
9992083041141NONCLUSTERED INDEXIN_ROW_DATA202553.21699.3544600938967585000202020NULL0
9992083041141NONCLUSTERED INDEXIN_ROW_DATA2101115.510254509513221600262626NULL0

View 1 Replies View Related

Reporting Services :: Connect 2 Stores Procedures In Report Builder

Aug 1, 2015

I have created two stored procedures.....

1) atmWonOpportunities_Users
2) atmWonOpportunities_Data (startdate and enddate parameters)

In (1) I created a filtered list of all user names associated with a certain business unit and saved it  to a temp table.
in (2) I create a filtered query listing all won opportunities during a period of time (date start and date end paramters)

In the report, I have 3 parameters, startdate, enddate and username (dropdown list).

When I run the report I select a startdate, enddate and username. I click the View Report button and get the same results for any one of the usernames I pick which is wrong.

View 4 Replies View Related

Orders And Orderitems

Feb 26, 2006

Hello all, have a temp table where I put data from a shopping cart. I need to take the data from this temp table and put it into an orders table and an orderItems table. The table structure is as follows: The cstb_orders.orderId has a one to many relationship with the cstb_orderItems.orderId cstb_orderItemsTemp id --pk invtId descr location quantity username shiptoaddress shiptocity shiptostate shiptozip shiptophone shiptofax cstb_orders orderId --pk username shiptoaddress shiptocity shiptostate shiptozip shiptocity shiptostate shiptozip shiptophone orderdate --auto date shipdate --null cstb_orderItems id --pk orderId --fk invtId descr location quantity What is the best way to accomplish this?

View 1 Replies View Related

Sort Orders

Oct 5, 1999

Is there a query you can run against a 7.0 server to return the chracter set and sort order.

View 1 Replies View Related

Different Sort Orders ??? Please Help

Feb 12, 2008

Hi There i have two windows 2000 servers which are both running SQL and i would like to restore a backup from one server to the other. Which in my opinion should be an easy task but when i go into the restore option and point it at the file i would like to restore i get the follwoing error

"The database you are attempting to restore was backed up under a different sort order ID (52) than the one you are currently using on this server (50) and at least one of them is a non binary sort order. Backup or restore operation operation terminating abnormally."

The server that i am trying to restore to already has databases on this so i cannot just reinstall SQL and change the sort order not that id know how to do that but this is what i have read.

Is htere anyway that i can put insome script for the database to fix this ???

Im using Enterprise manager with SQL server 7

Thanks in advance

View 14 Replies View Related

Last 3 Orders Per Customer

May 10, 2007

Good day.
Am new with SQL server and i use SQL Server 2005

i have 3 tables (1 = customers, 2 = orders, 3 = keys) both these tables are linked by the key table

I wanna be able to "view" (as am only allowed to view) the last three orders for every customer.

I tried using the top predicate/ clause with a group by & count but unfortunately am getting no where.

Please kindly help

View 14 Replies View Related







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