Showing posts with label particular. Show all posts
Showing posts with label particular. Show all posts

Tuesday, March 27, 2012

Default Folder for Deploying Projects

I have a real (hopefully) easy question...
I'm wanting to deploy a Reporting Services project to a particular folder on
my virtual server. For example, whenever you deploy a project it goes
straight to the home directory and creates the MODELS and DATA SOURCES
folders.
I would like to deploy my project to a folder I created called REPORTING
COMPONENTS.
Is this possible?
Thanks in advance for any help!!!Right mouse click, properties on the project. It brings up a property page
where you specify what you want it called on the server.
Bruce Loehle-Conger
MVP SQL Server Reporting Services
"A. Robinson" <ARobinson@.discussions.microsoft.com> wrote in message
news:1D246E5F-00EA-48CA-BC29-B6A661F0DD31@.microsoft.com...
>I have a real (hopefully) easy question...
> I'm wanting to deploy a Reporting Services project to a particular folder
> on
> my virtual server. For example, whenever you deploy a project it goes
> straight to the home directory and creates the MODELS and DATA SOURCES
> folders.
> I would like to deploy my project to a folder I created called REPORTING
> COMPONENTS.
> Is this possible?
> Thanks in advance for any help!!!|||I've tried that in the past and when I do I get the following error when
specifying any directory besides the default.
Here's where I want them to go:
http://10.90.160.13/ReportServerTest/Reporting Components:
Here's the error:
Client found response content type of '', but expected 'text/xml'.
The request failed with an empty response.
(Microsoft.ReportingServices.SemanticQueryDesign)
--
Program Location:
at
Microsoft.SqlServer.ReportingServices2005.RSConnection.GetSecureMethods()
at
Microsoft.SqlServer.ReportingServices2005.RSConnection.IsSecureMethod(String
methodname)
at
Microsoft.SqlServer.ReportingServices2005.RSConnection.GetItemType(String
Item)
at
Microsoft.ReportingServices.ModelDesigner.Project.ReportServiceClient.GetItemType(String item)
at
Microsoft.ReportingServices.ModelDesigner.Project.ReportServiceClient.CheckAuthorized()
at
Microsoft.ReportingServices.ModelDesigner.Project.ModelClientManager.GetCredentials(String url)
at
Microsoft.ReportingServices.ModelDesigner.Project.ModelProjectDeployer.PrepareDeploy()
"Bruce L-C [MVP]" wrote:
> Right mouse click, properties on the project. It brings up a property page
> where you specify what you want it called on the server.
>
> --
> Bruce Loehle-Conger
> MVP SQL Server Reporting Services
> "A. Robinson" <ARobinson@.discussions.microsoft.com> wrote in message
> news:1D246E5F-00EA-48CA-BC29-B6A661F0DD31@.microsoft.com...
> >I have a real (hopefully) easy question...
> >
> > I'm wanting to deploy a Reporting Services project to a particular folder
> > on
> > my virtual server. For example, whenever you deploy a project it goes
> > straight to the home directory and creates the MODELS and DATA SOURCES
> > folders.
> >
> > I would like to deploy my project to a folder I created called REPORTING
> > COMPONENTS.
> >
> > Is this possible?
> >
> > Thanks in advance for any help!!!
>
>|||Is ReportServerTest the name of you reportserver directory? Usually this
would look like http://10.90.160.13/ReportServer/Reporting Components
RS creates two websites: ReportServer and Reports. Reports is the portal.
ReportServer is the asp.net application. Did you not install in the default
area?
You can specify the final directory, you cannot specify anything but
ReportServer (or whatever RS website is called).
Bruce Loehle-Conger
MVP SQL Server Reporting Services
"A. Robinson" <ARobinson@.discussions.microsoft.com> wrote in message
news:50DD68B4-C241-4068-B176-BB1D302862B6@.microsoft.com...
> I've tried that in the past and when I do I get the following error when
> specifying any directory besides the default.
> Here's where I want them to go:
> http://10.90.160.13/ReportServerTest/Reporting Components:
> Here's the error:
> Client found response content type of '', but expected 'text/xml'.
> The request failed with an empty response.
> (Microsoft.ReportingServices.SemanticQueryDesign)
> --
> Program Location:
> at
> Microsoft.SqlServer.ReportingServices2005.RSConnection.GetSecureMethods()
> at
> Microsoft.SqlServer.ReportingServices2005.RSConnection.IsSecureMethod(String
> methodname)
> at
> Microsoft.SqlServer.ReportingServices2005.RSConnection.GetItemType(String
> Item)
> at
> Microsoft.ReportingServices.ModelDesigner.Project.ReportServiceClient.GetItemType(String
> item)
> at
> Microsoft.ReportingServices.ModelDesigner.Project.ReportServiceClient.CheckAuthorized()
> at
> Microsoft.ReportingServices.ModelDesigner.Project.ModelClientManager.GetCredentials(String
> url)
> at
> Microsoft.ReportingServices.ModelDesigner.Project.ModelProjectDeployer.PrepareDeploy()
>
> "Bruce L-C [MVP]" wrote:
>> Right mouse click, properties on the project. It brings up a property
>> page
>> where you specify what you want it called on the server.
>>
>> --
>> Bruce Loehle-Conger
>> MVP SQL Server Reporting Services
>> "A. Robinson" <ARobinson@.discussions.microsoft.com> wrote in message
>> news:1D246E5F-00EA-48CA-BC29-B6A661F0DD31@.microsoft.com...
>> >I have a real (hopefully) easy question...
>> >
>> > I'm wanting to deploy a Reporting Services project to a particular
>> > folder
>> > on
>> > my virtual server. For example, whenever you deploy a project it goes
>> > straight to the home directory and creates the MODELS and DATA SOURCES
>> > folders.
>> >
>> > I would like to deploy my project to a folder I created called
>> > REPORTING
>> > COMPONENTS.
>> >
>> > Is this possible?
>> >
>> > Thanks in advance for any help!!!
>>|||I eventually figured it out... :-)
There are three properties: target folderr for models, data sources, and
URL. I was modifying the URL...no no no!!!
I modified the target folders and everything is peachy...
Thanks for your help Bruce...!
"Bruce L-C [MVP]" wrote:
> Right mouse click, properties on the project. It brings up a property page
> where you specify what you want it called on the server.
>
> --
> Bruce Loehle-Conger
> MVP SQL Server Reporting Services
> "A. Robinson" <ARobinson@.discussions.microsoft.com> wrote in message
> news:1D246E5F-00EA-48CA-BC29-B6A661F0DD31@.microsoft.com...
> >I have a real (hopefully) easy question...
> >
> > I'm wanting to deploy a Reporting Services project to a particular folder
> > on
> > my virtual server. For example, whenever you deploy a project it goes
> > straight to the home directory and creates the MODELS and DATA SOURCES
> > folders.
> >
> > I would like to deploy my project to a folder I created called REPORTING
> > COMPONENTS.
> >
> > Is this possible?
> >
> > Thanks in advance for any help!!!
>
>

Sunday, March 25, 2012

default database

Hi all,
I want to delete a particular database 'r3risk', But when I delete it, I
have problems when connecting via sqlmanager. It gives me an error about the
default database, which is set at 'r3risk', which I've deleted. I've had to
restore and reatach in order to connect via sql manager.
Where and how can I change what the default database is. SQL manager options
in the database properties is greyed out.
Thanks
RobertEasiest is to use sp_defaultdb.
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
Blog: http://solidqualitylearning.com/blogs/tibor/
"Robert Bravery" <me@.u.com> wrote in message news:eKg6bNWPGHA.2696@.TK2MSFTNGP14.phx.gbl...[
color=darkred]
> Hi all,
> I want to delete a particular database 'r3risk', But when I delete it, I
> have problems when connecting via sqlmanager. It gives me an error about t
he
> default database, which is set at 'r3risk', which I've deleted. I've had t
o
> restore and reatach in order to connect via sql manager.
> Where and how can I change what the default database is. SQL manager optio
ns
> in the database properties is greyed out.
> Thanks
> Robert
>[/color]

Thursday, March 22, 2012

DEFAULT constraint not working

I have a 32 column table. Every column is NOT NULL, and all but the first have DEFAULT constraints. In particular, the 21st column has such a constraint. I also have a stored proc which truncates the table and then loads it with a SELECT from a view, like this

TRUNCATE TABLE NDRS_Call_Data_Table

INSERT INTO NDRS_Call_Data_Table(<column-list>)
SELECT <column-list> FROM NDRS_Call_Data_View

The view is a complex join of several other tables. When I run the proc, I get the error:

"Cannot insert the value NULL into column 'CC_Time', table 'Tomcat_prod.dbo.NDRS_Call_Data_Table'; column does not allow nulls. INSERT fails."

BUT, if I simply do this from Query Analyzer.....

INSERT INTO NDRS_Calls_Data_Table(data_indicator)
VALUES('Z')

it works. The default constraint on the CC_Time column works correctly and supplies the default value of '0 ' as it should. (the column is a CHAR(2) column, despite the name suggesting it is datetime)

Recompiling the view and the stored procedure does not help. Anybody else seen this? Is this a known bug?You constraint works fine. I believe the null value comes from the view. As you said, the view was created from a complex join. Somewhere in the resultset it returns a null value in the view. I would run the query and check the resultset closely.|||Got it. Misunderstanding on the operation of DEFAULT constraints. They don't override explicit nulls if you specify the column in the insert. They only provide values if you leave out the column in the column list. Thanks|||Hi,

Just for my understanding.

Is column "CC_Time" included in <column-list> in your insert statement or not ?

If not, do you have any "after insert" triggers on table "Call_Data_Table" ?

CVM.|||Originally posted by cvandemaele
Hi,

Just for my understanding.

Is column "CC_Time" included in <column-list> in your insert statement or not ?

If not, do you have any "after insert" triggers on table "Call_Data_Table" ?

CVM.

Well, forget about this last post. Just getting a cup of coffee and WHAM problem solved.|||Further research shows that this is ANSI standard behavior. A NOT NULL column with a DEFAULT will not use the default if the column is specified in the insert's column list and NULL is provided. Besides being counter-intuitive, frankly this strikes me as dumb. It really gets in the way of using the INSERT ... SELECT syntax|||To solve the problems of nulls in your view, you can use isnull(a, b) where a is the selected column and b is the default value for that column.

example:

select isnull (title, 'No title') as title, au_lname
from authors a left join titleauthor ta on a.au_id = ta.au_id left join titles t on t.title_id = ta.title_id|||True.

Undortunately, when using INSERT ... SELECT you can't say
SELECT ..., ISNULL(column, DEFAULT), ...

the way you can use the DEFAULT keyword like this...

INSERT
VALUES (x,y,z,DEFAULT,p,q,r)

You have to know what the default value is, and explicitly put it in as the 2nd parameter of the ISNULL function. So if you ever change the default constraint, you'll have to go back and change all the canned queries, too.|||you can declare a variable for each column that you want default to be inserted in place of null, and then initialize them according to each variable data type:

declare @.value int
select @.value = cast(replace(replace(m.text, ')', ''), '(', '') as int)
from syscomments m,syscolumns c,sysobjects o
where c.id=object_id('dbo.your_table')
and c.name=('your_column_name')
and o.type='d'
and m.id=c.cdefault
and m.id=o.id

Monday, March 19, 2012

Decreased performance from using blobs

I'm trying to store files such as pdfs in my SQL Server as blobs for a particular .NET application and I'm noticing a rather large performance hit when compared to if the pdf was simply stored in the web server's file system.

I have a pdf of 7MB. If this is on a web server it takes roughly 9 seconds to download. When I store the same pdf in my database and then write it onto the page using the code below it takes roughly 40 seconds to display. Can anyone help me to improve this performance difference? Should I not be using this method to store large files?

Dim PdfCol As Integer = 0 ' the column # of the BLOB field
Dim dr As SqlDataReader = cmd.ExecuteReader()

If dr.Read() Then
Dim mypdf(dr.GetBytes(PdfCol, 0, Nothing, 0, Integer.MaxValue) - 1) As Byte
dr.GetBytes(PdfCol, 0, mypdf, 0, mypdf.Length)
End If

Response.Clear()
Response.Buffer = True
Response.ClearContent()
Response.ClearHeaders()
Response.ContentType = "application/pdf"
Response.BinaryWrite(mypdf)
Response.Flush()
Response.Close()* Turn off output cache, so that the first data can be sent immediatly.
* Do NOT load the whole thing into memory and send it out. Instead grab little chunks and thend them. Start with 8k, then take like 64k a trip.
Currently you only start sending data once the hole 7mb are loaded from the database, and this is ridiculously inefficient.|||By output cache, do you mean the output in the Page/UC directive?
Also, could you show me an example of grabbing chunks and sending them out? I'm not real experienced with using bytes.

I tried the following but I get a dialogue window that says "The file is damaged and can not be repaired."

If dr.Read() Then
Dim intBufferSize As Integer = 64000
Dim longStartIndex As Long = 0
Dim longRetVal As Long
Dim b(intBufferSize) As Byte

'Read through the first chunk of the document
longRetVal = dr.GetBytes(PdfCol, 0, b, 0, intBufferSize)

'Reset the start index.
longStartIndex = 0

Response.Clear()
Response.Buffer = True
Response.ClearContent()
Response.ClearHeaders()
Response.ContentType = "application/pdf"

'Continue reading and writing while there are bytes beyond the size of the buffer.
While longRetVal = intBufferSize
Response.BinaryWrite(b)
Response.Flush()

'Reposition the start index to the end of the last buffer and fill the buffer.
longStartIndex += intBufferSize
longRetVal = dr.GetBytes(PdfCol, longStartIndex, b, 0, intBufferSize)
End While

'Write the remaining buffer.
Response.BinaryWrite(b)
Response.Flush()
Response.Close()
End If|||Ok, I've managed to write my blob in chunks to a specified path on my hard drive using the code from: http://support.microsoft.com/default.aspx?kbid=317043
But whenever I try to use a Response.BinaryWrite so that the pdf is loaded onto the web page with ContentType set to "application/pdf" or "application/octet-stream" I get the same error that the file is damaged and cannot be repaired.|||Thona you are awesome! I forgot to mention that earlier :)

I did finally get this to work. Apparently if my buffer size is too large the file gets corrupted. I set my buffer size to 24000 and everything seems to work ok, but if the buffer size is 29000 then the file gets corrupted. Anyone know why this is? Can bytes only be a certain size?