all groups > sql server programming > december 2005 > threads for thursday december 29
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
Query
Posted by Manoj at 12/29/2005 10:26:02 PM
Dear All
I have a query is:-
select
A.AllocatorId,a.CustomTypeId,a.CustomId,a.ScopeTypeId,a.ScopeId,a.ActivityTypeId,a.PriorityId
from allocation a
Out put is
AllocatorId CustomTypeId CustomId ScopeTypeId ScopeId ActivityTypeId
PriorityId
----------- ------------ -----------... more >>
Trouble using sql IN statement with list of datetimes
Posted by JavaJeff NO[at]SPAM gmail.com at 12/29/2005 7:25:48 PM
I would like to pass in a list of dateTime stamps in a nVarChar
parameter like so:
--Example input data:
'2005-12-21 15:55:26.053, 2005-12-21 15:41:35.600, 2005-12-21
15:23:21.647, 2005-12-20 19:15:27.180'
declare @RequestCreationTimeList nvarchar(500)
Select dbo.MyTable.RequestCreationT... more >>
Use of NULL and DEFAULT
Posted by Gerard Marshall Vignes at 12/29/2005 6:16:02 PM
I have a rule of thumb which I would like to get opinions about.
RULE: Provide Data or Go Meta
SCOPE: Designing SQL Tables, UDFs and Stored Procedures
MEANING:
A good database design will restrict the occurrence of NULL. An
overabundance of NULLs in a database suggests, among other thi... more >>
SCHEMA - primary key - SQL problem
Posted by Jeff User at 12/29/2005 6:03:37 PM
Hi
I posted this in another group and got no reply.
Hope someone here can help. Perhaps this is more of a SQL programming
issue than a schema or PK issue, as the actual problem is duplicate
records:
I have reviewed previous posts about finding primary key, table schema
information, etc...
... more >>
Need to Execute SQL Script after SysPrep or after first boot
Posted by Scott Townsend at 12/29/2005 4:51:27 PM
I'm ghosting a few classroom machines that have a SQL server on them. We
are using one base image and pushing it out to 12 machines.
I'm looking for an automated way to execute the sp_dropserver and
sp_addserver Stored Procedures.
So I'd like to be able to execute the following:
sp_drop... more >>
Limitation of sql standard
Posted by Roy Goldhammer at 12/29/2005 3:12:36 PM
Hello there
In one of my clients who have SQL Standard has past the 2Gb data file.
In this office there are approxsimatly 80 users
Since then a lot of problems have happened in the database:
1. tables are locked more often and we need to reset the sql server at least
once a week (Very bad)... more >>
compare '002' and '00²'
Posted by Gene Vangampelaere at 12/29/2005 2:39:51 PM
does anyone knows why '002' = '00²' in sqlserver 2000 ?
create table Test2 (veldnaam varchar(10),veldnaam2 varchar(10))
go
insert into test2 values ('002','00²')
go
select * from Test2 where veldnaam=veldnaam2
I did not expect to find a record !
Gene
... more >>
Evaluation of conditions
Posted by Lalit Bhatia at 12/29/2005 2:04:53 PM
I have a Join condition like
Select columns
From Table1 T1
Inner JOIN Table2 T2
ON T1.col1 = T2.col1 Or T2.Col1 Between T1.Col1 and T1.Col2
In table1, I have two cols that store some string range values. Col1 can
have inidividual entries and col1 and col2 may have range values.
... more >>
Don't see what you're looking for? Search DevelopmentNow.com.
Developing CLR Objects - Visual Studio Requirements?
Posted by Craig S at 12/29/2005 1:14:20 PM
I have SQL 2005 Express & Visual Studio 2005 Standard on my XP workstation,
and SQL 2005 Standard installed on my Win2k3 server. I can't find anywhere
on either system's VS installation the option to create a new Sql
Project/Solution to create CLR objects. Am I missing something, or do I
n... more >>
Row based security
Posted by Leila at 12/29/2005 1:07:14 PM
Hi,
Are there any new feature for restricting users access to particular rows in
SQL Server 2005?
Thanks in advance,
Leila
... more >>
Using Case Conditions in WHERE clause
Posted by HP at 12/29/2005 1:06:02 PM
Can i use case conditions in where clause? does it affect the performance?
eg.
select fldnames from table
where type =
case when @ctype = '1' then 'quote'
else 'order'
end
Thanks
... more >>
SQL Server 2000 and SQL Server 2005 - Installation issues
Posted by Raja at 12/29/2005 12:47:49 PM
How to configure SQL Server 2000 as default instance, while having installed
SQL Server 2005 beta, on the same server?
As, VS Team suite needs SQL Server 2005 as a default instance. But, my
application needs SQL Server 2000 as a default instance. If not possible,
how we can have bot... more >>
Deadlocks
Posted by Yaniv at 12/29/2005 12:43:49 PM
Hi,
I have recently directed a query that used to run on my main server to
another server that is a Pull Subscriber to a Transactional Replication from
the main server.
I now face deadlocks from time to time when the query is being run. The
deadlocked process is the proccess executing th... more >>
SQL Server :
Posted by Sirisha at 12/29/2005 12:31:02 PM
Hi,
I have created a table valued user defined function
CREATE FUNCTION Testting (@labrunid int)
RETURNS TABLE
AS
RETURN
(
SELECT *
From labruns
where labrunid = @labrunid
)
Now in the Query Analyzer when i try this
select labrunid from... more >>
Help with xp..sendmail needed!
Posted by Damon at 12/29/2005 12:11:42 PM
Hi,
I keep getting the following error in my SP which I can't seem to resolve:-
Server: Msg 18031, Level 16, State 1, Line 0
xp_sendmail: Could not resolve recipient
If anyone has any ideas why this is happening it would be greatly
appreciated. My SP is below for reference.
DECLARE @... more >>
Select Calculations
Posted by Vishal at 12/29/2005 11:57:45 AM
Hi,
I have a problem here, please help me I am sure it can be done but just
can't figure out how.
The table structure is something like this :
ID Store_id Year Month Sales
1642 2 2004 1 1000
1792 2 ... more >>
Question about the best way to relate some tables.
Posted by Star at 12/29/2005 11:55:43 AM
Hi,
I am creating a database that contains persons, vehicles, addresses and
some other information.
A person may have several addresses. The same with vehicles. That's why
I'm going to put all the information in different tables. I don't store
the address and vehicle information inside th... more >>
dts to update table
Posted by helpful sql at 12/29/2005 11:42:47 AM
Hi,
I am writing a dts package to update a sql table using data in a csv
file. I know that dts updates all mapped columns regard less of the column's
value has changed or not. I need to perform a special action when dts
actually changes any column's value but not when the column's value re... more >>
how to write query for rownuber in alphabet
Posted by jaffar at 12/29/2005 11:34:06 AM
sir,
i have a doubt related to rownumber,in my application i want to use
the row numbers in alphabets, i know how to print the rownumber in numeric
but i want in alphabet for example
SELECT (SELECT COUNT(*) FROM authors e2 WHERE e2.au_id <= e.au_id) AS
rownumber, au_id, au_lname FR... more >>
Record locking within a stored procedure
Posted by G18LLO at 12/29/2005 11:03:07 AM
Hi
I'd like to be able to lock a record in a table, row locking, update some
fields, then release the lock when finished. I'd also like to be able to
attempt the row lock for a specified amount of time, if, for example, another
session is already locking this record. The session would only ... more >>
data import question
Posted by helpful sql at 12/29/2005 10:51:40 AM
Hi,
I am writing a script for a client to update TableA using the data in
TableB. I know how to write an UPDATE query to do this. But the client wants
an ability to add or remove fields that they update using this script. I
know I can do this by letting the client enter the names of the sour... more >>
How to decide whether trigger is a good idea?
Posted by dotnetlover at 12/29/2005 10:43:03 AM
Can any one give me some TIPS to decide whether trigger is a good idea or
not, i have one table say TABLE1 and wanted to create update trigger on this
table which updates data in another table say TABLE2 , the update statement
will update four TABLE2 columns.
The approximate hits to the TABLE... more >>
Help with stored procedure!
Posted by Damon at 12/29/2005 10:33:45 AM
Hi,
I keep getting the following error in my SP which I can't seem to =
resolve:-=20
Server: Msg 18031, Level 16, State 1, Line 0
xp_sendmail: Could not resolve recipient
If anyone has any ideas why this is happening it would be greatly =
appreciated. My SP is below for reference.
DE... more >>
Transform while Importing Data
Posted by gwomick NO[at]SPAM steelmasterusa.com at 12/29/2005 9:43:02 AM
I have a flat text file containing phone numbers.
They are formatted as ###,####### and I would like change it to
###-###-####.
What SQL statement would I need to use?
Thanks for the help.
... more >>
if condition and batch statements
Posted by sqlster at 12/29/2005 9:30:02 AM
Is it possible in tsql ? How can I do the following?
if ( 1 = 1)
begin
print 'condition was true'
return --exit the script completely -- how do I do that???
end
-- otherwise continue with the script
print 'continue'
go
print 'with'
go
print 'the'
go
print 'script'
go
P... more >>
NewBie Question: SQL Server AddNew and ASP
Posted by mac at 12/29/2005 9:12:02 AM
I'm new to VBscript and SQL Server. I want to add a row to a SQL Server
table. I establish the database connection. I set up an recordset. I then
Open the recordset. At this point I get an error. Is this because I must
code an select statement first.
What I'm trying to do is add a n... more >>
Service Broker Error : Cannot find the remote service
Posted by SQLpro at 12/29/2005 8:41:04 AM
Hi there,
quite a long script to make a complet internal example of SB...
This test is made on ONE PC with 2 instances...
At the end, I have the error message in the title (copy at the end of the
script).
I cannot arrive to find where is the problem...
Many thanks in advance to those ... more >>
Help with cursor and decimal values
Posted by Ram at 12/29/2005 8:32:03 AM
The following table when using a cursor gives 0 for decimals where the values
are below 1. I am trying to use this to apply a factor and always get a zero
if the factor below 1, as a result my logic fails.
Can some one help me on this?
-- ========== Table & data =============
CREATE Tab... more >>
Suggestions / direction on learning SQL Server 2005 ?
Posted by Chris Smith at 12/29/2005 7:39:28 AM
While I am not new to databases by any stretch of the imagination, to say
"newbie" in regard to SQL Server 2005 is a gross understatement. And TSQL is
proving to be a bit more challenging than anticipated. Don't try to "it's
just a minor syntax difference" with me. I know better !
Given tha... more >>
Long running DTS package
Posted by Patrice at 12/29/2005 7:28:02 AM
Hello,
I have a DTS package that took 52 hours to run. Within the package is a
task that runs a sproc which is a procedure to calculate premiums recvd and
has to run through over 2 million records. The procedure uses a cursor to
move through the records. My question is - is it possible t... more >>
bulk insert problem
Posted by Kevin at 12/29/2005 6:22:03 AM
hi guys, I have a data file that I like to import to a table.
the column delimiter is @, row delimiter is \n, line feed.
But here is the problem, we have a column called "comment",
basically user can enter any characters to it, so if "comment" column
contains
@ character, then sql server ... more >>
design question
Posted by ChrisR at 12/29/2005 6:20:02 AM
For the record, no I dont have a ton of design experience. So in advance
please forgive my ignorance on this matter. If I was an expert I wouldnt need
to post questions here. I have been tasked with redesigning some of our DB's.
The catch of course is that no existing code should need to chang... more >>
Database Table special permissions
Posted by Maria Bravo at 12/29/2005 4:41:03 AM
Hi, I would like to know if is there any way to create a database table which
I don´t want to allow new entries, just modifying existing records. Something
like the private SQL tables. I don´t want any user with privileges to insert
manually new records, I would like this table to be a Catal... more >>
Determine Nearest Day
Posted by DylanM at 12/29/2005 4:11:02 AM
Hi,
Users of an application can retrieve sales between 2 dates that they pick in
the front end (DateFrom & DateTo)
I have sales data that these values will be used to query, the data is
always summarised to the Sunday of each week.
Before my stored procedure attempts to query, it need... more >>
Best Data Type for a Tracking ID?
Posted by Mark S. at 12/29/2005 2:27:53 AM
Hello,
We're in the table design process and could really use outside thoughts on
our options.
The table in question will grow to several million records. This table will
update and insert depending on what the tracking ID does as it lives out it
day long life span.
Example Stored Pro... more >>
diff between CPU time and elapsed time?
Posted by j.santosh.shenoy NO[at]SPAM gmail.com at 12/29/2005 1:16:47 AM
Hi,
What is the difference between the CPU time and the Elapsed time as
seen in the TKPROF results?
Thanks,
Santosh
... more >>
interval dates
Posted by JTL at 12/29/2005 12:44:25 AM
i want to create a user-defined function that accepts 2 dates and returns
the time difference in days, hours, minutes, and seconds-
for example, a possible result would be something like:
2 days, 17 hours, 46 minutes, 12 seconds
has anyone out there done this before in sql server? any help... more >>
|