Click here to Skip to main content
15,898,981 members
Home / Discussions / Database
   

Database

 
AnswerRe: Multiple queries within an ADO connection Pin
MBCDC21-Jul-08 0:59
MBCDC21-Jul-08 0:59 
Questionerror when deleting with the WITH clause? Pin
harcaype16-Jul-08 7:01
harcaype16-Jul-08 7:01 
hi. I'm trying to delete a row by specifying the actual row number. When I call all columns from one table it does work but when I already multiselect them I get an error: Msg 4405, Level 16, State 1, Line 1
View or function 'Records ORDERED BY rowID' is not updatable because the modification affects multiple base tables.


This one works:

WITH [Records ORDERED BY rowID] AS
(SELECT row_number() OVER (ORDER BY Records.[Plate Number] ASC) AS rowID,*)
DELETE FROM [Records ORDERED BY rowID] WHERE rowID=1


This one gets the error:

WITH [Records ORDERED BY rowID] AS
(SELECT row_number() OVER (ORDER BY Records.[Plate Number] ASC) AS rowID,
Records.[Officer ID],
DriverInfo.[Plate Number],
DriverInfo.[License Number],
DriverInfo.[Conduction Number],
DriverInfo.[Vehicle Category],
DriverInfo.[Vehicle Type],
DriverInfo.[Vehicle Brand],
DriverInfo.[Last Name],
DriverInfo.[First Name],
DriverInfo.[Middle Name],
DriverInfo.[Birth Date],
DriverInfo.[Registered Address],
DriverInfo.[Address' City Code],
Records.[Violation Commited],
Violations.[Violation Code],
Records.[Street Name],
Records.[City of Apprehension],
Cities.[City Code],
Violations.[Fine Amount],
Records.[Date/Time Apprehended]
FROM Violations,DriverInfo,Records,Cities
WHERE Records.[Plate Number] like DriverInfo.[Plate Number]
and Records.[Violation Commited] like Violations.Violations
and Records.[City of Apprehension] like Cities.City)
DELETE FROM [Records ORDERED BY rowID] WHERE rowID=1

AnswerRe: error when deleting with the WITH clause? Pin
tsaunders16-Jul-08 15:02
tsaunders16-Jul-08 15:02 
GeneralRe: error when deleting with the WITH clause? Pin
harcaype16-Jul-08 19:13
harcaype16-Jul-08 19:13 
AnswerRe: error when deleting with the WITH clause? Pin
leoinfo17-Jul-08 4:19
leoinfo17-Jul-08 4:19 
GeneralRe: error when deleting with the WITH clause? Pin
harcaype17-Jul-08 5:56
harcaype17-Jul-08 5:56 
QuestionHow to get the first rows of a relational table (depending of the last date of change) Pin
fracalifa16-Jul-08 1:51
fracalifa16-Jul-08 1:51 
AnswerRe: How to get the first rows of a relational table (depending of the last date of change) Pin
A Wong16-Jul-08 2:18
A Wong16-Jul-08 2:18 
GeneralRe: How to get the first rows of a relational table (depending of the last date of change) Pin
fracalifa16-Jul-08 3:01
fracalifa16-Jul-08 3:01 
GeneralRe: How to get the first rows of a relational table (depending of the last date of change) Pin
A Wong16-Jul-08 3:15
A Wong16-Jul-08 3:15 
GeneralRe: How to get the first rows of a relational table (depending of the last date of change) Pin
fracalifa16-Jul-08 3:32
fracalifa16-Jul-08 3:32 
GeneralRe: How to get the first rows of a relational table (depending of the last date of change) Pin
A Wong16-Jul-08 3:41
A Wong16-Jul-08 3:41 
GeneralRe: How to get the first rows of a relational table (depending of the last date of change) Pin
fracalifa16-Jul-08 4:10
fracalifa16-Jul-08 4:10 
GeneralRe: How to get the first rows of a relational table (depending of the last date of change) Pin
A Wong16-Jul-08 4:38
A Wong16-Jul-08 4:38 
GeneralRe: How to get the first rows of a relational table (depending of the last date of change) Pin
A Wong16-Jul-08 4:50
A Wong16-Jul-08 4:50 
AnswerRe: How to get the first rows of a relational table (depending of the last date of change) Pin
leoinfo16-Jul-08 4:29
leoinfo16-Jul-08 4:29 
AnswerRe: How to get the first rows of a relational table (depending of the last date of change) Pin
leoinfo16-Jul-08 4:39
leoinfo16-Jul-08 4:39 
GeneralRe: How to get the first rows of a relational table (depending of the last date of change) Pin
fracalifa16-Jul-08 4:56
fracalifa16-Jul-08 4:56 
QuestionHow to Make Application to Sync on Remote Site Pin
Nassoro Ally16-Jul-08 0:39
Nassoro Ally16-Jul-08 0:39 
QuestionReports are not visible on client machine Pin
meetaqadir15-Jul-08 20:54
meetaqadir15-Jul-08 20:54 
QuestionOLEDB with Excel problem Pin
acroitoriu15-Jul-08 20:52
acroitoriu15-Jul-08 20:52 
AnswerRe: OLEDB with Excel problem Pin
acroitoriu15-Jul-08 21:23
acroitoriu15-Jul-08 21:23 
Questionfacing probs in nested cursor Pin
Member 387988115-Jul-08 19:56
Member 387988115-Jul-08 19:56 
AnswerRe: facing probs in nested cursor Pin
Alsvha15-Jul-08 23:28
Alsvha15-Jul-08 23:28 
Questionbytes retrieval Pin
vicki52815-Jul-08 18:19
vicki52815-Jul-08 18:19 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.