Showing posts with label store. Show all posts
Showing posts with label store. Show all posts

Thursday, March 29, 2012

About a DataType

What kind of Datatype can I use in my DB to store info like a letter or Rich
Text, including the formats?
thks
--Depending on the expected length including RTF codes, you can either use any
of
the character types (Char, VarChar, NChar, NVarChar, Text or NText).
Thomas
"Kenny M." <KennyM@.discussions.microsoft.com> wrote in message
news:9A7D59EE-EF4C-4F01-B661-9A6C5F0413D8@.microsoft.com...
> What kind of Datatype can I use in my DB to store info like a letter or Ri
ch
> Text, including the formats?
> thks
> --
>|||If the documents size can exceed 8k, Use Image type. If all docs are
guaranteed to be less than 8k you cann use Binary...
"Kenny M." wrote:

> What kind of Datatype can I use in my DB to store info like a letter or Ri
ch
> Text, including the formats?
> thks
> --
>

Monday, February 13, 2012

A long query problem

Hi all,
I currently build a text processing database for my application.
The database is to store all the plain text files submitted by customers. The plain text files will be processed before it store in the sql server. Thus I have 3 major tables Document, Term and TermDocument.
I encounter a problem when I did a query. For example when I performed the following query

SELECT T.TermName, S.* FROM Weight AS S INNER JOIN Term AS T ON S.TermID = T.TermID WHERE T.TermName IN ('electronic','commerce','consists', ....)

The system told me that "No enough storage is available to complete the operation". The terms in "IN(....)" could have up 3k entries. I know this is huge, but I have no choice but to retrieve all of them in a single query.

Is there anyway to solve the problem or perform similar operation in alternative way.

Maybe it would be easier to use reverse logic?

If possible you could reverse the IN to a NOT IN any maybe the list is shorter then (assumption).

You could also insert the 3000 terms in a temporary table and join with that table instead of using the IN clause.

Anyway, I'm not too fond of queries with 3000 entries in the WHERE clause to be honest.

WesleyB

Visit my SQL Server weblog @. http://dis4ea.blogspot.com

|||

I agree that its best to go down the table route, either with a temp table or perhaps a table valued UDF.

There are some good examples of the split function referenced in this thread which may suit your needs as it will enable you to convert a string of terms in to a table.

http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=1847071&SiteID=1

Hope that makes sense.

Saturday, February 11, 2012

A list of Auto exec SPs

Hello All,
A SP can be made to automatically execute when SQLServer restarts using the
store procedure "sp_procoption".
But is there a way to find out the list of SPs that have been congifured to
execute automatically. I took over as a DBA for an existing system and I was
wondering if there are any SP configured this way.
Thanks,
rgnIf you look at the definition for sp_procoption, you will discover the
following line of code:
UPDATE sysobjects SET status = (status & ~2) | (2 * @.intOptionValue) WHERE
id = @.tabid
This tells you, along with the rest of the definition, that if you query the
master.dbo.sysobjects table for status values of 2 on xtypes of X or P you
will find you startup procs and extended procs.
Sincerely,
Anthony Thomas
"rgn" <rgn@.discussions.microsoft.com> wrote in message
news:3DE27C29-DEDC-4D0B-AEB0-2C34553BB3E7@.microsoft.com...
> Hello All,
> A SP can be made to automatically execute when SQLServer restarts using
the
> store procedure "sp_procoption".
> But is there a way to find out the list of SPs that have been congifured
to
> execute automatically. I took over as a DBA for an existing system and I
was
> wondering if there are any SP configured this way.
> Thanks,
> rgn|||Hi rgn
You can use the OBJECTPROPERTY function.
SELECT name
FROM sysobjects
WHERE type = 'P'
AND OBJECTPROPERTY(id, 'ExecIsStartup') =1
--
HTH
Kalen Delaney, SQL Server MVP
http://sqlblog.com
"rgn" <rgn@.discussions.microsoft.com> wrote in message
news:3DE27C29-DEDC-4D0B-AEB0-2C34553BB3E7@.microsoft.com...
> Hello All,
> A SP can be made to automatically execute when SQLServer restarts using
> the
> store procedure "sp_procoption".
> But is there a way to find out the list of SPs that have been congifured
> to
> execute automatically. I took over as a DBA for an existing system and I
> was
> wondering if there are any SP configured this way.
> Thanks,
> rgn

A lil help with DB design

I have a table to store members. For each member, I have flags like manager, verified, etc. How should I be storing the flags? As individual columns in the same table and using bit datatype or creating a new table called MemberStatus and creating 1 row for each flag?

Thanx in advance.

Premal.One table.|||no flags, no bit data

just more to interprete|||Option 1. Flags, bits.
1 = true, 0 = false. Not much to interpret.|||1 = true, 0 = false, Null = unknown ;)|||1 = true
0 = false
6 = not sure
9 = not applicable
NULL = unknown|||10 = drop dead gorgeous.|||7 = very fluffy.

-PatP|||to properly account for shades of gray, you should use a decimal.

.983 = high degree of truthiness
.015 = minor fib, won't hurt anyone|||"truthiness" heh

somebody is a big fan of TheDailyWTF

:)|||nah, i got it from Colbert. He invented that word.|||1 = true, 0 = false, Null = unknown ;)

Null does not mean unknown, it means the absence of any value, or non existence|||ah, i see, thanks brett

but ontologically speaking, "absence of any value, or non existence" includes unknown

it also includes not applicable, out of range, optional, forgot, maybe, and WTF!|||ah, i see, thanks brett

but ontologically speaking, "absence of any value, or non existence" includes unknown

it also includes not applicable, out of range, optional, forgot, maybe, and WTF!

Ummm no, unkown mean there's a quanity, but who knows.

Null means there's not even the understanding of any quantity

And I like the words you keep throwing out there

But shouldn't it be anti-ontologically

http://www.allwords.com/word-ontologically.html|||Ooh! NULL FIGHT! NULL FIGHT!|||Is that where you throw null pointer exceptions?

Sorry. Couldn't resist.|||Null fights usually turn out to be "Much Ado About Nothing".|||Ooh! NULL FIGHT! NULL FIGHT!

LOL

This message is too short

Thursday, February 9, 2012

A few things to do with store variables.

Okay,

I'm creating a small application for my local school district that will allow them to do a small management of inventory.

    Is there a way to create an executable script that will create the default databases the first time? If so, what all do I need to do for the script and to make it execute? I want to make a section in my OPTIONS area where users can put the path to their db (will not be hosted on the same PC as the software) along with the username and password for the db. I know I can store this information in a predetermined variable in the program so that it can reference it off and on.

Could someone please help me with this..... If it's in the wrong forum please let me know.

Thanks,

QWERTYtech

What kind of database does your program use? Full SQL Server, SQL Server Express, Access, or other?|||SQL Express|||

Move the thread from Visual Basic General. There are more exports on storing variables in SQL Express database. I believe you can get satisfying answers in this forum.

Thanks again for your question.

|||

Perhaps these sources will help:

SQL Server 2005 UnAttended Installations
http://msdn2.microsoft.com/en-us/library/ms144259.aspx
http://msdn2.microsoft.com/en-us/library/bb264562.aspx
http://www.devx.com/dbzone/Article/31648