all groups > sql server programming > july 2004 > threads for monday july 12
Filter by Day: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
Size of BIT Datatype
Posted by Prabhat at 7/12/2004 11:14:08 PM
Hi All,
How much space a BIT Datatype takes in SQL Server Table.
I read from BOL that if I have 8 or less that will take 1 byte of space.
What does that specify the size of a table with only one bit field?
IS THAT 1 BIT or 1 BYTE or 16KB (a Page Size)
Thanks for any reply.
Prabhat
... more >>
Looking for data dictionary/definition integrity checking utility
Posted by Joergen Bech NO[at]SPAM at 7/12/2004 11:12:55 PM
Anyone who can tell me if there is such a utility for SQL Server 2000,
free or commercial?
Basically, what I need is: A tool that will list all definitions in a
database, i.e. all table names, field names, etc. Then, when selecting
a name (e.g. "CustomerCode") tell me where such an identifie... more >>
Advice on parsing flat test files for certain strings
Posted by Neil Owens at 7/12/2004 11:08:48 PM
I manage about 100 servers and each server produces a flat text file
containing certain useful lines of text amongst may lines of dross from a
bespoke application. I can import this flat text file into a table(table1).
I could also produce another table containing text strings and an ID field
t... more >>
Backup on a Network Drive
Posted by Nitin Rana at 7/12/2004 9:57:54 PM
I have two servers and both of them have a mapped drive
in Windows Explorer. When I go to DB backup, on one
server when I click on Browse in EM, I do see the network
drive and on the 2nd server, I don't see the network
drive even thought the drive is mapped. Any reasons why I
am not seeing... more >>
finding # days in date range
Posted by peg at 7/12/2004 9:31:10 PM
I am doing a social services data project where they need to know the number
of days a kid is in their 'system'
In a table it has a beginning and ending date and 'place' that shows where
the child is.
I need to know how many days between X/X - X/X for each kid.....
Example:
Kid#1 ente... more >>
Problem writing query using sub-select...
Posted by Peter X at 7/12/2004 8:07:52 PM
Hi all,
I have a "Products" table and a "Prices" table. Each product is has one
or more prices based on the quantity being ordered, so "Products" has a
one-to-many relationship to "Prices".
The idea is that prices decrease as quantities increase, but I'd like to
be able to reality check ... more >>
converting text to image
Posted by Kamran at 7/12/2004 7:53:06 PM
Hi All,
Although "Explicit conversion from data type text to image is not allowed",
but can there be a way to convert/update image column with text column
values?
TIA
Kamran
... more >>
sql mail problem
Posted by joe at 7/12/2004 7:15:27 PM
Hi guys, I had problem setting up sql mail in one of sql servers.
I log in as local administrator, I setup my ms outlook using microsoft
exchange server,
I entered a domain login and password to access exchange server.
now I went to sql server EM, --> support services --> SQL MAIL --> Right... more >>
Don't see what you're looking for? Search DevelopmentNow.com.
No. of datatypes
Posted by Panks at 7/12/2004 6:58:45 PM
Can anyone tell me how many Data types are there in sql
Thanks
... more >>
simple Query
Posted by PVR at 7/12/2004 5:19:00 PM
Hello Sql Gurus,
Res is a table with few columns
Resnum is the primary key with varchar(13)
declare @resnum varchar(100)
select @resnum = '''1111212''' + ',' + '''1114'''
select @resnum = ltrim(rtrim(@reservenum))
select @resnum
/** Query 1 **/
select * from res
where resn... more >>
"WHERE/IN" Clause
Posted by Xaviero at 7/12/2004 4:35:01 PM
I am receiving a string of comma delimited numbers from another SP (that get called from an ASP.Net page). I wanted to know if there was any way to use that string in a WHERE/IN clause to filter records based on the numbers contained in the string.... more >>
Problem with joins and openquery
Posted by Chris at 7/12/2004 4:26:02 PM
Hi,
I have these queries. None seem to work. Any ideas? I am trying to join tables using openquery.
select substring(po_upc_number,7,len(po_upc_number)-7),
sum(po_quantity_sold)
from po_data a
join openquery(server, 'SELECT number,quantity from ords where number = 1234') b
on a.(substring... more >>
"Only Contains" Query
Posted by Steven at 7/12/2004 4:14:40 PM
I'm trying to come up with a query but am having some trouble figuring out
how to limit my results set. I'm trying to query a orders & order details
table to find all orders that only have products x,y,z. There is a
many-to-one relationship between the orders and order details table. Schema... more >>
Decrypt SQL Proc
Posted by Nitin Rana at 7/12/2004 3:37:50 PM
I have encrypted stored procs in the db and don't have the
corresponding source code. Is there any way to decrypt
it?? There must be some hacks to decrypt it. Does anyone
know about it??
Thanks in advance
-Nitin ... more >>
drop sql login and related database users altogether
Posted by joe at 7/12/2004 3:03:07 PM
Hi, I¡¯m wondering if there is procedure which is based on SQL login to
return all database names for which user is owner.
then drop user from each database, and finally drop sql login.
... more >>
ms.public.sqlserver.server group dead?
Posted by Bob Castleman at 7/12/2004 2:52:14 PM
In my news reader (outlook) the microsoft.public.sqlserver.server group
hasn't had any posts in weeks. Is it a dead group?
Bob
SuccessWare Software
... more >>
Enterprise Manager hightlight text bug?
Posted by Daniel at 7/12/2004 2:47:45 PM
When ever I hightlight text in sql server 2000 by ctrl-shift-backarrow. Is
this a bug or intended behavior?
... more >>
@@ROWCOUNT BEHAVIOR?!?!
Posted by hedgecore NO[at]SPAM mac.com at 7/12/2004 2:17:37 PM
Hi, all,
I'm modifying a vb prog that uses this stored proc to increment a
value in a table, the prog checks the @STATUS after execution. In
this form and function, it works:
CREATE PROCEDURE sp_assign_next_carton_number
@USSNO CHAR(9),
@CTNNO INTEGER OUTPUT,
@STATUS SMAL... more >>
Stubborn syntax for a variable
Posted by Fox at 7/12/2004 2:06:00 PM
I am having a problem replacing a value with a variable.
This works
Set objInsertResults = Server.CreateObject("ADODB.Recordset")
objInsertResults.Open "FBBAPoints", db_flmaConnect ,2,3
This does not work
Set objInsertResults = Server.CreateObject("ADODB.Recordset")
objInsertResults.Open o... more >>
Transferring SQL Jobs from one server to another one.
Posted by Knick at 7/12/2004 2:05:49 PM
I want to transfer SQL Jobs from one SQL Server 7.0 to
Second SQL Server 2000. I do not want to restore MSDB
Database after upgrading SQL 7 to SQL 2000. Is there
anyway to transfer SQL Agent Jobs from one server to
second one??
Thanks in advance
-Knick... more >>
Trigger Enable/Diable
Posted by Knick at 7/12/2004 2:02:32 PM
How do I find out if a trigger on a table is enabled or
disabled.
For example:
ALTER TABLE A DISABLE TRIGGER ABDCD
After this command I wanna check on the status of trigger.
Which proc or table stores this information.
Thanks in advance... more >>
Update incrementing in loop?
Posted by Mar at 7/12/2004 1:50:21 PM
Hello,
In a table, I want to update an int field with the max
count of rows + 1 (I asked about this earlier except for
only one row, but what about 10 rows?)
Here is sql for one row (of 10 rows with RowNum Is Null)
Update tbl1
Set RowNum = (Select Max(RowNum) From tbl1) + 1
Where Ro... more >>
Geographic Databases
Posted by Scott Schluer at 7/12/2004 1:49:11 PM
Can anyone provide information or links to resources for the following two
questions:
1) I want to build a geographical "drilldown" function for a website, so the
user will first select (from a list of text links) their state, then their
county or other area, then the city they want. Alternati... more >>
Storing yyyy-mm or yyyy 'dates' as DATE types??
Posted by Kristine Gual at 7/12/2004 1:43:36 PM
I am trying to store dates from a flat-file import in a datetime field. The
dates have a wide range of granularity: some are yyyy-mm-dd, and some are
yyyy-mm or even yyyy (specifying the year only). I want to store the dates
in the same field(s), regardless of level of granularity, but I'm not ab... more >>
Query with running totals
Posted by PeterNunez at 7/12/2004 1:05:01 PM
Is it possible to create a result set with a running total? I have been copying my results to excel and using formulas to create a column of running totals.
The idea is to create a total for the first number, then a total of the second and first number and then a total for the 1st, 2nd and 3rd n... more >>
Date Functions
Posted by Willie Bodger at 7/12/2004 12:59:23 PM
When I use the date functions such as DatePart, does the 'part' become
merely a number, or does it retain it's 'date-ness'? As an example, if I am
doing this:
AND datepart(d, getdate()) between DATEADD(d, -5, DATEPART(d,
dtRenewalDate)) AND DATEADD(d, 5, DATEPART(d, dtRenewalDate))
as part of a... more >>
how to view the valid values of a Check Constraint
Posted by palfery NO[at]SPAM fvtc.edu at 7/12/2004 12:15:56 PM
I would like to populate a combo box with the values from a check
constraint. how do I write a select statement to bring back these
values? Any help would be much apprieciated... more >>
Can't convert string to correct datetime
Posted by dw at 7/12/2004 12:03:18 PM
Hello, all. We have the following code, which produces "2047-07-22
00:00:00.000" as dt. It's mistaking the year to be "2047", when in fact it's
"1947" -- a birthday. We get the data in this format, and don't have any way
to ask the source to be explicit about the year. How can we get SQL Server
... more >>
Select fields according to value in one of the fields
Posted by eagletender at 7/12/2004 11:47:55 AM
I have a database that has a list of phone numbers with 3 columns, one for a
home phone, one for a company phone, and one for "preferred" meaning which
number the user prefers to be used. How can I make a query (one query
possible?) that pulls only the home phone if the user prefers home phone,
... more >>
select count of distinct records
Posted by mt at 7/12/2004 11:39:03 AM
I'm trying to avoid using a temp (or any additional) table. I have a bit field and a varchar field. I'd like to calculate total 1s and 0s in the bit field but on the distinct combination of varchar + bit. I can do this:
select distinct bitField, varCharField
into #temp_Table
from .... where .... more >>
use OpenXML in SP - ?
Posted by Ed at 7/12/2004 11:00:28 AM
Hi,
The following SP works from Query Analyzer but get error
if I set an ADO recordset object to it:
CREATE PROCEDURE [stp_OpenXMLtest]
@xml varchar(8000)
AS
Declare @iDoc Int
Set @xml=dbo.ArrayToXML(@xml, ',')
EXEC sp_xml_preparedocument @iDoc output, @xml
if (object... more >>
How do I Create a stored procedure using with cursor as below
Posted by SqlJunkies User at 7/12/2004 10:24:02 AM
how to convert and use in a stored procedure, that below my sql procedure. help me please..!
ysucek@adu.edu.tr
----------
DECLARE Katkipayiidata_Cursor CURSOR FOR
SELECT kid, yilidharc FROM tblkatkipaylari2004_View
OPEN katkipayiidata_cursor
declare @kid int
declare @yilidharc... more >>
underscore character
Posted by JT at 7/12/2004 10:19:56 AM
i want to do a select that will find all records that have the following
literal string: "__AV"
i thought i could simply use:
select * from tTable
where colA like '%__AV%'
however, since the underscore character is a reserved sql command, this
returns more than i want.. any suggesions?... more >>
Check if Linked Server Alive
Posted by shofozul_ali NO[at]SPAM hotmail.com at 7/12/2004 9:59:30 AM
I have looked through a lot of newsgroups and can't find anyone else
who is having a similar problem, so hopefully I am not repeating
someone else.
The problem I have is with knowing the availability of linked servers.
Our application allows users to connect to different databases on
differe... more >>
update numfld with max(numfld) + 1 ?
Posted by Mar at 7/12/2004 9:57:34 AM
Hello,
Query Analyzer gives me this message
"An aggregate may not appear in the set list of an UPDATE
statement."
when I try to do this
Update tbl1 Set numfld = Max(numfld) + 1 Where numfld Is
Null
What is the correct way to do this?
Thanks,
M
... more >>
Remote Procedure to Restore DB
Posted by dontsendmecrud NO[at]SPAM hotmail.com at 7/12/2004 9:44:50 AM
I have set up a job to update a warm standby for SQL Server 2000. The
job executes a procedure on a linked server to restore the most recent
backup.
EXEC SERVER01.master.dbo.RestoreMyDBBackup
When the remote procedure executes, the job reports success, but the
standby server is left in the... more >>
::how get if MSDE/SQL is installed?
Posted by RTF at 7/12/2004 8:49:08 AM
Hi,
I need know if MSDE/SQL is isntalled in computer user.
How a get this?
Thanks
... more >>
SQL Advice required
Posted by Red at 7/12/2004 8:17:02 AM
Not really sure how to pose this one, so here goes:
Order Header and Order Line tables, with the following fields:
OH.ORDER_HEADER_KEY
OH.ORDER_REFERENCE
OH.ORDER_TYPE
OL.ORDER_LINE_KEY
OL.ORDER_HEADER_KEY
I have some basic SQL that returns the summary:
Order type, count of order h... more >>
Double hierarchy in one dimension
Posted by Kris Schepens at 7/12/2004 8:15:03 AM
Hi,
I wonder if it is possible to set up a double hierarchy in one dimension In Analysis Services?
And of course if it is possible, how to do it?
Best regards,
Kris... more >>
Connecting to database from a remote machine
Posted by Denis Crotty at 7/12/2004 8:15:02 AM
Hello,
This is a new thread for one I started last Friday.
Here's the situation:
We have:
- a database server running SQL server 2000 on windows xp professional.
- a development box running windows 2000
- a new production box running Windows 2000
From what we can tell t... more >>
SUM seems to return the count
Posted by M K at 7/12/2004 7:52:01 AM
Here is my query:
SELECT ShoppingCartDetails.ProductID, Sum(ShoppingCartDetails.Qty) AS Quantity,
(SUM(Price1.Price) * Sum(ShoppingCartDetails.Qty)) AS TotalPrice1
FROM ShoppingCartDetails LEFT JOIN #Price1 ON ShoppingCartDetails.ProductID = Price1.ProductID
WHERE ShoppingCartDetails.Qty > 0... more >>
Query governor cost limit
Posted by ktuel NO[at]SPAM streck.com at 7/12/2004 7:21:05 AM
I seem to be having a problem with the query governor's cost limit.
The cost limit is set to 60. I run a query that gets an error stating
the cost of the query is 286, and other queries that have a "cost" of
near 4000. When I set the cost limit to 0 and run the queries, they
only take a secon... more >>
INSTEAD of INSERT trigger problem
Posted by hngo01 at 7/12/2004 7:19:57 AM
Hi I am using Instead of Trigger with insert data.
Sometime users are complaining that when they update the
data, they got a duplicate data. It is not happening all
the time. Any ideas? Thanks
... more >>
SQL Query Governor Cost Limit
Posted by ktuel NO[at]SPAM streck.com at 7/12/2004 7:14:34 AM
I am trying to use the query governor's cost limit. I seem to be
missing something though. So, I have 2 questions:
1) What is an average range to use. I understand that it will depend
on the nature of our use and such, but is there any way of determining
what will work best. I have seen som... more >>
Image field
Posted by mtgoli at 7/12/2004 5:45:01 AM
Hi
I have an Image field. I fill it through an application (Delphi5-ADO-OLEDB).I store various file types in this field (.JPG,.GIF,.BMP).How can I know the type of the image stored in image field(JPG,GIF,BMP) after I fetch it?
thanks... more >>
Need a SQL-Expert
Posted by Indyyan at 7/12/2004 4:32:04 AM
Fact is:
I have two tables Orderposreg and Temp1 (both in [My Database]), Orderposreg is from 1994, Temp1 from 1995 and i need to Update the old table with the new one.
This should my Query do: I need it to Update old primary keys, or if the row does not exist to insert the new primary key int... more >>
TCP/IP Port
Posted by Jay at 7/12/2004 4:13:39 AM
I was instructed to change the TCP/IP port to 14330 using the SQL Client =
tool in order to access an external database for a website I am doing. =
Everything worked fine - I was able to connect to the DB in question. =
However, I was surprised that I was able to still conect to my old DBs =
w... more >>
Doing a join between XML data typed field and a relational table in Yukon (SQL 2005)
Posted by nitsan.shaked NO[at]SPAM intel.com at 7/12/2004 4:02:29 AM
Hello,
I have a Yukon XML question and would be very happy if someone can
assist:
Let's assume I have 2 tables:
One will be product table – Regular relational table with Product ID
as a primary key and some descriptive fields.
Second is an Order table – it has Order ID as a PK and Orde... more >>
what is length of numeric(9,2)
Posted by MM at 7/12/2004 3:19:02 AM
what is the max number stored in numeric(9,2). I know 2 is the no. of decimals. but how is 9 interpreted in numeric(9,2).
thanx... more >>
union table in all databases
Posted by SM at 7/12/2004 2:36:02 AM
Dear
I have to get all records from orders table in all databases. In our system a new database for each company added to our system.
My idea is to create a temp table and combine all records in that table using cursor.
any other efficient way to do this.
thanx... more >>
get All Databases
Posted by Malik at 7/12/2004 12:50:03 AM
Dear
I have to get all the databases in a sqlserver in a sotred procedure how can i do that.
what is the query to select all the databases, or where is the information stored about all the databases.
thanx... more >>
ORDER BY
Posted by Carol at 7/12/2004 12:30:22 AM
Select id, book_title, book_subtitle from books where id in(49,37,39,20,51)
I WANT TO ORDER BY: 49,37,39,20,51
HOW MAY i ACCOMPLISH
gRACIAS
... more >>
|