Viewing 15 posts - 91 through 105 (of 111 total)
1.For error checking I create a local variables @ErrNum and @ErrDesc and setting like:
set @ErrNum = @@ERROR
set @@ErrDesc = "Invalid...
April 16, 2002 at 12:48 pm
How about
select @varMonth =left(convert(varchar(10),@varSysDate,101),2)
see CONVERT (data_type[(length)], expression [, style])
where 101 is -"mm/dd/yy"
Edited by - EPol29 on 04/16/2002 12:30:44 PM
April 16, 2002 at 12:28 pm
You have to name your temp.table with prefix '# '
like #aarobtmp:
CREATE PROCEDURE rob_tmp_1
AS
SELECT glt_urn,
glt_code,
glt_description
INTO #aarobtmp
FROM ncm_general_list_type
SELECT * FROM #aarobtmp
GO
April 16, 2002 at 8:12 am
"I am concating multiple strings into a very very long string then insert in into a column of text type. "
Why can't you just add your multiple strings to the...
April 12, 2002 at 8:01 am
Select @var1 =Col1, @var2 =Col2, @var3 = Col3
From mytable
Where ....
For the Cursor:
declare MyCURSOR cursor
for Select Col1, Col2, Col3
from mytable
open MyCursor
set nocount on
fetch next from MyCursor into
@var1,...
April 12, 2002 at 7:42 am
Have you tried to use 'sp_executesql' or execute(sql) instead of direct select statement
April 11, 2002 at 1:07 pm
There is an article on another forum that will give you what you are looking for:
April 10, 2002 at 12:25 pm
When inserting data into the table put GetDate() for the field you need, create a triger on the insert/update for this field.
April 10, 2002 at 10:02 am
I posted recently the Script that might help you with your problem:
Pass several sets of parameters to run stored proc
http://www.sqlservercentral.com/scripts/scriptdetails.asp?scriptid=232
Edited by - EPol29 on 04/10/2002 09:07:55 AM
April 10, 2002 at 8:35 am
Is your column in the Table 2 always will have the structure abs123, or you will have different size of strings?
Edited by - EPol29 on 04/10/2002 08:08:25 AM
April 10, 2002 at 8:08 am
Another possibility:
DECLARE @ID INT,
@Name varchar(8000)
set @ID =0
set nocount on
WHILE@ID IS NOT NULL
BEGIN
SELECT @ID =min(ID)
FROMmyTable
WHEREID > @ID
IF@ID IS NOT NULL
BEGIN
select @Name = @Name + ' & ' + rtrim(name)
FROMmyTable...
April 8, 2002 at 3:30 pm
If LogID is an Integer then you don't have to convert the original value of @LogID_1 to varchar, just use 'WHERE LogID = @LogID_1'
And update directly!
[/quote]
LogID is an Integer.
[/quote]
April 5, 2002 at 1:32 pm
Why you are using 'EXEC (@SQLs)', why can't you update directly with your Update statement?
Your statement will look like:
UPDATE PELDMS.dbo.tProjectLog
SET Note = @Note_10
WHERE LogID = CAST(@LogID_1 AS...
April 5, 2002 at 11:13 am
just this part:
update tablename
set model = rtrim(model) + '-R'
April 4, 2002 at 3:08 pm
How about creating a trigger?
April 4, 2002 at 2:54 pm
Viewing 15 posts - 91 through 105 (of 111 total)