Viewing 15 posts - 2,251 through 2,265 (of 3,233 total)
Well, in all fairness, your example isn't really telling me anything, it is about as vague as you can get. Secondly, those are output parameters, not input parameters. The only...
May 23, 2007 at 2:51 pm
CREATE PROCEDURE dbo.OutputTest @Year int OUTPUT, @Year1 int OUTPUT, @Year2 int OUTPUT
AS
SELECT @Year = 2006,
@Year1 = 2005,
@Year2 = 2004
GO
DECLARE @returnValue int,
@returnValue1 int,
@returnValue2 int
EXEC dbo.OutputTest @returnValue OUTPUT,@returnValue1...
May 23, 2007 at 2:32 pm
Mark,
Keep in mind that the UNION statements are only there to populate the initial test data for the example. That test data is then used in place where your...
May 23, 2007 at 12:54 pm
In addition to what Lynn has posted:
It looks like you are performing this action on a number of tables hence the dynamic SQL. Don't forget to set the IDENTITY_INSERT back...
May 22, 2007 at 4:18 pm
INSERT INTO Table3 (<column list>![]()
SELECT <your select that you used to identify the 30,000 missing rows>
May 22, 2007 at 2:40 pm
I would go with Matt's suggestions as COALESCE is the ANSI preferred method as opposed to ISNULL.
May 22, 2007 at 1:28 pm
You need to add another fetch next into your begin/end block like so:
CREATE TABLE #backupmissed(dbname VARCHAR(50),lastbackup VARCHAR(21))
SET ansi_warnings OFF
SET NOCOUNT on
DECLARE @names VARCHAR(30)
INSERT INTO #backupmissed(dbname,lastbackup)
SELECT A.database_name as 'DBName',
A.backup_finish_date...
May 22, 2007 at 1:26 pm
SELECT AuditDateTime,
SUM(COALESCE(ColA,0)) AS colA,
SUM(COALESCE(ColB,0)) AS colB,
SUM(COALESCE(ColC,0)) AS colC
FROM #a
GROUP BY AuditDateTime
May 16, 2007 at 4:43 pm
Create a calendar or dates table. Do a search on SSC for calendar table or dates table. There are many threads on this topic.
May 16, 2007 at 4:05 pm
Great post Jeff. I wanted to run through a test after David posted the question of performance, but I didn't have the time to get one put together. I did...
May 16, 2007 at 3:57 pm
Because the temp table resided in TempDB, you will not be able to rename the table using sp_rename as sp_rename will not allow you to...
May 16, 2007 at 2:43 pm
Unless there is logic within your stored procedure to write a run history to an audit table, there is really no way to know the last time a SP has...
May 15, 2007 at 1:38 pm
1. Drop all foreign keys and constraints on the affected columns.
2. Run ALTER TABLE <tableName> ALTER COLUMN <columnName> [char].... commands for each table/column to change.
3. Re-create all constraints.
May 15, 2007 at 1:36 pm
Viewing 15 posts - 2,251 through 2,265 (of 3,233 total)