Query Question - Drawing A Blank On This One.

Nov 14, 2007

Hello everyone,

For whatever reason I can't figure out a query I need to write.

Let€™s say I have two tables, table 1 and 2. Table1 has columns A, B, and C with 10 rows.

I want to write a query that says: update table 2 where at least one value of column B in table 1 is not null.


How do i write this query?

Many thanks...

View 10 Replies


ADVERTISEMENT

Drawing Histogram/chart

May 8, 2008

I have a following code to "draw" a "histogram" :-)


use tempdb
go

declare @temp table
(id int identity(1,1)
,valuess int)

insert into @temp (valuess) values (64)
insert into @temp (valuess) values (12)
insert into @temp (valuess) values (23)
insert into @temp (valuess) values (45)
insert into @temp (valuess) values (30)


select
id
,valuess
,histogram = cast(replicate('*', valuess*0.4) as nvarchar(50))
,length = len(cast(replicate('*', valuess*0.4) as nvarchar(50)))
from @temp

order by valuess desc


Is there any better way to do it; maybe even a function?

Thanks :)

View 2 Replies View Related

Drawing Two Lines On The Same Graph

Jan 7, 2008

i wanna create two line types on the same graph. I'm using the following queries.






Code Block
select count(l.created) as LoanOriginationNumberPreApproved , convert(char( 11), l.Created) as PreApprovedDate
from LoanApplication l
where l.Status <> 'Cancelled'
Group by l.Created






and





Code Block
select count(l.SubmittedOn) as LoanOriginationNumber , convert(char( 11), l.SubmittedOn) as SubmittedDate
from LoanApplication l
where l.Status <> 'Cancelled'
Group by l.SubmittedOn




I combined these queries. I add clumns of the second query to select statement of first code. also added group by l.submittedon to group by l,created as group by l.created, l.submiited on. This is the problem.(I mean grouping)

But then SSRS does not allow me to put preaaproveddate and submitteddate to drop category filed?
Does anyone know how to do that?

View 2 Replies View Related

Drawing Polygon On Chart

Mar 17, 2008

I am working on a report which requires me to draw two polygons (rectangles) on a scatter chart to visually indicate "good" and "bad" ranges of plotted data. Is there a way to do this out-of-the-box?

Otherwise, if I must create a custom report item, how do I draw on the chart surface? I have looked at the following articles on Custom Report Items, but when I open the sample solutions I can't put the custom report items on the chart surface.

http://blogs.msdn.com/chrishays/default.aspx
http://msdn2.microsoft.com/en-us/magazine/cc188686.aspx

Do I have to create a custom report item which inherits from a chart control? If so, does anyone have any reference samples?

View 4 Replies View Related

Problem With System.drawing

May 9, 2007

Hi,



Our CLR stuff is running OK, as long as we do not touch the line:



using System.Drawing;



However, we do some image manipulation and then we get the error from SQL Server as



TITLE: Microsoft SQL Server Management Studio
------------------------------

Create failed for SqlAssembly 'ASP.IMAGE.CLR'. (Microsoft.SqlServer.Smo)

For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=9.00.3042.00&EvtSrc=Microsoft.SqlServer.Management.Smo.ExceptionTemplates.FailedOperationExceptionText&EvtID=Create+SqlAssembly&LinkId=20476

------------------------------
ADDITIONAL INFORMATION:

An exception occurred while executing a Transact-SQL statement or batch. (Microsoft.SqlServer.ConnectionInfo)

------------------------------

Assembly 'system.drawing, version=2.0.0.0, culture=neutral, publickeytoken=b03f5f7f11d50a3a.' was not found in the SQL catalog. (Microsoft SQL Server, Error: 6503)

For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=09.00.3042&EvtSrc=MSSQLServer&EvtID=6503&LinkId=20476

------------------------------
BUTTONS:

OK
------------------------------
.



Any help is highly appreciated.



Thanks,

Ning

View 2 Replies View Related

A Drawing Error Occurred When Exporting To PDF

May 19, 2006

Hello,

I have a report that I need to export to PDF, when I do so and re-open the report, I get a message stating "A Drawing Error Occurred".

Plus when I have a textbox with a large amount of data, it always kicks to a different page, instead of print what it can fit on the previous page and the rest on the next page.

Any help on this would greatly be appreciated.

Thanks in advance.

View 5 Replies View Related

Microsoft.ReportDesigner.Drawing.Language

May 17, 2007

I am getting the a big redX when attempting to open a report in VS.NET 2005, "Deserialization failed: The type initializer for "Microsoft.ReportDesigner.Drawing.Language" threw an exception". Has anyone else get this error? Would you please share your solution to me?


Thanks



View 2 Replies View Related

Help Needed Convert A Blank In Char To Blank In Float

Apr 29, 2008

Hi,

I receive blanks for a column called value and i need to represent it as a blank or NA into a colum whose datatype is float in the datawarehouse.

how is this possible because in current schenario a blank is being converted to 0
which is not the right thing.

i would like to retain the blank in conversion from char to float ,

please explain me if it can be done or how to overcome this issue.

Thanks

View 1 Replies View Related

SQL Query Blank Space

Oct 11, 2000

Hi:
I did the following query on SQL Server A and got the following result.
Input: select replace('10/10/00', '/', '')
Result: 101000
(1 row(s) affected)
However, I did the same query on SQL B and got a different result.
Input: select replace('10/10/00', '/', '')
Output: 10 10 00
(1 row(s) affected)

Both Servers are SQL 7.0 with SP2. I checked the setting, it seems to be identical. Does anyone know what could be the problem or have any hint what I need to check?
I beleieve the correct result should be the first result.

Thanks for any help.

View 3 Replies View Related

Select Query From A Stored Proc When The Values Can Be Blank.

Oct 10, 2006

Hi All,

I think what am trying to do is quite basic.

I have 3 paramaters@value1, @value2,@value3 being passed into a stored
proc and each of these parameters can be blank. If one of them is blank
and the rest of them have some valid values, then I should just exclude
the column check for the value that is blank.

For e.g if all my parameters being passed are non- empty then I would
do this
select * from tblName
where column1 like @value1 and column2 like @value2 and column3 like
@value3

else if I have one of the parameter being passed as empty, I should
ignore that parameter like
if@value1 is empty then my sql should be

select * from tblName
where column2 like @value2 and column3 like @value3

I don't want to do a dyanmic sql because of rights and security issue.
I want it through a stored procedure only.

Also, all the three columns can have null values in the table.
Please let me know what is the best possible way to do this. Thanks in
advance !.

.noscripthide
{display:none;}
.noscriptinline
{display:inline;}
.noscriptblock
{display:block;}

.scripthide
{display:none;}
.scriptinline
{display:inline;}
.scriptblock
{display:block;}

.script12hide
{display:none;}
.script12inline
{display:inline;}
.script12block
{display:block;}
.lnav
{position:absolute;}
.lnavch
{margin-left:23.0ex;}

.script13hide
{display:none;}
.script13inline
{display:inline;}
.script13block
{display:block;}

.hide
{display:none;}
.hide_ie
{;}
.hide_ie
{display:none;}
img
{border:0;}
img
{border-color:#0000a0;}
input.ck
{margin-left:-2px;}
input.bt, button.bt
{padding:0 .4em 0 .4em;width:auto;overflow:visible;}
input.bt, button.bt
{width:1px;}
.fixed_width
{font-family:fixed-width, monospace;font-size:90%;}
a:visited
{color:#551a8b;}
a:active
{color:#f00;}
.inheritcolor a
{color:inherit;}
.minmaxwie
{width:100%;}
* html .minmaxwie
{;}
.fl:visited
{color:#551a8b;}
.fl:active
{color:#f00;}
.fl:link
{color:#7777CC;}
.z
{display:none;}
.on:active
{color:#f00000;}
.don:active
{color:#f00000;}
.mbody
{margin-top:4px;}
body,td,input,textarea,select
{font-family:arial,sans-serif;}
body,td
{font-size:83%;}
input,textarea,select
{font-size:100%;}
form
{margin:0;}
.tick
{font-family:webdings;text-decoration:none !important;}
.qr
{width:100%;padding:4px;font-family:arial,sans-serif;}
.nu
{text-decoration:none;}
.gt
{border-collapse:collapse;}
.gt td
{padding:.3em 4px;border-right:1px solid #ffcc33;}
.gm td
{padding:.3em 1em .3em 0px;}
.bnk
{border:1px solid #ffcc33;}
.bnk td
{border-right-width:0px !important;}
.sel td.seltd
{padding:4px 4px 4px 4px;border:1px solid #ffcc33;border-right:none;font-weight:bold;}
p.b
{margin-bottom:1.5em;margin-top:.3em;}
.adb, .adbrnav
{border-left:1px solid #fff4c2;}
.msgdate
{color:#676767;}
.md
{color:#555555;}
.st
{margin-left:-1px;}
.nb
{white-space:nowrap;}
.np
{padding:0px;}
.p
{font-weight:bold;}
.mo
{margin:.5em 0 0 0;}
.oa
{padding:2px .5em;}
.sbox
{margin-top:1em;margin-bottom:1em;}
button a:link
{text-decoration:none;color:black;}
button a:hover
{text-decoration:none;color:black;}
.b
{font-weight:bold;}
.fontsize0
{font-size:78%;}
.fontsize1
{font-size:87%;}
.fontsize2
{font-size:96%;}
.fontsize_25
{font-size:100%;}
.fontsize3
{font-size:108%;}
.fontsize4
{font-size:120%;}
.fontsize5
{font-size:133%;}
.fontsize6
{font-size:150%;}
.fontsize7
{font-size:150%;}
.cv
{width:100%;}
.lk
{color:#0000CC;text-decoration:underline;cursor:pointer;}
.nl
{padding:5px 0 2px 5px;}
.tsh
{border-top:1px solid #ffcc33;}
.tlsh
{border-top:1px solid #ffcc33;}
.blsh
{border-bottom:1px solid #ffcc33;}
.bsh
{border-bottom:1px solid #ffcc33;}
.lsh, .tlsh, .blsh
{border-left:1px solid #ffcc33;}
.lnav
{left:9px;width:23.0ex;overflow:hidden;}
.lnavch
{;}
.lnavi
{font-size:100%;}
.lnavim
{margin-left:-2px;}
* html .lnav
{left:11px;}
.alertboxout
{margin:5px 15px 0px 10px;clear:left;}
.alertboxin
{clear:left;color:black;background-color:#fad163;font-weight:bold;text-align:center;padding:0px 15px 0px 15px;position:relative;margin:-1px 0px;}
.ctl
{padding-left:2px;}
.mb
{padding:6px 8px 0 5px;}
.exh
{margin:0 0 0 5px;background-color:#e8e8e8;}
.exh div div
{padding-top:4px;}
.thread_star
{padding:0 0 4px 2px;}
* html .thread_star
{padding:0 0 0 2px;}
.blurb_star
{padding:0 0 0 2px;}
* html .blurb_star
{padding:2px 0 0 2px;}

View 7 Replies View Related

SQL Server 2012 :: Query Tuning With Each Run Of Fresh / Blank CACHE

Jun 4, 2015

I am using SQL Server 2012 Express.

I am doing performance tuning of SP/Query in Dev-Test environment.

I found that SQL Server caches plan between successive executions.

So if I test/execute SP 10 times, after 1st or 2nd execution, SQL server will pull-up plan-info from CACHE...Not from SQL SERVER Or Database...

Means i am not getting correct answer...

I found this 2 commands:

DBCC FREEPROCCACHE

DBCC DROPCLEANBUFFERS

But they say that executing above command might interfere/bother other people executing other query/sp on this server.

They also say that: Freeing the plan cache causes, for example, a stored procedure to be recompiled instead of reused from the cache. This can cause a sudden, temporary decrease in query performance.

Part of query was using Dynamic-SQL executed with EXEC command.

I replaced that with SP_EXECUTESQL.

How can I start testing of each SP-run with Fresh/Blank CACHE ?

View 1 Replies View Related

Deserialization Failed: The Type Initializer For 'Microsoft.ReportDesigner.Drawing.RptStyleConstValue' Threw An Exception

Sep 26, 2006

I have VS2003 and VS2005 installed as well as SQL Server 2000 and SQL Server 2005 Tools. I have RS2000 and RS2005 installed. RS2000 works fine in VS2003. When using VS2005 and opening a Microsoft sample project for 2005, I get the error listed in the subject line.

When trying to create a new project and connecting to an Oracle database or a SQL Server 2005 database, I get the following error: "A connection cannot be made to the database. Set and check the connection string." The connection works fine when the test button is clicked, but fails when continuing in the wizard.

Any suggestions. We are trying to migrate from RS2000 to RS2005 and nothing in 2005 works.

View 6 Replies View Related

Set Default To Blank

Apr 6, 2005

I am writing a two step process where the record is created and half of the fields are populated. The second step will populate the remaining fields. Between steps they will run queries against the table and the empty fields are <NULL>.When the field is <NULL> it won't return data on "WHERE Field LIKE '%'". I could just pass "" as data to the remaining fields however since MS SQL allows you to set a default value on a field. Is it possible to set the default value to a blank instead of <NULL>. This would help keep my code a little more streamline.
Or is there an easy way to write a fuzzy search that will include <NULL> fields.
Thanks

View 6 Replies View Related

Blank Record

Feb 16, 2007

Hello,

How do I get a record that has no specific data? I got an error using this

rs.Open "SELECT id, letter, consonant FROM alphabet where letter= "" order by id",conn,1,3

View 5 Replies View Related

How To Display Blank?

May 4, 2004

Hello, everyone:

By default, SQL Server display "NULL" if there is no data value. How to display blank instead of "NULL"? Thanks a lot.

ZYT

View 3 Replies View Related

How To Check Zero Against Blank

Oct 31, 2013

This below code is saying 0 is equal to space .How can I avoid this situation.It is saying 'a is blank' but i have assigned var @a as a 0.

DECLARE @a int =0
IF @a =''
BEGIN
SELECT 'a is blank'
END
ELSE
SELECT 'a is not blank'

View 4 Replies View Related

Allow Blank On Table

Jan 31, 2007

Hello:

I'm having a problem with my database. I have a users table where the username and password fields are set to Not Allow Null values, but, when somebody signs up to the site they can put a blank value ' ' and register. That is not Null, how can I set up the server so that it can not accept blank values like that?

Thanks

VB DOTNET

View 1 Replies View Related

Blank Pages

Apr 19, 2007

Hello all,

I have developed a report that when displayed in page layout view is giving me blank pages with only heaer & footer information even though none of my groups have page breaks designated. This also occurs when exported to PDF.

Can anyone provide some information on why this is occurring and how to remedy it ?

Thanks.

View 1 Replies View Related

Variable Tab Gone Blank???

May 17, 2007

I've been getting a messagebox with the error: "Microsoft Visual studio for applications has lost the link to" -->correct, it doesn't say to what? I also noticed all my variables are no longer showing on the variable tab. I have a number of package level variables. The System variables have disappeared also???

View 1 Replies View Related

Blank Pages In Pdf

Apr 1, 2008



when I open report on report service it consist two pages, it's correct

but if I export report to pdf file I get two additional blank pages

it looks like - first correct page with data - blank page with header - second correct page with data -blank page with header


why I get two blank pages with data ?

View 7 Replies View Related

IE 7 And Document Map Is Blank

Jan 19, 2007

All,


I have a report with a document map and when I run the report through
IE 7.0, the Document Map is blank. Running that same report through IE
6.0 and it is fine.


Both instances are run against the same server via Report Viewer so
there is no difference other than the client IE version.


Anyone know of a work around for this?


Thanks,
Sherry

View 1 Replies View Related

Blank Space

Feb 25, 2008

Is this a known issue - blank spaces caused by KeepTogether property being implicity set for Lists/Subreports/Rectangles in Reporting Services? If so, will there be a fix soon?

View 5 Replies View Related

Page In Blank

Nov 21, 2007


Good Morning friends. I am using MS SQL Server Reporting Services version 9.00.2047.00 and I have a problem and i would like your help:

I have one report (Cuadro de Mando) and 4 subreports (subquadro, subquadro2, subquadro3, subquadro4):

Note: Nome of the subreports above, have a page break after showing the records and neither the report. The subreports are perfectly designed in the main report (Cuadro de Mando).

There is no space free between the desgin of the 4 subreports.

Each subreport are designed in only one page. I tested each one of the subreports individually and the preview of each is ok in olnly one page.

But when i test the report (€śCuadro de Mando€?) with contains the 4 subreports, one page in blank always appears between the previous page and the next page of the 4 subreports.

What can we do to solve this problem?

Thank you very much.

View 4 Replies View Related

How To Recreate A Blank Copy Of Dbs

Apr 16, 2007

I want to create a clean copy of my DB now that it is done. So it can be moved to another Server. It has some sample data in some tables that I would like to keep and some in other table that I don't. How can I do this?

View 1 Replies View Related

Blank Dialog Box When Starting SQL

May 18, 2006

When I start SQL Server Management Studio (Sql 2005), a blank dialog box pops up with nothing in it.  The title in the dialog box is "Microsoft SQL Server Management Studio" and it has a yellow triangle with an explanation point in it but there is no message just an OK button.  I have to click the OK button to continue on to connect to the Sql databases.  It does this everytime I open it.  Anyone else getting this and how can I get rid of it? 

View 2 Replies View Related

EM Blank Status Icon

May 8, 2001

Why would some of my servers that I have registered not show a green arrow (or any connection status for that matter). It's just a blank white circle. Is there some sort of connection error happening between me and the server?

It's sort of annoying to click on these servers and have the error "SQL Server xxxx is not known to be running. Are you sure you wish to connect?" Any way to get around that?

Thanks..

View 1 Replies View Related

A Blank In Char Column

Jun 2, 2000

Hi All,

I put a blank or ‘0’ in one of column of a text file and then I used BCP to load this file to a table of SQL server 6.5. The field in SQL server table is char type with size 1. After I run this process, all rows with this column received ‘0’ and no blank or null at a black value place. Could you please help me to fix this problem and make some of rows in the column get a blank or null value.


TIA.

Stella Liu

View 1 Replies View Related

Insert As NULL Not 0 Or Blank

Oct 18, 2007

Does anyone know the trick when inserting an empty variable into a MSSQL table for it to show as null and not a blank or a zero?
It is a php variable.
Thanks

View 3 Replies View Related

Logic For A Blank Value Help Needed

Mar 28, 2007

here's my stored proc and i will tell you what I'm trying to do. I'm passing in a form value. It should handle anything. But it doesn't....
I have tried:
="",
='',
<>"",
<>'',
isNull,
IS NULL,
IS NOT NULL and now the isNumeric() function. Can anyone help me please?!?!

CREATE PROCEDURE dbo.spUpdateProductSpecialPostage

@ProductID as int,
@ScaleID as int


AS

DECLARE @ROWCOUNT as int
select @ROWCOUNT = count(*) from tPostageProduct where productid=@ProductID

if @ROWCOUNT > 0
if isNumeric(@ScaleID) <> 1
delete from tPostageProduct where productid=@ProductID
else
update tPostageProduct set scaleID = @scaleID where productid=@ProductID


else
if isNumeric(@ScaleID) = 1
INSERT INTO tPostageProduct (productId,scaleID) VALUES (@ProductID,@ScaleID)
GO


Cheers.

View 1 Replies View Related

BCP Blank Header Line

Jul 10, 2007

I am using BCP to export the contents of a view into a text file. Everything is running jsut ifne, except the resulting file has a blank first line. Is there a way to preven this?

BCP statement is as follows:

bcp "select pospay from son_db.dbo.vw_pos_pay order by account desc, code asc" queryout D:eliteUSbankPositivePay_Currentx340.d150364i. d100.txt -T -c

Thanks in advance for any help!

View 4 Replies View Related

How To Delete A Row From Table Where Name Is Blank

Mar 20, 2012

select
CASE
when Name != ' '
Then 'N'
Else delete from table where Name=' '
End

from table

I am trying to delete a row from table where name is blank.

View 5 Replies View Related

Creating A Blank Table From Another

Feb 17, 2004

Hi again,

I want to create a blank table with the same column names as another but with no rows i.e. it is empty. Does anyone know how to do the last part?

I have so far

create table newtest as select * from shared.test ..... (empty bit here?)

Any good advanced sql tutorial urls would be good to.

Thanks in advance :)

View 12 Replies View Related

NULL Valvue Vs BLANK Value

Jun 3, 2008

so far, i'd read a lot of books and search from internet, i still don't very understand the difference between of NULL and balnk value.
can anybody help to explain on it?

View 6 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved