Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
oguzkaygun
Yak Posting Veteran
53 Posts |
Posted - 2009-02-25 : 11:11:45
|
hii have below stored procedure.. it works truely.. but my tableadapter of my dataset1.xsd cant accept it... it give me error that Listurunlistesi cant be found.. how can i fix it ? can u design my storedprocedure ? what should i do ?Also i see only UserId at gridview1 from first Select query.. but i should see amagazalar.UserId, amagazalar.madi, amagazalar.maciklama, amagazalar.resim1, amagazalar.urunsayisi at gridview1 from Second Select queryhow can i do this ?thanksALTER PROCEDURE dbo.magazalarliste @aktifmagaza varchar(5),@ilanturu varchar(18), @aktifilan varchar(5),@kategori varchar(23), @kategori1 varchar(48), @kategori2 varchar(55), @StartRowIndex INT, @NumRows INT*/ASbegin;WITH Listurunlistesi AS ( SELECT ROW_NUMBER() OVER (order by UserId desc) AS Row, UserIdFROM urunlistesiwhere ilanturu = @ilanturuand aktifilan = @aktifilanand kategori = @kategori and ((@kategori1 is null) or (kategori1 = @kategori1))and ((@kategori2 is null) or (kategori2 = @kategori2))group by UserId )SELECT * FROM Listurunlistesi WHERE Row between @StartRowIndex and @StartRowIndex+@NumRowsEND BEGIN ;WITH ListEntries AS ( SELECT ROW_NUMBER() OVER (ORDER BY amagazalar.[onsira], amagazalar.[magazanumarasi] desc) AS Row, amagazalar.magazanumarasi, amagazalar.UserId, amagazalar.madi, amagazalar.maciklama, amagazalar.resim1, amagazalar.urunsayisiFROM amagazalar inner join Listurunlistesi on amagazalar.UserId = Listurunlistesi.UserIdwhere aktifmagaza = @aktifmagaza )SELECT amagazalar.UserId, amagazalar.madi, amagazalar.maciklama, amagazalar.resim1, amagazalar.urunsayisiFROM ListEntries WHERE Row between @StartRowIndex and @StartRowIndex+@NumRowsEND RETURN |
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2009-02-25 : 12:07:43
|
quote: Originally posted by oguzkaygun hii have below stored procedure.. it works truely.. but my tableadapter of my dataset1.xsd cant accept it... it give me error that Listurunlistesi cant be found.. how can i fix it ? can u design my storedprocedure ? what should i do ?Also i see only UserId at gridview1 from first Select query.. but i should see amagazalar.UserId, amagazalar.madi, amagazalar.maciklama, amagazalar.resim1, amagazalar.urunsayisi at gridview1 from Second Select queryhow can i do this ?thanksALTER PROCEDURE dbo.magazalarliste @aktifmagaza varchar(5),@ilanturu varchar(18), @aktifilan varchar(5),@kategori varchar(23), @kategori1 varchar(48), @kategori2 varchar(55), @StartRowIndex INT, @NumRows INT*/ASbegin;WITH Listurunlistesi AS ( SELECT ROW_NUMBER() OVER (order by UserId desc) AS Row, UserIdFROM urunlistesiwhere ilanturu = @ilanturuand aktifilan = @aktifilanand kategori = @kategori and ((@kategori1 is null) or (kategori1 = @kategori1))and ((@kategori2 is null) or (kategori2 = @kategori2))group by UserId )SELECT * FROM Listurunlistesi WHERE Row between @StartRowIndex and @StartRowIndex+@NumRowsEND BEGIN ,WITH ListEntries AS ( SELECT ROW_NUMBER() OVER (ORDER BY amagazalar.[onsira], amagazalar.[magazanumarasi] desc) AS Row, amagazalar.magazanumarasi, amagazalar.UserId, amagazalar.madi, amagazalar.maciklama, amagazalar.resim1, amagazalar.urunsayisiFROM amagazalar inner join Listurunlistesi on amagazalar.UserId = Listurunlistesi.UserIdwhere aktifmagaza = @aktifmagaza )SELECT amagazalar.UserId, amagazalar.madi, amagazalar.maciklama, amagazalar.resim1, amagazalar.urunsayisiFROM ListEntries WHERE Row between @StartRowIndex and @StartRowIndex+@NumRowsEND RETURN
you need to remove intermeediate select as cte will be avialble only for first select statement after definition |
|
|
oguzkaygun
Yak Posting Veteran
53 Posts |
Posted - 2009-02-25 : 14:12:57
|
hiwhen i remove ur red lines, i have error message that incorrect syntax near ';'what should i do ? |
|
|
|
|
|
|
|