Showing posts with label basic. Show all posts
Showing posts with label basic. Show all posts

Friday, March 23, 2012

paramater problem

is there any solution to use null values to the parameter
my sql commandtext=
"select * from info where name=@.name and surname=@.surname"
in visual basic .net
info table data=
name surname
_______ _______________
1 null
2 null
i execute my program and use this commandtext
but i cant find any solution because of the null values
what can i do at visual basic .net or at sql server to solve this
bafidi wrote:
> is there any solution to use null values to the parameter
> my sql commandtext=
> "select * from info where name=@.name and surname=@.surname"
> in visual basic .net
> info table data=
> name surname
> _______ _______________
> 1 null
> 2 null
> i execute my program and use this commandtext
> but i cant find any solution because of the null values
> what can i do at visual basic .net or at sql server to solve this
Use can use a LIKE clause instead. Always add a '%' to the end of the
parameter value and never use a NULL. You should also explicitly define
all columns you require rather than using SELECT *.
Select
Col1,
Col2
From
dbo.Info
Where
name LIKE @.Name
and
surname LIKE @.surname
I might consider using a clustered index on the surname and a
non-clustered index on name. That way, you are covered in all cases.
David Gugick
Quest Software
www.imceda.com
www.quest.com
|||Use a WHERE clause, no?
SELECT * FROM tblInfo
where vchName = @.name AND vchSurName = @.surname
AND @.name IS NOT NULL
AND @.surname IS NOT NULL
Is that okay for U?
"David Gugick" <david.gugick-nospam@.quest.com> wrote in message
news:ekLjiO2wFHA.2880@.TK2MSFTNGP12.phx.gbl...
> bafidi wrote:
> Use can use a LIKE clause instead. Always add a '%' to the end of the
> parameter value and never use a NULL. You should also explicitly define
> all columns you require rather than using SELECT *.
> Select
> Col1,
> Col2
> From
> dbo.Info
> Where
> name LIKE @.Name
> and
> surname LIKE @.surname
> I might consider using a clustered index on the surname and a
> non-clustered index on name. That way, you are covered in all cases.
>
> --
> David Gugick
> Quest Software
> www.imceda.com
> www.quest.com
|||John Smith wrote:
> Use a WHERE clause, no?
> SELECT * FROM tblInfo
> where vchName = @.name AND vchSurName = @.surname
> AND @.name IS NOT NULL
> AND @.surname IS NOT NULL
> Is that okay for U?
Why do you need the IS NOT NULL? Nothing is equal to NULL, so you're not
going to ever get NULL values back. And what happened to the query I
posted with the LIKE clauses?
Maybe you could explain your requirements in more detail. Do you need to
be able to search for NULL values? If so, you need to use WHERE COLNAME
IS NULL syntax. If you don't need NULL values and need to search on
wildcards, then look at the example I posted.
David Gugick
Quest Software
www.imceda.com
www.quest.com

Tuesday, March 20, 2012

Paragraph Options

I have solved my code problem but I cannot get it to linefeed
I am using basic syntax. Here is what I have

formula = ""
if {Dealer_Alert_Query.DEALER CONSUMER LETTER} = true then
formula = formula + "Paragraph 1" + "Paragraph 4"
end if
if {Dealer_Alert_Query.Design} = true then
formula = formula + "Paragraph 2" + chr(10) + "Paragraph 5"
end if
if {Dealer_Alert_Query.DlrComplaint} = yes then
formula = formula + "Paragraph 3" + "Paragraph 6"
end if

It will print everything it should up until it encounters the chr(10). I have also tried chr(13) and I have tried & instead of +.

What am I doing wrong?Do you mean that you can only see everything up until the chr(10) or chr(13)?
Maybe your field doesn't have the 'Can Grow' option ticked. Look for it in the format options of the field, I can't remember which tab it's on.

Friday, March 9, 2012

Paging File size

I hope these are pretty basic SQL Server management questions. I'm running a SP that uses a lot of memory. The server has about 8GB and it uses 7.95GB. When the memory usage goes up, so does the size of the paging file. I'm assuming the page file grows so it can write the memory contents to disk in the case of a crash. How necessary is this? It seems like any advantage I'd gain from working out of memory is lost because I'm working off the drive too.

Can I/should I turn this "feature" off?

Thanks!

Brian

Paging file is used to swap files quickly in and out of RAM. The system can't possibly keep everything in RAM that it ever needs. So it swaps in use files back and forth between RAM and the pagefile as needed. It's a secondary backup to RAM, sort of.

The paging file is growing because if SQL Server is using 7.95 GB of RAM of 8 available, there's not enough RAM left for the operating system to function, and it is forced to rely on the paging file for its normal operations.

A general rule of thumb for a SQL Server is that the paging file should be at least double the amount of RAM. So if you have 8 GB of RAM, the paging file should be 16 GB ... a preferably on a different disk than any of the SQL files. Set the paging file to a hard size, don't let Windows manage your paging file.

If your server has 4 or more GB of RAM, you should reserve at least 1 GB of RAM for the OS. You do this by setting the maximum amount of memory that SQL Server can use to the total amount - 1 GB. So for 8GB of RAM, set SQL to use a maximum of 7 GB.

If 7.95 GB of RAM are being used though not necessarily by SQL Server, the OS may be forcing SQL Server to give up memory and forcing it to page. Make sure that SQL Server has been granted "Lock pages in memory" rights in the group policy editor.

|||

Robert,

The thing that bothers me is the files grow simultaneously. They both start out below 1GB and both grow at approximately the same rate. That is why I wondered if Windows was preparing for a memory dump by keeping an "Image" of memory in case of a crash. I haven't used this setting since XP, but assume it's still around in 2003. Although I think it's disabled by default.

Whatever the case, I'll assume that the behavior is normal for now. I have implemented a couple of your suggestions.

Thanks for the help.

Brian

Monday, February 20, 2012

page setup on crystal report 8.5

dear babu,
i want to ask you a question on crystal report 8.5.
i'm using crystal report viewer from visual basic 6.0 to view reports but i'm found problems to setup page margin until this time. can you help me for a while ??

how to view page setup on my crystal report viewer so end user have flexibility to customize the margin ??

thanks for your help.

emmileI think you cannot do that at run time
You need to design it in Design time

Page reloaded automatically and rapidly

Hi,

I'm new to the reporting service. I followed the tutorial from the online book and created the basic report. After I deployed the report and opened it in the browser, it kept reloading the page automatically. Seems to me the page is reloaded at least 5 times per second. I turned off the Autorefresh for the report. It still behaves the same. That causes the CPU of my computer runs on 100% constantly. Can anyone help me to solve the problem?

Thanks,

Jia

Jia,

One way to get a report to refresh is the 'Autorefresh' property (Report Properties, General Tab, Autorefresh checkbox). You've already verified that that checkbox is unchecked (this is a design time property).

A report can also be refreshed based on the Report Server's caching property. To change this setting, you can use the Report Manager. Make sure that you've got the following radio buttons selected and no others (available when you deploy to the report manager, run the report, select the Properties tab, and the Execution page):

Always run this report with the most recent data|||

Hi Tnx1m,

I did as what you said. Unfortunately they didn't work.

After the first page is loaded, the page starts to *flash*. I use SQL Profiler to check on the backend. There is no query sent to the database. It looks like the page is in an infinite loop to be refreshed but not sending any commands to the database. Any idea why it is like that?

Thanks,

Jia

|||

Hi Hia,

seems like you are running IE 7 Beta 3 :-) Look here for more information about this: http://sqlserver2005.de/SQLServer2005/MyBlog/tabid/56/EntryID/10/Default.aspx

HTH, Jens Suessmeyer.

http://www.sqlserver2005.de

|||

Hi Jen,

That's exactly where the problem comes from. Thanks so much!

Jia