all groups > sql server programming > november 2006 > threads for wednesday november 22
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
SQL 2005 Express and multiple connection on VB.NET application
Posted by Bonato Pierantonio at 11/22/2006 11:35:43 PM
Hi all,
I have a problem that I cannot resolve. I try yo explaim my scenario:
There is an application deveoped in VB.NET
I have a cycle the LOOP on a DataReader inside the cycle there is some like
this
OpenConnection
do while Dr.Read <-- for several record, I suppose some like 100/150
call... more >>
Database Design Problem
Posted by nj at 11/22/2006 11:09:56 PM
Hi,
Please suggest me efficient database design for below mentioned
business logic .
Business Logic:-
"ShareBuilder customer login as an "investor". An investor has a
username, a password, and a first and last name. An investor can have
many accounts. Each account has an account num... more >>
Update Table Query
Posted by Christine C at 11/22/2006 10:15:01 PM
I have a database with 2 tables (Table1 & Table2).
I want to update Column1.Table1 using the value from Column2.Table2 where
Column3.Table1 = Column4.Table2 AND Column2.Table2 IS NOT NULL.
The datatype for Column1.Table1 is in DATETIME. The datatype for
Column2.Table2 is in NVARCHAR(50). ... more >>
Get values as a list
Posted by Russ Chinoy at 11/22/2006 10:12:12 PM
Hi all,
I have a table of email recipients and a table of recipient categories. The
latter table is joined to the former by the recipient's ID. What I need to
do is retrieve all of the recipient columns as well as a "column" containing
a list of all of the recipient's categories. The query I c... more >>
Problems with nested SELECT statements.
Posted by dejavue82 NO[at]SPAM yahoo.com at 11/22/2006 9:19:39 PM
Below is a stored proc that i coded, which retrieves questions and
answers from two tables called _questions and _answers. Since this
query is fairly complex, I am unable to determine where to properly
place paretheses (if this is at all the problem).
The error message reads:
Incorrect Synt... more >>
GhostCleanUpTask - every 4 seconds!?
Posted by Colin Dawson at 11/22/2006 7:26:05 PM
Hi all.
Can someone help without with this puzzle. We have several productions
running SQL Server 2005 Enterprise with SP1. They're all setup identically
(well, probably not otherwize I wouldn't have this issue).
One of the servers has a problem in that the GhostCleanUpTask executes ever... more >>
Indexed View Issue
Posted by JT at 11/22/2006 7:08:02 PM
Hi all,
Using SQL Server 2005 ENT;
I am not understanding the execution plan for a query against an indexed
view. The view joins three tables, and filters out rows from the parent
table of the three that have a bit column value for column 'Void' = True.
Rather than executing against the ... more >>
Ad Hoc import blocked ...
Posted by lemike at 11/22/2006 6:11:11 PM
I have written a VB program that imports data into a SQL Server 2005
system, and all worked. For other reasons I have had to re-install the
SQL Server.
Now I cannot import Excel spreadsheets any more. The import is in a
stored procedure:
CREATE PROCEDURE sp_ImportContractDef
@p_RetCount... more >>
Don't see what you're looking for? Search DevelopmentNow.com.
referencing expressions in Select
Posted by ChrisA at 11/22/2006 6:01:01 PM
I'm hoping SQL can allow me to refer to an expression in a Select, but
can't find any syntax; I suppose that a function might work. Here's the
problem:
I've got a existing DB table with a date stored as an integer, so to
convert it to a datetime, I do:
Select Cast(Cast(OrderDate a... more >>
Pls Help With JOIN query...
Posted by Nobody at 11/22/2006 5:07:40 PM
I'm trying to write a stored proc...
Basically, I have a tblItems table which contains a list of every item
available. One of the columns in this table is the brand... for test
purposes, I hardcoded the BrandID=1...
tblItems also contains a category column (int) which contains a categoryID
... more >>
Trying to Install AdventureWorks database VS 2005
Posted by Henry Jones at 11/22/2006 3:18:13 PM
I went to Microsoft downloads and downloaded the AdventureWorks.msi file.
When it ran, it says that it installed AdventureWorks.
I think I have SQL 2005 Express and SQL 2005 on my PC. There are two
directories: C:\Program Files\Microsoft SQL Server\MSSQL\Data
and C:\Program Files\Microsoft S... more >>
Performance with DELETE and CASCADE
Posted by Dan Holmes at 11/22/2006 2:45:06 PM
I have a set of order related tables. DRI is used on all of them with
CASCADE DELETE on. The data set for a value is the top level table
would comprise about 100 rows in all the referencing tables.
Here is an example:
DELETE FROM orderrelease WHERE
orderid = '250636' AND releaseid = '... more >>
Capitalize function with pattern matching
Posted by WalterWalt at 11/22/2006 2:26:32 PM
Hello
I am importing lots of data that is all uppercase and I need to convert name
and address data to be properly capitalized ie a field called name that
contains first and last name should have the first letter of each name part
capitalized. But I do not want to use while loop to iterate t... more >>
bakup devices
Posted by rodchar at 11/22/2006 1:52:02 PM
hey all,
i'm trying to do a full backup on my database. there is a disk device
currently assigned to do a differential backup on the db. how do i get my
backup without messing up the current device. because there have been a
couple of times where i ran the backup using osq and it still ended ... more >>
Join() UDF/Query ?
Posted by Andrew at 11/22/2006 1:48:22 PM
A while back I found a Split() UDF that takes in a comma delimited list and
gives back the values in a table. Now I have the need to do the reverse,
but am having a hard time finding a Join() UDF or a query that acts like a
Join()....
I have three tables: Users table, Applications table, a... more >>
name change for db
Posted by rodchar at 11/22/2006 1:46:01 PM
hey all,
are there any caveats if i change the name of my database server?
thanks,
rodchar... more >>
Using IDENTITY_INSERT On
Posted by scott at 11/22/2006 1:34:23 PM
I'm trying to create a DDL for an example to post. I'm getting the error
message below when I try to run the script in the CODE section below.
Can someone modify my script below so it creates the temp table and adds a
few sample records?
ERROR ********
An explicit value for the identity... more >>
Need Help With Query
Posted by Wannabe at 11/22/2006 12:49:01 PM
I want to run a query that pulls out the personnel out of a view that are not
already in another table. I thought the below query might work, but got an
error, Syntax error converting the varchar value '45, 46' to a column of data
type int. I can see why it is not working, but cannot figure ou... more >>
query
Posted by FARRUKH at 11/22/2006 11:28:03 AM
I have a 30 colums table and i run a query. I want to save my result in a
excel file. When i try thorugh Query Analyzer (save in a file) its very messy.
Anybody know hoe to do tht
Farrukh... more >>
Assigning results of a single Select statement to several variables
Posted by Randall Arnold at 11/22/2006 10:46:11 AM
I've got a procedure in a SS 2000 database that sends SMS messages to
certain recipients when a row is added to a table used for monitoring
production errors. It works well but I'm needing to add some more
functionality.
What I want to do is assign the all of the values retrieved by a Sele... more >>
truncated strings
Posted by panko at 11/22/2006 10:12:33 AM
On table
CREATE TABLE [trac_4205_server] (
[RowNumber] [int] IDENTITY (1, 1) NOT NULL ,
[EventClass] [int] NULL ,
[TextData] [ntext] NULL ,
[NTUserName] [nvarchar] (128) NULL ,
[ClientProcessID] [int] NULL ,
[ApplicationName] [nvarchar] (128) NULL ,
[LoginName] [nvarchar] (128) NULL... more >>
Best way to have a column update automatically when a date is passed.
Posted by Tom at 11/22/2006 9:54:26 AM
Hello-
I am new to SQL server side programming. I need a column to get updated
from Active to Inactive if the date in another column is less then
today's date. I was thinking of using a trigger but how would I
trigger it daily, the table does not have daily inserts or updates. Is
there some oth... more >>
finding properties of stored procedure/comparing 2 versions to find most current
Posted by devans NO[at]SPAM providercs.com at 11/22/2006 9:47:16 AM
We have a test DB and a production DB, and need to determine which
copies of some key stored procedures are current. (We need to do the
same for several key tables as well).
How do we determine prgrammatically which is the newest version? The
properties just give the creation dates, not the u... more >>
html string insertion into varchar
Posted by m at 11/22/2006 9:42:38 AM
Hi All
I use SQLServer 2005.
I have a table
CREATE TABLE test
(
htmlstring varchar(MAX)
)
I want to insert the following string into the table (Complete string
between single quotes)
insert into test(htmlstring) values
(' "face='Verdana, Arial, Helvetica, sans-serif'><strong><f... more >>
BLOB Insert and Select of BIG Data
Posted by Deniz at 11/22/2006 8:55:11 AM
Hello!
Consider you have the Table "Maps" with the following columns and
datatypes:
Map varbinary(MAX)
MD5 nchar(100)
Date datetime
ZipFileName nchar(100)
I wanted to insert a large Zip file into this table (422MB). I used
this statement:
INSERT INTO [mydbdd].[dbo].[Maps] (Map)
SELEC... more >>
Re: Full db refesh technique
Posted by Abhishek Pandey at 11/22/2006 8:09:01 AM
Hello,
I have a scenario where we have to do a full db refresh everynight. This
process takes about 20 min for which we have to bring down the entire system.
I was wondering if there is any way to reduce this 20 min down time ?
We have clusted SQL 2005 server with active-active config... more >>
Ranking based on two columns
Posted by steve at 11/22/2006 7:37:22 AM
I have data that looks like this:
RepId Revenue Avg Customers
SalesRep1 225000 2.4
SalesRep2 175000 6.6
SalesRep3 205000 4.5
SalesRep4 162000 2.0
... more >>
How to find date difference
Posted by AlertAdmin at 11/22/2006 7:36:31 AM
Hi All,
I have two dates ,i need to get the difference between these two in
days
select convert(varchar,max(end_date_time),101) from lmappdata where id
= '83220D9A-69D5-4ADB-AC61-95B80396F55D' --First date
select convert(varchar,getdate(),101) -Second date
select datediff(dd,Secon... more >>
SQL Queries.. training material..
Posted by SQL server programming at 11/22/2006 6:32:57 AM
Hi Friends
I am supposed to give basic training on writing SQL queries to
some of my colleagues who are not much exposed to SQL. Dont have much
time to prepare theory and exercises to be given to them after class.
If there is any comprehensive training material then it would make my
job ... more >>
SQL dB Design
Posted by FrankS at 11/22/2006 6:21:27 AM
SQL Design Question
I want to set up a website with SQL DB so that each company (with multiple
users) has access to only their data. One thought is separate database for
each company (there could be thousands). Another thought is hard code the
User ID to a company and ALWAYS include company... more >>
SQL 2005 (DAO, ADO;RDO)
Posted by puche1970 NO[at]SPAM gmail.com at 11/22/2006 6:19:11 AM
Hi
I would like to know if someone has any experience to migrate SQL 7 to
SQL 2005
Could someone comment the incompatibilities ?
Also we have near 60 application with differents technology (DAO
,ADO,RDO)
Could someone confirm that DAO /ADO /RDO is compatibility to SQL 2005?
... more >>
Delete Query taking long time to execute
Posted by Somesh at 11/22/2006 4:39:01 AM
hi,
I have a table which is a Master to other 12 tables and it is Child for
other 2 tables.
Therefore, It has 14 relationships with other tables. The size of table is
very small. (approx 30-40 rows). It also has a clustered index in its primary
key.
The problem I am facing here is that wh... more >>
record selection
Posted by kingofging NO[at]SPAM gmail.com at 11/22/2006 4:16:20 AM
Hi,
I have the folowing 3 tables:
CREATE TABLE [dbo].[tblSubscription](
[SubscriptionID] [int] IDENTITY(1000000,1) NOT NULL,
[SubscriberID] [int] NOT NULL,
[Status] [int] NOT NULL,
[JournalID] [int] NOT NULL,
CREATE TABLE [dbo].[tblTransaction](
[TransactionID] [bigint] IDENTITY(100... more >>
Help with report/pivot
Posted by hals_left at 11/22/2006 4:15:18 AM
I am doing a report that shows 1 column per count of transactions for
each of 2 different status, + the overall total, and 1 row per product
type, of which there are 4. So I need four rows and three columns of
counts.
The code is not working because it needs Lead ID in the GROUP by , but
... more >>
convert string into Hexadecimal value
Posted by SqlBeginner at 11/22/2006 3:11:02 AM
Assume that i have a string value something like this '|__|'. Now I want to
convert it into hexadecimal value. How to do it?
So when i say select convert(varchar, MY_HEXADECIMAL_VALUE) it should give
me output as '|__|'
Can anyone throw some light on this?
Regards
Pradeep... more >>
How to returns the final value
Posted by kenken at 11/22/2006 12:00:00 AM
Hi All,
I face a problem about SQL programming as listed.
Said the current datetime is 2006-11-22 8:30:00, if I have a 20 hours job
assign to Staff '1234',
according to the below data from table Staff_Calendar, this job should dived
into 3+4+4+4+4+1 hours,
that means the exact endtime of... more >>
Trying to turn two select statements into one
Posted by Stephen Ahn at 11/22/2006 12:00:00 AM
Using SQL Server 2000.
Example data :
==
create table dbo.t1 (pk int primary key, type int, quantity int)
insert t1 values (1, 1, 1)
insert t1 values (2, 1, 20)
insert t1 values (3, 2, 300)
insert t1 values (4, 2, 4000)
create table dbo.t2 (pk int primary key, name varchar(10))
insert t... more >>
Query help
Posted by SQL_help at 11/22/2006 12:00:00 AM
Hi,
The question is mentioned below the DDL.
CREATE TABLE BUDGET
(
emp_id INT,
task_name VARCHAR(20),
allotted INT,
spend INT,
commn INT,
balance INT,
date_spend DATETIME
)
GO
INSERT INTO budget VALUES(1,'TASK1',1000,800,25,175,'JAN 1 2005')
INSERT INTO budget VALUES(1,'TASK2',80... more >>
|