Viewing 15 posts - 12,061 through 12,075 (of 13,465 total)
if the data is all in the same row, you can do this:a assuming my table has the columns in capitals:
SELECT
@var1=SUBJECT,
@var2=EMAILFROM,
@var3=EMAILTO,
@var4=SUBJECT
FROM...
August 13, 2008 at 12:34 pm
ok, so it's not the count, but the MAX(EDI_CLM_SEQ_NBR) in the DTL that is no longer matching the header, right?
same query and update, but with slight changes?
--in theory, this will...
August 13, 2008 at 12:27 pm
there's something in script contributions that you can grab; i've updated my version slightly so that it also documents FUNCTIONS, which was not part of the original submission.
you can grab...
August 13, 2008 at 12:13 pm
I think you can do this with a simple UPDATE ...FROM:
find the records that might be affected:
SELECT * FROM CLM_HDR
INNER JOIN (SELECT EDI_CLM_ID,COUNT(EDI_CLM_SEQ_NBR) AS EDI_CLM_SEQ_NBR
...
August 13, 2008 at 11:54 am
it might be interesting to find data in the table that does not match it's supposed details:
does this return anything?
SELECT * FROM TokenManager
FULL OUTER JOIN
(SELECT CustomerID SUM(NumTokens) AS NumTokens...
August 13, 2008 at 11:24 am
well, first,
I've always tried to get rid of any tables that were trying to hold summary data with a view. it does away with needless updating.
i think based...
August 13, 2008 at 11:20 am
from a development standpoint, multiple instances are great for testing; I've had SQL7 as a default instance, SQL2000 and 2005 as named instances, all on the same machine. helpful if...
August 13, 2008 at 9:28 am
that is caused by the row terminator:
[slash]n is CrLf, which is found a lot.
try [slash]r which is just Carriage Return, which is common from UNIX type data sources.
August 5, 2008 at 9:04 am
i think it's parenthesis around the @sql....exec(@sql)
this works on my machine:
DECLARE @sql VARCHAR(8000)
DECLARE @path VARCHAR(255)
SET @path='c:[slash]nelson1.txt'
SET @sql='BULK INSERT nelson_test1 FROM ''' + @path + ''' '
...
August 5, 2008 at 8:48 am
also something else to consider;
wouldn't the where statement where len(a.NDC) > 0 force a table scan on the Reorders table in order to calculat ethe length of the field?...
August 5, 2008 at 8:20 am
[font="Courier New"]--all the columns must exist in the table...bulk insert doesn't let you choose.
--if the data was structured like this:
--1.0" 5.1" 5.1" 1.4" .2
--1.0" 5.1" 5.1" 1.4" .2
DROP TABLE nelson_test1
--i'd...
August 5, 2008 at 8:09 am
sorry...once your table #temp exists, i\BULK INSERT inserts into all columns....you can't identify the columns.
it should be this:
[font="Courier New"]BULK INSERT #temp1 FROM 'c:elson.txt'
WITH
(
DATAFILETYPE = 'char',
FIELDTERMINATOR =...
August 5, 2008 at 7:35 am
this example may be much more than you need.
This is very fast.
in my case, I had thousands of .txt files, all the same format.
they were distributed in 4 folders.
Each file...
August 5, 2008 at 6:52 am
Maybe you mean something like this?
this updates a table, and uses a SELECT to pull in relevant data from a select statement?
[font="Courier New"]
UPDATE SomeTable
SET SomeTable.BudgetAmount = X.BudgetAmount
FROM
(
SELECT ID,SUM(AMT)...
August 5, 2008 at 6:38 am
the issue is permissions, i'm pretty sure.
it doesn't matter which user you are logging into SQL server, whether domain admin,sa, or anyone else.
it's when you try to access services or...
August 4, 2008 at 11:34 am
Viewing 15 posts - 12,061 through 12,075 (of 13,465 total)