Viewing 15 posts - 5,656 through 5,670 (of 7,597 total)
I guess rename one of them. But better to avoid using temp tables in a trigger unless absolutely necessary.
The triggers probably need re-written. Post them here and we...
October 23, 2014 at 2:51 pm
You can use system procedure:
sp_rename
to rename a column. The general format is like this:
EXEC sp_rename 'table_name.existing_column_name', 'new_column_name', 'COLUMN'
October 23, 2014 at 2:48 pm
patrickmcginnis59 10839 (10/23/2014)
ScottPletcher (10/23/2014)
arnipetursson (10/23/2014)
ScottPletcher (10/22/2014)
October 23, 2014 at 1:54 pm
I suggest gen'ing the MOVE clauses directly from @tables, ignoring the count. Just concatenate all the results into a RESTORE statement, and run that statement dynamically. For example:
...existing...
October 23, 2014 at 12:57 pm
arnipetursson (10/23/2014)
ScottPletcher (10/22/2014)
October 23, 2014 at 12:31 pm
And those same guys obviously did contract work for healthcare.gov! 😀
October 23, 2014 at 11:09 am
For temp tables, you must also consider:
INTO #new_temp_table
rather than just CREATE.
October 23, 2014 at 10:41 am
Those sound like Oracle qs, but this is a SQL Server forum.
You would likely get much better responses to your q by posting it in an appropriate Oracle forum.
October 23, 2014 at 10:28 am
jeff.born (10/22/2014)
October 22, 2014 at 3:49 pm
SELECT
[BusinessName], [Address], [Phone]
,MIN(Business_pk) AS Business_pk_min,
,MAX(Business_pk) AS Business_pk_max
FROM [dbo].[TestBusiness] bus
INTO [dbo].[DuplicateBusinesses]
GROUP BY
[BusinessName], [Address], [Phone]
HAVING COUNT(*) > 1
October 22, 2014 at 3:32 pm
You should be able to use the session_id to do the lookup. But since session_ids are reused, and sysjobactivity keeps history, if your proc is not currently running from...
October 22, 2014 at 3:18 pm
Frank The Tank (10/21/2014)
October 21, 2014 at 9:47 am
Phil Parkin (10/21/2014)
ScottPletcher (10/20/2014)
October 21, 2014 at 8:57 am
Increasing the size of a [n]varchar column isn't directly a problem.
But, if you think people will go back and increase the length of those columns in a significant...
October 20, 2014 at 4:26 pm
If the controlling column(s) are all from the same table, I suggest a computed column. That leaves the defining logic in only a single place, and allows the calc'd...
October 20, 2014 at 4:23 pm
Viewing 15 posts - 5,656 through 5,670 (of 7,597 total)