Showing posts with label view. Show all posts
Showing posts with label view. Show all posts

Friday, March 30, 2012

problem with srever 2005 and Oracle

I am creating report model witch have connection to Oracle database. I was
created the connection and data source view, but then I want to create
Report model with wizard I am geting the error: ORA-02179: valid options:
ISOLATION LEVEL {SERIAZABLE | READ COMMITTED}.
how to change isolation level to valid oracle connection isolation level.It is my understanding that the model part of RS in 2005 is not yet
compatible with Oracle. I am tied to find where I read that on technet
but I can't. Maybe someone else can elaborate.
Thanks!|||Work-around for Report Builder:
1. Create linked server connection to Oracle database using the
OraOLEDB.Oracle provider(more up-to-date than Microsoft's).
2. Create a Data Source using the native SQL provider to the SQL Server
where you created in step 1.
3. Create a data source view; do not select objects.
4. Right-click in the DSV designer pane and create a New Named Query. Build
your query against the linked server (i.e. use 4-part names: select * from
linkedservername..schema.object). Repeat step 4 for each object you wish to
add to your model.
5. Add logical keys where applicable.
6. Build your model.
7. Deploy & build reports using Report Builder :-)
X

Wednesday, March 21, 2012

Problem with simple SQL


I want to view all companyname that starts with A, the sql runs but does not show the output,
What's wrong with the query?, am I missing any quotes or comma. Pls 'elp
Dim myCharacter = "A"
SQL = "SELECTlogo, EmployerID, CompanyName FROM EmployerDetails wherecompanyName like '"&myCharacter & "%'"



Select seems correct! How you are using this in ASP.NET page? Are you getting data into Reader or not?|||Thanks Sreed
I think the problem is the SQL because when I hard code to this
SQL = "SELECT logo, EmployerID, CompanyName FROM EmployerDetails where companyName like 'A%' "
It works, PLS help Thanks
|||

If you declared myCharacter,SQL as a local string variable, then it should work!

Just to debug after SQL = "..blabla" statement do,

Response.Write(SQL)
Response.End()
and run the page and see what is the output you are getting from SQL, and see if that is giving correct Select or not!

That should help us to find whether it building currect SQL or not!

|||Hi Sreed
This is the full code below , I did the PRINT STUFF and the output is also below
Sub BindDataToGrid(myCharacter)
Response.write("Testing "&myCharacter)
Dim Conn, Conn1 as SqlConnection
Dim mySqlCommand, mySqlCommand2 as SqlCommand
Dim SQL,SQL1,SQL2 ,GetQuestions As String
Dim myDate as date
Dim pic as ArrayList = new ArrayList()
Dim Job_no as Integer

IF myCharacter <> "" THEN
SQL ="SELECT logo, EmployerID, CompanyName FROM EmployerDetails where companyName like "
SQL = SQL & " ' " & myCharacter & " % ' "
Else
SQL ="SELECT logo, EmployerID FROM EmployerDetails order by newID() "
End If
Conn = New SqlConnection(ConfigurationSettings.AppSettings("connString"))
Dim resultsDataSet as New DataSet()
Dim myDataAdapter as SqlDataAdapter = New SqlDataAdapter(SQL, Conn)

Conn.Open()
myDataAdapter.Fill(resultsDataSet,"EmployerDetails")
mySqlCommand = New SqlCommand(SQL, Conn)
mySqlCommand.ExecuteNonQuery()

Dim myReader As SqlDataReader = mysqlCommand.ExecuteReader()
Dim content
While myReader.Read()
If not (myReader("Logo") is DBNull.Value) Then
If Len(myReader("Logo")) > 0 Then
Dim LOGO = myReader("Logo")
Dim EmployerID =myReader("EmployerID")
Content = "<br><ahref='/JBoard/EmployerJobs.aspx?EMPID="&EmployerID
Content = Content & " '><img src='/JBoard/CompLogo/"&Logo
Content = Content & " ' width='124' height='50'BORDER='1'></a>"
pic.Add(Content)
End If
End If
End While

LogoGrid.DataSource = pic
LogoGrid.DataBind()
Conn.Close()
End Sub

OUTPUT IS
SELECT logo, EmployerID, CompanyName FROM EmployerDetails where companyName like 'M % '
What is wrong with this tiny code, forum help me pls.


|||

SQL = "SELECT logo, EmployerID, CompanyName FROM EmployerDetails where companyName like "
SQL = SQL &" ' " & myCharacter &" % ' "

This looks like you have extra spaces in there. If you copied and pasted this directly from your code, you're actually querying for anything that starts with a space and then an 'A' and then has a space and then any character and then a space. Drop the spaces in theRED code above and it should work.

|||Hi PD
How do you drop the space, that's why I thought ?

|||Use your keyboard's Delete key to remove the extra spaces around thesingle quote and percentage characters. (A total of 4 spacesshould be deleted.)
That should leave you with the following statement:
SQL = "SELECT logo, EmployerID, CompanyName FROM EmployerDetails where companyName like "
SQL = SQL &"'" & myCharacter &"%' "
|||

tmorton wrote:

Use your keyboard's Delete key to remove the extra spaces


In a recent technical journal, it suggested that the Backspace key canalso be used to remove characters. I haven't tried it myself, as I fearthat I'm not advanced enough. But obinna123 seems pretty advanced, sohe may want to try that technique to removed the extra spaces.

Problem with setting up IIS - You are not authorized to view this page

I am trying to set up IIS on our server (Windows 2003 with SQL Server 2000) and when I try to run a query in a browser I keep getting the following messsage:-
You are not authorized to view this page
I have followed the tutorial (XMLStartup.doc) which was placed in C:\Program Files\Microsoft SQL Server\80\Tools\DevTools\Samples\xml\XMLStartup on installation, but still get the above message when I get to the point of querying the database.
Is there something I am doing wrong or is there some security measure I have not taken into account yet that is preventing me from runing queries?
any help appreciated - Thanks
The problem is probably not in SQL Server but in NTFS and IIS permissions. The IUSR_<server name> user or your local account user (if you are surfing from the server) must have NTFS permissions to read the page you are trying to access, both in IIS and NTFS. Check the NTFS security first and disable "simple file sharing" in WinExplorer if it's by any chance turned on and set the propper permissions on the files you are trying to access.

Friday, March 9, 2012

Problem with report viewer

Hi,

I recently upgraded by ASP.Net 1.1 application to 2.0. 1.1 application was using awReportViewer to view the reports.

But, when upgraded, awreportViewer doesnt display the RS2005 enhancements like sorting, etc...so I decided to replace it with Report Viewer control in VS2005.

Now the problem starts, Whenever I try accesing the reports through application, it gives me error "Client found response content type of '', but expected 'text/xml'.
The request failed with an empty response."

This is how I have coded,

ReportViewer1.ProcessingMode = ProcessingMode.Remote

ReportViewer1.ServerReport.ReportServerUrl = New Uri(http://localhost/ReportServer/reportservice.asmx)

ReportViewer1.ServerReport.ReportPath = reportname

//Some code to set parameters in Report Paramater "parameters"

ReportViewer1.ServerReport.SetParameters(parameters)

My questions:

1. Am I going wrong somewhere in the above code?

2. Can awReportViewer be modified / upgraded so that it can support RS2005 features like sorting, multivalued parameters?

TIA

Tanmaya

Change the ReportServerUrl to be 'http://localhost/reportserver' and you should be in business.|||Great...its working now...thanks a ton :)

Problem with replication of view which depend on other view in merge replication

Hi There,
I am trying to replicate the sql server 2000 db with merge and pull
subscription.
When i try to initialize the ini. snapshot, the error message is
generated saying
"the schema script "JobPriceLookupQueryNew.sch" could not be
propagated to the subscriber". This view depend on
JobPriceLookupQuery.
I try to read in this group and get one post suggesting to run
sp_refreshview for the view but i am getting error message for this
also.
exec sp_refreshview [@.JobPriceLookupQuery =] 'JobPriceLookupQuery'
error "incorrect syntax near 'JobPriceLookupQuery'
2nd try:
exec sp_refreshview JobPriceLookupQuery
Invalid object name 'JobPriceLookupQuery;
exec sp_refreshview [@.JobPriceLookupQuery =]
Invalid object name 'JobPriceLookupQuery
I have many view with depend on other view, and its not working now.
could i please get some information how can I solve this problem.
Thanks in advance.
Indra.
Indra,
exec sp_refreshview JobPriceLookupQuery should work, as long as you are in the correct database.
Running sp_depends will show you that the values in sysdepends are incorrect, and need updating.
What you need to do is (manually) work out the order of dependencies of views, and refresh them from the bottom up. Then you'll be able to let replication create the snapshot in the right order.
HTH,
Paul Ibison

Monday, February 20, 2012

Problem with Parallel Query Execution

I have a SQL 7 db with a union query (view), and I'm getting the error, "The
query processor could not start the necessary thread resources for parallel
query execution." This union query has been in place for about two years now
with no problems until just now, though I haven't changed anything. Also, I
have a local copy of the database on my machine, and the query runs fine.
As noted, I haven't changed anything in the query, nor in the SQL settings.
There is a network administrator, so it's possible that he may have changed
a setting, but I don't know what. The query is reproduced below. Any ideas
as to what's going on would be appreciated.
Neil
Main query:
SELECT Tmp.INVCUST, Tmp.SDNBR, Tmp.SDBOOK, Tmp.SDIVCLN,
Tmp.SDPAID, Tmp.SDPRICE, Tmp.SDCOPIES, Tmp.Location,
INVTRY.AUTHILL1, Tmp.INVDATE, INVTRY.SaleSrc,
INVTRY.HoldInit
FROM (SELECT INVDATE, INVCUST, SDNBR, SDBOOK, SDIVCLN,
SDPAID, SDPRICE, SDCOPIES, 'P' AS Location
FROM vwInvoiceDet
UNION ALL
SELECT INVDATE, INVCUST, SDNBR, SDBOOK, SDIVCLN,
SDPAID, SDPRICE, SDCOPIES, 'N' AS Location
FROM vwInvoiceDetN
UNION ALL
SELECT INVDATE, INVCUST, SDNBR, SDBOOK, SDIVCLN,
SDPAID, SDPRICE, SDCOPIES, 'M' AS Location
FROM vwInvoiceDetM) Tmp INNER JOIN
dbo.INVTRY ON Tmp.SDBOOK = dbo.INVTRY.[Index]
vwInvoiceDet:
SELECT tabInvoice.INVDATE, tabInvoice.INVCUST,
SALEDET.SDNBR, SALEDET.SDBOOK, SALEDET.SDINVNUM,
SALEDET.SDPRICE, SALEDET.SDPAID, SALEDET.SDCOPIES,
SALEDET.SDIVCLN, tabInvoice.INVNBR, SALEDET.SDID
FROM dbo.tabInvoice INNER JOIN
dbo.SALEDET ON
dbo.tabInvoice.INVNBR = dbo.SALEDET.SDNBR
(vwInvoiceDetN and vwInvoiceDetM are similar to vwInvoiceDet.)SQL makes a parallel query plan at optimization time. When you tried to run
the query, maybe not all of the processors were available OR there were not
enough threads available ... Perhaps setting MAXDOP to 2 or 3 might help..
This can be done on Enterprise manager, right click your server and go to
the Properties item.. (MAX Degree of Parallelism.)
HTH,
Vinod Kumar
MCSE, DBA, MCAD, MCSD
http://www.extremeexperts.com
Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techin.../2000/books.asp
"Neil Ginsberg" <nrg@.nrgconsult.com> wrote in message
news:0DXNd.2806$UX3.1660@.newsread3.news.pas.earthlink.net...
> I have a SQL 7 db with a union query (view), and I'm getting the error,
"The
> query processor could not start the necessary thread resources for
parallel
> query execution." This union query has been in place for about two years
now
> with no problems until just now, though I haven't changed anything. Also,
I
> have a local copy of the database on my machine, and the query runs fine.
> As noted, I haven't changed anything in the query, nor in the SQL
settings.
> There is a network administrator, so it's possible that he may have
changed
> a setting, but I don't know what. The query is reproduced below. Any ideas
> as to what's going on would be appreciated.
> Neil
> Main query:
> SELECT Tmp.INVCUST, Tmp.SDNBR, Tmp.SDBOOK, Tmp.SDIVCLN,
> Tmp.SDPAID, Tmp.SDPRICE, Tmp.SDCOPIES, Tmp.Location,
> INVTRY.AUTHILL1, Tmp.INVDATE, INVTRY.SaleSrc,
> INVTRY.HoldInit
> FROM (SELECT INVDATE, INVCUST, SDNBR, SDBOOK, SDIVCLN,
> SDPAID, SDPRICE, SDCOPIES, 'P' AS Location
> FROM vwInvoiceDet
> UNION ALL
> SELECT INVDATE, INVCUST, SDNBR, SDBOOK, SDIVCLN,
> SDPAID, SDPRICE, SDCOPIES, 'N' AS Location
> FROM vwInvoiceDetN
> UNION ALL
> SELECT INVDATE, INVCUST, SDNBR, SDBOOK, SDIVCLN,
> SDPAID, SDPRICE, SDCOPIES, 'M' AS Location
> FROM vwInvoiceDetM) Tmp INNER JOIN
> dbo.INVTRY ON Tmp.SDBOOK = dbo.INVTRY.[Index]
> vwInvoiceDet:
> SELECT tabInvoice.INVDATE, tabInvoice.INVCUST,
> SALEDET.SDNBR, SALEDET.SDBOOK, SALEDET.SDINVNUM,
> SALEDET.SDPRICE, SALEDET.SDPAID, SALEDET.SDCOPIES,
> SALEDET.SDIVCLN, tabInvoice.INVNBR, SALEDET.SDID
> FROM dbo.tabInvoice INNER JOIN
> dbo.SALEDET ON
> dbo.tabInvoice.INVNBR = dbo.SALEDET.SDNBR
> (vwInvoiceDetN and vwInvoiceDetM are similar to vwInvoiceDet.)
>|||I tried it just now, after hours, with no one on the system, and the results
were the same.
In any case, I think I resolved it. I stopped the SQL Server and then
restarted it, and the problem cleared up. So I don't know what was going on,
but stopping and restarting definitely cleared up whatever it was.
Thanks,
Neil
"Vinod Kumar" <vinodk_sct@.NO_SPAM_hotmail.com> wrote in message
news:cu9h7q$lkv$1@.news01.intel.com...
> SQL makes a parallel query plan at optimization time. When you tried to
> run
> the query, maybe not all of the processors were available OR there were
> not
> enough threads available ... Perhaps setting MAXDOP to 2 or 3 might help..
> This can be done on Enterprise manager, right click your server and go to
> the Properties item.. (MAX Degree of Parallelism.)
> --
> HTH,
> Vinod Kumar
> MCSE, DBA, MCAD, MCSD
> http://www.extremeexperts.com
> Books Online for SQL Server SP3 at
> http://www.microsoft.com/sql/techin.../2000/books.asp
> "Neil Ginsberg" <nrg@.nrgconsult.com> wrote in message
> news:0DXNd.2806$UX3.1660@.newsread3.news.pas.earthlink.net...
> "The
> parallel
> now
> I
> settings.
> changed
>

Problem with Parallel Query Execution

I have a SQL 7 db with a union query (view), and I'm getting the error, "The
query processor could not start the necessary thread resources for parallel
query execution." This union query has been in place for about two years now
with no problems until just now, though I haven't changed anything. Also, I
have a local copy of the database on my machine, and the query runs fine.

As noted, I haven't changed anything in the query, nor in the SQL settings.
There is a network administrator, so it's possible that he may have changed
a setting, but I don't know what. The query is reproduced below. Any ideas
as to what's going on would be appreciated.

Neil

Main query:
SELECT Tmp.INVCUST, Tmp.SDNBR, Tmp.SDBOOK, Tmp.SDIVCLN,
Tmp.SDPAID, Tmp.SDPRICE, Tmp.SDCOPIES, Tmp.Location,
INVTRY.AUTHILL1, Tmp.INVDATE, INVTRY.SaleSrc,
INVTRY.HoldInit
FROM (SELECT INVDATE, INVCUST, SDNBR, SDBOOK, SDIVCLN,
SDPAID, SDPRICE, SDCOPIES, 'P' AS Location
FROM vwInvoiceDet
UNION ALL
SELECT INVDATE, INVCUST, SDNBR, SDBOOK, SDIVCLN,
SDPAID, SDPRICE, SDCOPIES, 'N' AS Location
FROM vwInvoiceDetN
UNION ALL
SELECT INVDATE, INVCUST, SDNBR, SDBOOK, SDIVCLN,
SDPAID, SDPRICE, SDCOPIES, 'M' AS Location
FROM vwInvoiceDetM) Tmp INNER JOIN
dbo.INVTRY ON Tmp.SDBOOK = dbo.INVTRY.[Index]

vwInvoiceDet:
SELECT tabInvoice.INVDATE, tabInvoice.INVCUST,
SALEDET.SDNBR, SALEDET.SDBOOK, SALEDET.SDINVNUM,
SALEDET.SDPRICE, SALEDET.SDPAID, SALEDET.SDCOPIES,
SALEDET.SDIVCLN, tabInvoice.INVNBR, SALEDET.SDID
FROM dbo.tabInvoice INNER JOIN
dbo.SALEDET ON
dbo.tabInvoice.INVNBR = dbo.SALEDET.SDNBR

(vwInvoiceDetN and vwInvoiceDetM are similar to vwInvoiceDet.)SQL makes a parallel query plan at optimization time. When you tried to run
the query, maybe not all of the processors were available OR there were not
enough threads available ... Perhaps setting MAXDOP to 2 or 3 might help..
This can be done on Enterprise manager, right click your server and go to
the Properties item.. (MAX Degree of Parallelism.)

--
HTH,
Vinod Kumar
MCSE, DBA, MCAD, MCSD
http://www.extremeexperts.com

Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techin.../2000/books.asp

"Neil Ginsberg" <nrg@.nrgconsult.com> wrote in message
news:0DXNd.2806$UX3.1660@.newsread3.news.pas.earthl ink.net...
> I have a SQL 7 db with a union query (view), and I'm getting the error,
"The
> query processor could not start the necessary thread resources for
parallel
> query execution." This union query has been in place for about two years
now
> with no problems until just now, though I haven't changed anything. Also,
I
> have a local copy of the database on my machine, and the query runs fine.
> As noted, I haven't changed anything in the query, nor in the SQL
settings.
> There is a network administrator, so it's possible that he may have
changed
> a setting, but I don't know what. The query is reproduced below. Any ideas
> as to what's going on would be appreciated.
> Neil
> Main query:
> SELECT Tmp.INVCUST, Tmp.SDNBR, Tmp.SDBOOK, Tmp.SDIVCLN,
> Tmp.SDPAID, Tmp.SDPRICE, Tmp.SDCOPIES, Tmp.Location,
> INVTRY.AUTHILL1, Tmp.INVDATE, INVTRY.SaleSrc,
> INVTRY.HoldInit
> FROM (SELECT INVDATE, INVCUST, SDNBR, SDBOOK, SDIVCLN,
> SDPAID, SDPRICE, SDCOPIES, 'P' AS Location
> FROM vwInvoiceDet
> UNION ALL
> SELECT INVDATE, INVCUST, SDNBR, SDBOOK, SDIVCLN,
> SDPAID, SDPRICE, SDCOPIES, 'N' AS Location
> FROM vwInvoiceDetN
> UNION ALL
> SELECT INVDATE, INVCUST, SDNBR, SDBOOK, SDIVCLN,
> SDPAID, SDPRICE, SDCOPIES, 'M' AS Location
> FROM vwInvoiceDetM) Tmp INNER JOIN
> dbo.INVTRY ON Tmp.SDBOOK = dbo.INVTRY.[Index]
> vwInvoiceDet:
> SELECT tabInvoice.INVDATE, tabInvoice.INVCUST,
> SALEDET.SDNBR, SALEDET.SDBOOK, SALEDET.SDINVNUM,
> SALEDET.SDPRICE, SALEDET.SDPAID, SALEDET.SDCOPIES,
> SALEDET.SDIVCLN, tabInvoice.INVNBR, SALEDET.SDID
> FROM dbo.tabInvoice INNER JOIN
> dbo.SALEDET ON
> dbo.tabInvoice.INVNBR = dbo.SALEDET.SDNBR
> (vwInvoiceDetN and vwInvoiceDetM are similar to vwInvoiceDet.)|||I tried it just now, after hours, with no one on the system, and the results
were the same.

In any case, I think I resolved it. I stopped the SQL Server and then
restarted it, and the problem cleared up. So I don't know what was going on,
but stopping and restarting definitely cleared up whatever it was.

Thanks,

Neil

"Vinod Kumar" <vinodk_sct@.NO_SPAM_hotmail.com> wrote in message
news:cu9h7q$lkv$1@.news01.intel.com...
> SQL makes a parallel query plan at optimization time. When you tried to
> run
> the query, maybe not all of the processors were available OR there were
> not
> enough threads available ... Perhaps setting MAXDOP to 2 or 3 might help..
> This can be done on Enterprise manager, right click your server and go to
> the Properties item.. (MAX Degree of Parallelism.)
> --
> HTH,
> Vinod Kumar
> MCSE, DBA, MCAD, MCSD
> http://www.extremeexperts.com
> Books Online for SQL Server SP3 at
> http://www.microsoft.com/sql/techin.../2000/books.asp
> "Neil Ginsberg" <nrg@.nrgconsult.com> wrote in message
> news:0DXNd.2806$UX3.1660@.newsread3.news.pas.earthl ink.net...
>> I have a SQL 7 db with a union query (view), and I'm getting the error,
> "The
>> query processor could not start the necessary thread resources for
> parallel
>> query execution." This union query has been in place for about two years
> now
>> with no problems until just now, though I haven't changed anything. Also,
> I
>> have a local copy of the database on my machine, and the query runs fine.
>>
>> As noted, I haven't changed anything in the query, nor in the SQL
> settings.
>> There is a network administrator, so it's possible that he may have
> changed
>> a setting, but I don't know what. The query is reproduced below. Any
>> ideas
>> as to what's going on would be appreciated.
>>
>> Neil
>>
>> Main query:
>> SELECT Tmp.INVCUST, Tmp.SDNBR, Tmp.SDBOOK, Tmp.SDIVCLN,
>> Tmp.SDPAID, Tmp.SDPRICE, Tmp.SDCOPIES, Tmp.Location,
>> INVTRY.AUTHILL1, Tmp.INVDATE, INVTRY.SaleSrc,
>> INVTRY.HoldInit
>> FROM (SELECT INVDATE, INVCUST, SDNBR, SDBOOK, SDIVCLN,
>> SDPAID, SDPRICE, SDCOPIES, 'P' AS Location
>> FROM vwInvoiceDet
>> UNION ALL
>> SELECT INVDATE, INVCUST, SDNBR, SDBOOK, SDIVCLN,
>> SDPAID, SDPRICE, SDCOPIES, 'N' AS Location
>> FROM vwInvoiceDetN
>> UNION ALL
>> SELECT INVDATE, INVCUST, SDNBR, SDBOOK, SDIVCLN,
>> SDPAID, SDPRICE, SDCOPIES, 'M' AS Location
>> FROM vwInvoiceDetM) Tmp INNER JOIN
>> dbo.INVTRY ON Tmp.SDBOOK = dbo.INVTRY.[Index]
>>
>> vwInvoiceDet:
>> SELECT tabInvoice.INVDATE, tabInvoice.INVCUST,
>> SALEDET.SDNBR, SALEDET.SDBOOK, SALEDET.SDINVNUM,
>> SALEDET.SDPRICE, SALEDET.SDPAID, SALEDET.SDCOPIES,
>> SALEDET.SDIVCLN, tabInvoice.INVNBR, SALEDET.SDID
>> FROM dbo.tabInvoice INNER JOIN
>> dbo.SALEDET ON
>> dbo.tabInvoice.INVNBR = dbo.SALEDET.SDNBR
>>
>> (vwInvoiceDetN and vwInvoiceDetM are similar to vwInvoiceDet.)
>>
>>