Viewing 15 posts - 16 through 30 (of 48 total)
Much appreciated, Ive read from somewhere if I use QUOTENAME(@FieldName,'''') with 4 single quotations, it makes stored procedure bullet proof from sql injection, but Im still in doubt if its...
___________________________________
Computer Enterprise Masoud Keshavarz
I don't care about hell.
If I go there I've played enough Diablo to know how to fight my way out.
December 24, 2013 at 3:10 am
Ville-Pekka Vahteala (12/22/2013)
Couple of things.Can't you just use constraints?
Your posted code seems to assume that there will be just one row coming to trigger, which might not be the case.
Thank...
___________________________________
Computer Enterprise Masoud Keshavarz
I don't care about hell.
If I go there I've played enough Diablo to know how to fight my way out.
December 22, 2013 at 1:47 am
Ville-Pekka Vahteala (12/22/2013)
Couple of things.Can't you just use constraints?
Your posted code seems to assume that there will be just one row coming to trigger, which might not be the case.
Well,...
___________________________________
Computer Enterprise Masoud Keshavarz
I don't care about hell.
If I go there I've played enough Diablo to know how to fight my way out.
December 22, 2013 at 12:51 am
I found this message:
The transaction ended in the trigger. The batch has been aborted.
Is because "ROLLBACK TRANSACTION".
If we don't want above message we have to remove "ROLLBACK TRANSACTION" and validate...
___________________________________
Computer Enterprise Masoud Keshavarz
I don't care about hell.
If I go there I've played enough Diablo to know how to fight my way out.
December 22, 2013 at 12:33 am
Much appreciated, I think you've gave me enough clue.
___________________________________
Computer Enterprise Masoud Keshavarz
I don't care about hell.
If I go there I've played enough Diablo to know how to fight my way out.
December 16, 2013 at 5:39 am
This query works fine:
DECLARE @dt CHAR(8)
SET @dt = cast(MONTH(getdate()) as char(2)) + '01' + cast(year(getdate()) as char(4))
SELECT CONVERT(datetime,RIGHT(@dt,4)+LEFT(@dt,2)+SUBSTRING(@dt,3,2),112)
___________________________________
Computer Enterprise Masoud Keshavarz
I don't care about hell.
If I go there I've played enough Diablo to know how to fight my way out.
December 9, 2013 at 6:00 am
Much appreciated Gail Shaw.
Thank you very much.
___________________________________
Computer Enterprise Masoud Keshavarz
I don't care about hell.
If I go there I've played enough Diablo to know how to fight my way out.
September 15, 2013 at 6:50 am
After several hours of thinking if seems using min(ID) solve problem
WITH CTE(Col1, Col2, Row_Num) AS (
SELECT Col1 ,SUM(Col2), ROW_NUMBER() OVER(ORDER BY (MIN(ID)))
...
___________________________________
Computer Enterprise Masoud Keshavarz
I don't care about hell.
If I go there I've played enough Diablo to know how to fight my way out.
September 15, 2013 at 1:27 am
siggemannen (9/14/2013)
Try MIN(ID) in the inner select and it will work i think?
haha yes 😀
Thanks it worked, much appreciated
___________________________________
Computer Enterprise Masoud Keshavarz
I don't care about hell.
If I go there I've played enough Diablo to know how to fight my way out.
September 14, 2013 at 11:09 pm
How about alternative ways like this?
SELECT '9/8/2013', 12345,
(SELECT [AM_attendance code] WHERE student_id = '12345' and [AM_attendance code] is not null),
(SELECT [PM_AttendanceCode] WHERE student_id = '12345' and [PM_AttendanceCode] is...
___________________________________
Computer Enterprise Masoud Keshavarz
I don't care about hell.
If I go there I've played enough Diablo to know how to fight my way out.
September 14, 2013 at 11:23 am
Thank you for reply.
My table have key, problem is if I sort my table with key I have to use it in "GROUP BY" and it generate incorrect output.
See this:
CREATE...
___________________________________
Computer Enterprise Masoud Keshavarz
I don't care about hell.
If I go there I've played enough Diablo to know how to fight my way out.
September 14, 2013 at 9:12 am
Thank you everyone for giving me clue.
I solved this question with this statement:
WITH
cte1(col) as (
SELECT col FROM #table1
...
___________________________________
Computer Enterprise Masoud Keshavarz
I don't care about hell.
If I go there I've played enough Diablo to know how to fight my way out.
September 14, 2013 at 7:02 am
Thank you very much for reply.
Im sorry I just didnt want to waste your precious time to solve my exact problem, but It seems I have to provide more informations.
I...
___________________________________
Computer Enterprise Masoud Keshavarz
I don't care about hell.
If I go there I've played enough Diablo to know how to fight my way out.
September 13, 2013 at 11:56 pm
Thank you every one.
And sorry for errors in insert statement.
___________________________________
Computer Enterprise Masoud Keshavarz
I don't care about hell.
If I go there I've played enough Diablo to know how to fight my way out.
September 13, 2013 at 2:03 am
Im not sure if my theory is correct, but according to error you gave to us if 'schemaUser' database exists its good to try this:
1. Login to "sql server management...
___________________________________
Computer Enterprise Masoud Keshavarz
I don't care about hell.
If I go there I've played enough Diablo to know how to fight my way out.
September 2, 2013 at 11:01 pm
Viewing 15 posts - 16 through 30 (of 48 total)