Viewing 15 posts - 46 through 60 (of 86 total)
SELECT
[Salesperson]
, [Cust ID]
, [Customer]
, MAX([Sales1]) [Sales1]
, MAX([Sales2]) [Sales2]
, MAX([Sales3]) [Sales3]
FROM (
SELECT
OSLP.SlpName AS [Salesperson]
, OINV.CardCode AS [Cust ID]
, OINV.CardName AS [Customer]
, SUM(INV1.LineTotal) AS [Sales1]
, NULL AS [Sales2]
, NULL AS[Sales3]
FROM
OSLP...
October 10, 2011 at 5:24 am
I see only one solution is to add another column to TableA of destination server
Copy from DB1 to DB2
Insert Into TableA(... , DB1_ItemID )
Select ..., ItemID From DB1..dbo.TableA
Insert Into...
October 9, 2011 at 11:52 pm
if
Both will have some rows in them already
it will throw an error
October 9, 2011 at 11:44 pm
modified code of sp_spaceusage
select
t.name,
rows = convert(char(11), rows),
--reserved: reserved
reserved = ltrim(str(reserved * d.low / 1024.,15,0) +
' ' + 'KB'),
--data: dpages+ used
data = ltrim(str((dpages + used) * d.low / 1024.,15,0) +
' '...
October 9, 2011 at 11:41 pm
SET IDENTITY_INSERT
Allows explicit values to be inserted into the identity column of a table.
October 7, 2011 at 1:39 am
select
DFES
, MAX(CASE WHEN PHASE='1' THEN ACTIVITYNAME END) as [PHASE_1]
, MAX(CASE WHEN PHASE='2' THEN ACTIVITYNAME END) as [PHASE_2]
, MAX(CASE WHEN PHASE='3' THEN ACTIVITYNAME END) as [PHASE_3]
, MAX(CASE WHEN PHASE='4' THEN...
October 6, 2011 at 12:43 am
SELECT
ID
, MAX(CASE WHEN SEQ = 1 THEN CODE ELSE NULL END) CODE1
, MAX(CASE WHEN SEQ = 2 THEN CODE ELSE NULL END) CODE2
, MAX(CASE WHEN SEQ = 3 THEN CODE...
October 5, 2011 at 6:13 am
Last row
[CompanyID] - EF
[ItemCode] - 123456
[Description] - 2 x Tennis balls, Rackets and bags
[SupplierAccount] - TNSRCKBL
[PONumber] - T763781
[POLineNumber] - 3
[OutstandingQty]...
September 19, 2011 at 10:52 pm
Just that the last row has a comma in item description and I need to insert the data with the comma that is in there. The problem is it considers...
September 19, 2011 at 9:54 am
Hi, dcs09
I have changed fmt-file and received result (see attachments)
CREATE TABLE [dbo].[Out_orders_Table2](
[CompanyID] [nchar](3) NULL,
[ItemCode] [nchar](9) NULL,
[Description] [nchar](38) NULL,
[SupplierAccount] [nchar](9) NULL,
[PONumber] [nchar](8) NULL,
[POLineNumber] [numeric](3, 0) NULL,
[OutstandingQty] [numeric](6, 0) NULL,
[DueDate] [nchar](30) NULL,
[StockRoom]...
September 19, 2011 at 1:09 am
can you upload csv-file to the forum?
September 17, 2011 at 1:01 am
open it as a delimited file with both commas and tab as delimiters
is there both commas and tab as delimiters in each line in the file?
in this case? you...
September 16, 2011 at 11:56 pm
try to use simple "bulk insert"
bulk insert [dbo].[Out_orders_Table2] from 'path to file' with (fieldterminator = ',')
September 16, 2011 at 9:20 am
SQL server and csv file are on a same mashine?
September 16, 2011 at 9:09 am
8.0
10
1 SQLNCHAR 0 3 "," 1 CompanyID ""
2 SQLNCHAR 0 9 "," 2 ItemCode ""
3 SQLNCHAR 0 38 "," 3 Descritpion ""
4 SQLNCHAR 0 9 "," 4...
September 16, 2011 at 5:04 am
Viewing 15 posts - 46 through 60 (of 86 total)