Showing posts with label app. Show all posts
Showing posts with label app. Show all posts

Sunday, March 25, 2012

clean server cache

Hi,
I am testing .net app. I restored sql server databases with overwrite the
original database.
I re-launch the .net app, I got this error says. Could not connect to the
database DBID = 15...
After I reboot the sql server, I was able to connect again,.
My question is that how do I fix (clean the cache) without rebooting the
server.
thnaks
Hi
I am not sure how this could happen, if you restored the database nothing
should have been connected, and subsequent connections should have connected
ok, providing permissions were in place. Does your .NET application have
connections to other databases? Did you check nothing was connected while you
did the restore?
John
"mecn" wrote:

> Hi,
> I am testing .net app. I restored sql server databases with overwrite the
> original database.
> I re-launch the .net app, I got this error says. Could not connect to the
> database DBID = 15...
> After I reboot the sql server, I was able to connect again,.
> My question is that how do I fix (clean the cache) without rebooting the
> server.
> thnaks
>
>
|||It's very rare, first time for us.
..net application tries to connect dbid = 15 which is the previous db that I
restored with overwrite.
I don't know why the .net application still looking for the old db. not the
db name taht specified in connection string.
After re-boot server(Sql server and iis server in one), everything is ok.
Thanks
"John Bell" <jbellnewsposts@.hotmail.com> wrote in message
news:73E30669-7FFD-41BB-BE63-C565B0B083E4@.microsoft.com...[vbcol=seagreen]
> Hi
> I am not sure how this could happen, if you restored the database nothing
> should have been connected, and subsequent connections should have
> connected
> ok, providing permissions were in place. Does your .NET application have
> connections to other databases? Did you check nothing was connected while
> you
> did the restore?
> John
> "mecn" wrote:
|||Sorry forgot to mention it. Yes The application is connecting to
multi-databaseses.
Is this the problems?
Thanks
"John Bell" <jbellnewsposts@.hotmail.com> wrote in message
news:73E30669-7FFD-41BB-BE63-C565B0B083E4@.microsoft.com...[vbcol=seagreen]
> Hi
> I am not sure how this could happen, if you restored the database nothing
> should have been connected, and subsequent connections should have
> connected
> ok, providing permissions were in place. Does your .NET application have
> connections to other databases? Did you check nothing was connected while
> you
> did the restore?
> John
> "mecn" wrote:
|||Hi
I think it could possibly be the cause of the problem, do they remain
connected to the other database while you are restoring? If so try setting
these other databases to single user (and killing the connections) while the
restore is in progress.
John
"mecn" wrote:

> Sorry forgot to mention it. Yes The application is connecting to
> multi-databaseses.
> Is this the problems?
> Thanks
>
> "John Bell" <jbellnewsposts@.hotmail.com> wrote in message
> news:73E30669-7FFD-41BB-BE63-C565B0B083E4@.microsoft.com...
>
>

clean server cache

Hi,
I am testing .net app. I restored sql server databases with overwrite the
original database.
I re-launch the .net app, I got this error says. Could not connect to the
database DBID = 15...
After I reboot the sql server, I was able to connect again,.
My question is that how do I fix (clean the cache) without rebooting the
server.
thnaksHi
I am not sure how this could happen, if you restored the database nothing
should have been connected, and subsequent connections should have connected
ok, providing permissions were in place. Does your .NET application have
connections to other databases? Did you check nothing was connected while yo
u
did the restore?
John
"mecn" wrote:

> Hi,
> I am testing .net app. I restored sql server databases with overwrite the
> original database.
> I re-launch the .net app, I got this error says. Could not connect to the
> database DBID = 15...
> After I reboot the sql server, I was able to connect again,.
> My question is that how do I fix (clean the cache) without rebooting the
> server.
> thnaks
>
>|||It's very rare, first time for us.
.net application tries to connect dbid = 15 which is the previous db that I
restored with overwrite.
I don't know why the .net application still looking for the old db. not the
db name taht specified in connection string.
After re-boot server(Sql server and iis server in one), everything is ok.
Thanks
"John Bell" <jbellnewsposts@.hotmail.com> wrote in message
news:73E30669-7FFD-41BB-BE63-C565B0B083E4@.microsoft.com...[vbcol=seagreen]
> Hi
> I am not sure how this could happen, if you restored the database nothing
> should have been connected, and subsequent connections should have
> connected
> ok, providing permissions were in place. Does your .NET application have
> connections to other databases? Did you check nothing was connected while
> you
> did the restore?
> John
> "mecn" wrote:
>|||Sorry forgot to mention it. Yes The application is connecting to
multi-databaseses.
Is this the problems?
Thanks
"John Bell" <jbellnewsposts@.hotmail.com> wrote in message
news:73E30669-7FFD-41BB-BE63-C565B0B083E4@.microsoft.com...[vbcol=seagreen]
> Hi
> I am not sure how this could happen, if you restored the database nothing
> should have been connected, and subsequent connections should have
> connected
> ok, providing permissions were in place. Does your .NET application have
> connections to other databases? Did you check nothing was connected while
> you
> did the restore?
> John
> "mecn" wrote:
>|||Hi
I think it could possibly be the cause of the problem, do they remain
connected to the other database while you are restoring? If so try setting
these other databases to single user (and killing the connections) while the
restore is in progress.
John
"mecn" wrote:

> Sorry forgot to mention it. Yes The application is connecting to
> multi-databaseses.
> Is this the problems?
> Thanks
>
> "John Bell" <jbellnewsposts@.hotmail.com> wrote in message
> news:73E30669-7FFD-41BB-BE63-C565B0B083E4@.microsoft.com...
>
>

clean server cache

Hi,
I am testing .net app. I restored sql server databases with overwrite the
original database.
I re-launch the .net app, I got this error says. Could not connect to the
database DBID = 15...
After I reboot the sql server, I was able to connect again,.
My question is that how do I fix (clean the cache) without rebooting the
server.
thnaksHi
I am not sure how this could happen, if you restored the database nothing
should have been connected, and subsequent connections should have connected
ok, providing permissions were in place. Does your .NET application have
connections to other databases? Did you check nothing was connected while you
did the restore?
John
"mecn" wrote:
> Hi,
> I am testing .net app. I restored sql server databases with overwrite the
> original database.
> I re-launch the .net app, I got this error says. Could not connect to the
> database DBID = 15...
> After I reboot the sql server, I was able to connect again,.
> My question is that how do I fix (clean the cache) without rebooting the
> server.
> thnaks
>
>|||It's very rare, first time for us.
.net application tries to connect dbid = 15 which is the previous db that I
restored with overwrite.
I don't know why the .net application still looking for the old db. not the
db name taht specified in connection string.
After re-boot server(Sql server and iis server in one), everything is ok.
Thanks
"John Bell" <jbellnewsposts@.hotmail.com> wrote in message
news:73E30669-7FFD-41BB-BE63-C565B0B083E4@.microsoft.com...
> Hi
> I am not sure how this could happen, if you restored the database nothing
> should have been connected, and subsequent connections should have
> connected
> ok, providing permissions were in place. Does your .NET application have
> connections to other databases? Did you check nothing was connected while
> you
> did the restore?
> John
> "mecn" wrote:
>> Hi,
>> I am testing .net app. I restored sql server databases with overwrite the
>> original database.
>> I re-launch the .net app, I got this error says. Could not connect to the
>> database DBID = 15...
>> After I reboot the sql server, I was able to connect again,.
>> My question is that how do I fix (clean the cache) without rebooting the
>> server.
>> thnaks
>>|||Sorry forgot to mention it. Yes The application is connecting to
multi-databaseses.
Is this the problems?
Thanks
"John Bell" <jbellnewsposts@.hotmail.com> wrote in message
news:73E30669-7FFD-41BB-BE63-C565B0B083E4@.microsoft.com...
> Hi
> I am not sure how this could happen, if you restored the database nothing
> should have been connected, and subsequent connections should have
> connected
> ok, providing permissions were in place. Does your .NET application have
> connections to other databases? Did you check nothing was connected while
> you
> did the restore?
> John
> "mecn" wrote:
>> Hi,
>> I am testing .net app. I restored sql server databases with overwrite the
>> original database.
>> I re-launch the .net app, I got this error says. Could not connect to the
>> database DBID = 15...
>> After I reboot the sql server, I was able to connect again,.
>> My question is that how do I fix (clean the cache) without rebooting the
>> server.
>> thnaks
>>|||Hi
I think it could possibly be the cause of the problem, do they remain
connected to the other database while you are restoring? If so try setting
these other databases to single user (and killing the connections) while the
restore is in progress.
John
"mecn" wrote:
> Sorry forgot to mention it. Yes The application is connecting to
> multi-databaseses.
> Is this the problems?
> Thanks
>
> "John Bell" <jbellnewsposts@.hotmail.com> wrote in message
> news:73E30669-7FFD-41BB-BE63-C565B0B083E4@.microsoft.com...
> > Hi
> >
> > I am not sure how this could happen, if you restored the database nothing
> > should have been connected, and subsequent connections should have
> > connected
> > ok, providing permissions were in place. Does your .NET application have
> > connections to other databases? Did you check nothing was connected while
> > you
> > did the restore?
> >
> > John
> >
> > "mecn" wrote:
> >
> >> Hi,
> >> I am testing .net app. I restored sql server databases with overwrite the
> >> original database.
> >> I re-launch the .net app, I got this error says. Could not connect to the
> >> database DBID = 15...
> >>
> >> After I reboot the sql server, I was able to connect again,.
> >>
> >> My question is that how do I fix (clean the cache) without rebooting the
> >> server.
> >>
> >> thnaks
> >>
> >>
> >>
>
>

Monday, March 19, 2012

choosing the right datatype

It was hard to tell if this was the correct forum, but here goes:
My browser-driven Intranet App has 3 fields where users can type in a very
long description. It has a size of 5000, and is a varchar. People will
typically type in alphanumeric characters in it. (For the web-savvy, the
users types into a Textarea).
A co-worker tells me I should change the datatype from varchar to text. I
had it at varchar specifically because I understood that varchar will only
take up what disc space that it needs to. I asked him for an explanation of
why to go to text. He replied:
"There is an 8k limitation on a row when you use standard datatypes. You
have 3 columns with 5000 characters which pretty much doubles the amount of
allowed storage in a row. I'm surprised you haven't run into any problems.
Text datatypes are stored separately and allow up to 2GB."
Is this correct? Under my described scenario, which would be best?I would stick with Varchar. Varchar can hold up to 8,000 characters.
You're not storing more than 8,000 characters, so I don't see the point of
switching to a Text field. Also, if you use a text field, unless you
specify that you're storing the data "in row", it will only store a pointer
to the separate page or pages to access your string. You also can't
directly reference a text column in a WHERE clause. Unless you're storing
unusually large amount of characters (defined as 8,001+ characters) per row
in this column there's no real point to going with text.
"middletree" <middletree@.htomail.com> wrote in message
news:eDwvTxXKFHA.2688@.TK2MSFTNGP15.phx.gbl...
> It was hard to tell if this was the correct forum, but here goes:
> My browser-driven Intranet App has 3 fields where users can type in a very
> long description. It has a size of 5000, and is a varchar. People will
> typically type in alphanumeric characters in it. (For the web-savvy, the
> users types into a Textarea).
> A co-worker tells me I should change the datatype from varchar to text. I
> had it at varchar specifically because I understood that varchar will only
> take up what disc space that it needs to. I asked him for an explanation
> of
> why to go to text. He replied:
> "There is an 8k limitation on a row when you use standard datatypes. You
> have 3 columns with 5000 characters which pretty much doubles the amount
> of
> allowed storage in a row. I'm surprised you haven't run into any
> problems.
> Text datatypes are stored separately and allow up to 2GB."
> Is this correct? Under my described scenario, which would be best?
>|||He is right, but the limit for a row is 8060 and not 8k.
Example:
use northwind
go
create table t (
colA varchar(8000),
colB varchar(8000),
colC varchar(8000)
)
go
insert into t values(replicate('a', 8000), replicate('b', 8000),
replicate('c', 8000))
go
drop table t
go
Result:
Server: Msg 511, Level 16, State 1, Line 2
Cannot create a row of size 24015 which is greater than the allowable
maximum of 8060.
The statement has been terminated.
AMB
"middletree" wrote:

> It was hard to tell if this was the correct forum, but here goes:
> My browser-driven Intranet App has 3 fields where users can type in a very
> long description. It has a size of 5000, and is a varchar. People will
> typically type in alphanumeric characters in it. (For the web-savvy, the
> users types into a Textarea).
> A co-worker tells me I should change the datatype from varchar to text. I
> had it at varchar specifically because I understood that varchar will only
> take up what disc space that it needs to. I asked him for an explanation o
f
> why to go to text. He replied:
> "There is an 8k limitation on a row when you use standard datatypes. You
> have 3 columns with 5000 characters which pretty much doubles the amount o
f
> allowed storage in a row. I'm surprised you haven't run into any problems
.
> Text datatypes are stored separately and allow up to 2GB."
> Is this correct? Under my described scenario, which would be best?
>
>|||It is, generally, correct. However, there are perfomance and usage penaltie
s
for using Text datatype, that make it worthwhile t oavoid them if possible..
.
What are the three fields used for? An Alternative which MAY be worth
investigating, is putting these three fields in another table...
Assuming your existing Table has a PK called PKID,
Create Table Comments
(PKID Integer Not Null
WhichField TinyInt Not Null,
Description VarChar(5000),
CONSTRAINT Comment_PK PRIMARY KEY (PKId, WhichField)
)
-- (The WHichField column identifies which one of the web page's Description
fields this is for... 1,2, or 3)
"middletree" wrote:

> It was hard to tell if this was the correct forum, but here goes:
> My browser-driven Intranet App has 3 fields where users can type in a very
> long description. It has a size of 5000, and is a varchar. People will
> typically type in alphanumeric characters in it. (For the web-savvy, the
> users types into a Textarea).
> A co-worker tells me I should change the datatype from varchar to text. I
> had it at varchar specifically because I understood that varchar will only
> take up what disc space that it needs to. I asked him for an explanation o
f
> why to go to text. He replied:
> "There is an 8k limitation on a row when you use standard datatypes. You
> have 3 columns with 5000 characters which pretty much doubles the amount o
f
> allowed storage in a row. I'm surprised you haven't run into any problems
.
> Text datatypes are stored separately and allow up to 2GB."
> Is this correct? Under my described scenario, which would be best?
>
>|||Hey, 'tree. If it matters, "text" columns can be a pain to deal with in DW,
depending on what you're trying to do of course. The default recordset
options don't always work, you've got to watch your field order, etc.
I know it's not strictly database relevant, but I know you use DW, so it
might be relevant for you.
"middletree" <middletree@.htomail.com> wrote in message
news:eDwvTxXKFHA.2688@.TK2MSFTNGP15.phx.gbl...
> It was hard to tell if this was the correct forum, but here goes:
> My browser-driven Intranet App has 3 fields where users can type in a very
> long description. It has a size of 5000, and is a varchar. People will
> typically type in alphanumeric characters in it. (For the web-savvy, the
> users types into a Textarea).
> A co-worker tells me I should change the datatype from varchar to text. I
> had it at varchar specifically because I understood that varchar will only
> take up what disc space that it needs to. I asked him for an explanation
of
> why to go to text. He replied:
> "There is an 8k limitation on a row when you use standard datatypes. You
> have 3 columns with 5000 characters which pretty much doubles the amount
of
> allowed storage in a row. I'm surprised you haven't run into any
problems.
> Text datatypes are stored separately and allow up to 2GB."
> Is this correct? Under my described scenario, which would be best?
>|||Actually, I own DW, but tend to hand-code about 95% of my stuff. I hang out
at the DW forum to ask and answer questions about code, not DW. And to
discuss various theological and political topics ;)
Hope you haven't left the DW forums for good.
"CMBergin" <NoHarvestForYou@.NoSpam.org> wrote in message
news:OX2lEUYKFHA.436@.TK2MSFTNGP09.phx.gbl...
> Hey, 'tree. If it matters, "text" columns can be a pain to deal with in
DW,
> depending on what you're trying to do of course. The default recordset
> options don't always work, you've got to watch your field order, etc.
> I know it's not strictly database relevant, but I know you use DW, so it
> might be relevant for you.
> "middletree" <middletree@.htomail.com> wrote in message
> news:eDwvTxXKFHA.2688@.TK2MSFTNGP15.phx.gbl...
very
I
only
> of
You
> of
> problems.
>|||For a while, yes. Probably not for good though.
I'd elaborate, but the "on-topic" rules here seem quite a bit stricter.
"middletree" <middletree@.htomail.com> wrote in message
news:%23cpX5hZKFHA.572@.tk2msftngp13.phx.gbl...
> Actually, I own DW, but tend to hand-code about 95% of my stuff. I hang
out
> at the DW forum to ask and answer questions about code, not DW. And to
> discuss various theological and political topics ;)
> Hope you haven't left the DW forums for good.
>
> "CMBergin" <NoHarvestForYou@.NoSpam.org> wrote in message
> news:OX2lEUYKFHA.436@.TK2MSFTNGP09.phx.gbl...
> DW,
> very
the
text.
> I
> only
explanation
> You
amount
>

Choosing database between MSDE and Access

hi,

I need to choose a database based on the following criteria (using .NET app):
1) a light but fully functional database, preferably with the support of store proc and constraints, less than 8000 transaction a day.
2) portable or the database can be export/import very easily
3) reliable and stable
4) least maintenance

I have two db in my mind, Access and MSDE?
Does anyone have some hand-ons experience on the above two? Or any other better suggestions?

Any advice is appreciated.

thanks,
bryanUsing MSDE will generally be more trouble-free. A file-based database on a Web server is not ideal.

Wednesday, March 7, 2012

CHECKSUM() of binary data

Hello,

I need to generate HASH of text values for my app. I can generate hash values for normal fields using CHEKCSUM and BINARY_CHECKSUM function but it does not support checksum of text, ntext, image, and cursor, as well as sql_variant.

How can I generate checksums of such datatype.

KaramCan anybody help me?|||CHECKSUM() by parts.
split ntext to blocks of nvarchar(4000) and use check sum.
Originally posted by karam_chand03
Hello,

I need to generate HASH of text values for my app. I can generate hash values for normal fields using CHEKCSUM and BINARY_CHECKSUM function but it does not support checksum of text, ntext, image, and cursor, as well as sql_variant.

How can I generate checksums of such datatype.

Karam|||Thanks for the answer.

Can I use it for datatypes like image, sql_variant?

A simple code on how to break it up and get a hash value will be helpful.|||Hello,

I am still unable to figure out but how can I generate checksum of the whole column in one SQL query? Is it possible?

Karam|||you can generate checksum() to whole column
like
select checksum(*) from tablename
provided none of the columns are of text ntext image data types
Originally posted by karam_chand03
Hello,

I am still unable to figure out but how can I generate checksum of the whole column in one SQL query? Is it possible?

Karam|||Hello,

Thats the problem. I do have those unsupported columns and I need to generate hash value from it. In MySQL (where I come from) has a md5() function to generate hash value dfor every type of data it supports.

What I can think of is that I can convert every such data to varbinary and then employ checksum on it. But that is failing as if I convert some char values to varbinary and then running checksum on it, it is returning the same data.

Is it feasible?

Karam|||I don't think so.
convert text to varchar and ntext to nvarchar....
and check.
Originally posted by karam_chand03
What I can think of is that I can convert every such data to varbinary and then employ checksum on it. But that is failing as if I convert some char values to varbinary and then running checksum on it, it is returning the same data.

Is it feasible?

Karam