November 22, 2019 at 12:00 am
Comments posted to this topic are about the item The CTE Insert
November 22, 2019 at 4:55 am
Nice, easy question to end the week on, thanks Steve
____________________________________________
Space, the final frontier? not any more...
All limits henceforth are self-imposed.
“libera tute vulgaris ex”
November 22, 2019 at 6:42 am
Nice question, but you should end the statement with a semicolon, so that the next statement will work if it contains a cte, too!
Have a nice day,Christoph
November 22, 2019 at 2:19 pm
Nice question, but you should end the statement with a semicolon, so that the next statement will work if it contains a cte, too!
He did but the semicolon is on the next line and didn't get posted. 🙂
_______________________________________________________________
Need help? Help us help you.
Read the article at http://www.sqlservercentral.com/articles/Best+Practices/61537/ for best practices on asking questions.
Need to split a string? Try Jeff Modens splitter http://www.sqlservercentral.com/articles/Tally+Table/72993/.
Cross Tabs and Pivots, Part 1 – Converting Rows to Columns - http://www.sqlservercentral.com/articles/T-SQL/63681/
Cross Tabs and Pivots, Part 2 - Dynamic Cross Tabs - http://www.sqlservercentral.com/articles/Crosstab/65048/
Understanding and Using APPLY (Part 1) - http://www.sqlservercentral.com/articles/APPLY/69953/
Understanding and Using APPLY (Part 2) - http://www.sqlservercentral.com/articles/APPLY/69954/
November 22, 2019 at 3:58 pm
Certainly should have semi colons. That's what I get for writing code in the form and not with SQL Prompt
November 25, 2019 at 7:36 am
NICE , BUT RECEIVED ERROR AT MY END .
November 25, 2019 at 6:01 pm
NICE , BUT RECEIVED ERROR AT MY END .
Sharing the error message would be helpful. The code as posted is perfectly valid.
_______________________________________________________________
Need help? Help us help you.
Read the article at http://www.sqlservercentral.com/articles/Best+Practices/61537/ for best practices on asking questions.
Need to split a string? Try Jeff Modens splitter http://www.sqlservercentral.com/articles/Tally+Table/72993/.
Cross Tabs and Pivots, Part 1 – Converting Rows to Columns - http://www.sqlservercentral.com/articles/T-SQL/63681/
Cross Tabs and Pivots, Part 2 - Dynamic Cross Tabs - http://www.sqlservercentral.com/articles/Crosstab/65048/
Understanding and Using APPLY (Part 1) - http://www.sqlservercentral.com/articles/APPLY/69953/
Understanding and Using APPLY (Part 2) - http://www.sqlservercentral.com/articles/APPLY/69954/
November 25, 2019 at 9:09 pm
NICE , BUT RECEIVED ERROR AT MY END .
there are three statements, so you have to evaluate which one is syntactically correct.
two of the statements are not, so if you copy paste the whole code stack, you get syntax errors.
Msg 156, Level 15, State 1, Line 3
Incorrect syntax near the keyword 'INSERT'.
Msg 156, Level 15, State 1, Line 4
Incorrect syntax near the keyword 'AS'.
Msg 156, Level 15, State 1, Line 14
Incorrect syntax near the keyword 'WITH'.
Msg 319, Level 15, State 1, Line 14
Incorrect syntax near the keyword 'with'. If this statement is a common table expression, an xmlnamespaces clause or a change tracking context clause, the previous statement must be terminated with a semicolon.
Lowell
November 25, 2019 at 9:19 pm
These questions are not always designed to cut and paste code. They are really designed for you to think and solve on your own, without a computer. If you use one, then you may still need to properly evaluate the code that is given.
November 26, 2019 at 5:57 am
right i agreed , but after answered myself then i would evaluate the mentioned code and see the result myself . thanks for response.
Viewing 10 posts - 1 through 9 (of 9 total)
You must be logged in to reply to this topic. Login to reply