Viewing 15 posts - 766 through 780 (of 1,156 total)
For this you need two tiggers on that will add new products to the history table (after insert) and another to insert a new record when a product is updated....
January 29, 2008 at 2:46 pm
Note for the above post:
You will need both opening and closing brackets for the code tags. I did not put them because I wanted to display what to type,...
January 29, 2008 at 2:16 pm
You can maintain your formatting using the code tags. For some reason the code tags are not on the shortcut menu; I have no idea why :hehe:
e.g.
January 29, 2008 at 2:14 pm
You cant run the select statment with the parameters unless you declare the parameters. For a stored procedure you dont have to use the "DECLARE" statement to declare variables...
January 29, 2008 at 2:03 pm
You could also do a sum calculation in the having clause.
SELECT
InvoiceNumber
FROM MyTable
GROUP BY InvoiceNumber
HAVINGSUM(CASE WHEN [type] = 'DBT' THEN 1...
January 29, 2008 at 1:51 pm
Kenneth is right. You will need to inner join the Invoice and Salesman table then group by salesman name and invoice date.
Your output would look like this
nameInvoiceDateTotal InvoiceTotal Discount
test2008-01-02...
January 29, 2008 at 12:36 pm
I agree with GSquared. While it is possible to do this via xp_cmdshell, I would not advise it. Create a vbscript or .bat file that will do the...
January 28, 2008 at 3:52 pm
When you shrunk the log file, did you return the free space to the operating system? If not the file will still maintain the large size.
January 28, 2008 at 11:52 am
Not really, but you should execute the dynamic sql using the sp_executesql function, as it allows query plan reuse and functionality for parameters.
BOL
ms-help://MS.SQLCC.v9/MS.SQLSVR.v9.en/tsqlref9/html/a8d68d72-0f4d-4ecb-ae86-1235b962f646.htm
January 28, 2008 at 11:41 am
How are you running the procedure from SSMS query window or command line and do you have the insert wrapped in a transaction with a try/catch or xact_abort?
January 28, 2008 at 8:58 am
Does 'E:\import_error.txt' exsit prior to running the bulk insert? The file should not exist before running the insert.
January 28, 2008 at 8:36 am
This is from BOL
MAXERRORS = max_errors
Specifies the maximum number of syntax errors allowed in the data before the bulk-import operation is canceled. Each row that cannot be imported by the...
January 28, 2008 at 8:11 am
You could do something like this to make it a little cleaner.
SELECT
userID,
SUM(Correct) AS CORRECT,
SUM(Wrong) as Wrong,
SUM(AssitanceNeeded) AS AssitanceNeeded,
Month(TimeDateStamp) AS 'Month',
Year(TimeDateStamp)AS 'Year'
FROM Charts
WHERE TimeDateStamp...
January 28, 2008 at 8:02 am
This article will show you how to import a file with multiple delimiters via SSIS.
http://www.sql-server-performance.com/articles/dba/import_text_files_ssis_p1.aspx
January 25, 2008 at 11:40 am
Do you have to use the stored procedure or can you perform the select query? Are you looking for differences?
You can use except to get the differences between the...
January 25, 2008 at 8:39 am
Viewing 15 posts - 766 through 780 (of 1,156 total)