all groups > sql server programming > july 2007 > threads for wednesday july 18
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
Linked Servers... Connection timeout
Posted by Gowtham at 7/18/2007 9:42:02 PM
Hello all!
I am writing a stored procedure in SQL SERVER 2000 that queries multiple
remote databases.
When one of them timesout, it will give the error 7399
Error Log:
----------------
Server: Msg 7399, Level 16, State 1, Line 1
OLE DB provider 'SQLOLEDB' reported an error.
[OLE/DB... more >>
Field has higher value than another field
Posted by scuba79 at 7/18/2007 6:34:01 PM
I trying to create a table that will hold mileage of a vehicle.
create table vehiclelog
(
DateOfUsage [Datetime] not null default (getdate()),
StartingMileage [int] not null,
EndingMileage [int] not null
)
When a user enters information in the table, is there a way to check to make
sure... more >>
how to load covariance matrix...
Posted by GB at 7/18/2007 5:27:20 PM
Hello, I need to load covariance simmetrical matrix 24 by 24 from .csv file
to SQL Server table.
Could you give me a hint how to do that?
Thanks,
GB
... more >>
Compound INSERT SELECT FROM WHERE subquery problem MySQL -> SQL Server 2005 conversion
Posted by raylopez99 at 7/18/2007 4:50:00 PM
This SQL language is nuts, just nuts. How does anybody put up with
such a crude scripting macro language?
First, I found out that the curly ' (apostrophe) is not the same as
the straight apostrope.
Then I'm trying to convert a MySQL data statement into a MS SQL Server
2005 data statement (... more >>
Case Statement
Posted by SQLKID at 7/18/2007 4:22:01 PM
I'm trying to use the case statement. Now when I say a field is one value it
works fine.
select e.[Posting Date],e.[Document Date], e.[Orig Doc Number],e.[Orig
Amount], e.[Document No_], e.[Amount], f.[G_L Account No_], f.[GL Entry
Amount], case f.[G_L Account No_] when '53100' then 'Ince... more >>
short wired doesn't exist in select statement?
Posted by Zester at 7/18/2007 3:29:19 PM
In other programming languages I'm more familiar with C, C++, C#.
if( A is true, then there is no need to evaluate expressionB.
if( expressionA OR expressionB )
{
// more code here
}
I was writing a trigger and i ran into this. If I only modify rows that has
IsTypeX = 0, it still t... more >>
import data from excel into existing table sql server 2005
Posted by soni2926 NO[at]SPAM yahoo.com at 7/18/2007 2:07:56 PM
Hi,
I currently have a table with the following structure in sql server
2005
UniqueID
StoreID
EType
StartDate
EndDate
DateCreated
my excel sheed provides me with values for
StoreID
EType
StartDate
EndDate
when I try to do an import I keep getting the following error:
Cannot insert... more >>
Ordering a Grouping By Dates
Posted by Dave at 7/18/2007 1:21:53 PM
I have a query that groups a count of events for each day. It looks like
this:
SELECT EventType
,convert(varchar,createdate,107) AS 'fdate'
,Count(statsid) AS 'CountOfstatsid'
FROM stats
GROUP BY EventType
,convert(varchar,createdate,107)
ORDER BY convert(varchar,createda... more >>
Don't see what you're looking for? Search DevelopmentNow.com.
Using Aggregate within SELECT
Posted by David C at 7/18/2007 1:01:31 PM
I have a select that I want to get the sum of 4 computed columns but I can't
get it to work. The YTD column is giving error. Can someone help? Thanks.
TSQL is below:
SELECT dbo.Employers.EmployerID,
dbo.Employees.EmployeeNumber,
SUM(CASE WHEN [CheckDate] BETWEEN [Qtr1Start] AND [Qtr... more >>
Help TEMPDB is getting filled
Posted by Dennis Black at 7/18/2007 12:51:52 PM
Hi,
The TempDB on one of our production DB is filling up to the point where
SQL server eats up all memory on the machine. I wanted to use the
"Profiler" to check the queries but this problem gradually occurs over a
period of 2 weeks and it very difficult to find out which query is
eating ... more >>
SQL server express 2005 DTS?
Posted by Manekurt at 7/18/2007 12:39:26 PM
Hello to all,
I need to know if there is a way to transfer a query data between 2 sql
server express 2005 databases.
Thank you all
... more >>
Help with an update - need to remove character in certain rows...
Posted by at 7/18/2007 12:12:15 PM
I have a varchar(10) field call PartID that has to store numbers as
strings (due to items like 1.10, not being the same as 1.1) the
trailing zero does matter in this case. However, the fields has some
rows that have items like 6.0, where the .0 is not needed (and in fact
is breaking compariso... more >>
Error in CREATE TRIGGER
Posted by Curious at 7/18/2007 12:05:39 PM
I've created a trigger as below. It complains about the last line:
"Msg 178, Level 15, State 1, Procedure TGWritebackUpdate, Line 99
A RETURN statement with a return value cannot be used in this
context."
Anyone can tell me what's wrong?
---------------------------------------------------... more >>
sys.dm_exec_query_stats
Posted by AlexS at 7/18/2007 11:55:56 AM
Is there similar view which can show stored procs statistics?
... more >>
Disable index or drop & create index
Posted by SqlBeginner at 7/18/2007 11:16:01 AM
Hi,
I have a DB (sql 2005) which is used maintly for reporting purpose. Once in
two or three days only fresh data would be added into it.
So i was thinking when ever data is going to be populated into it we can
"Disable" (Alter syntax) all existing Indexes. Then add new data then would
"... more >>
How write this sentence with T-SQL
Posted by SQL SERVER at 7/18/2007 11:05:38 AM
Hi, all friends. I'm using SQL-SERVER 2000.I have a table like this:
NIF Name
----------------------------------------
A-1234 Company1
B-123-B1 Company2
C-4568 Company4
D-453-DF Company5
I want delete the symbol "-" in the row "NIF". eg. A-... more >>
Kill @SPID DOES NOT WORK
Posted by Lamborghini at 7/18/2007 10:46:03 AM
Hi,
I am trying to make sure that there are not connections to a database before
I restore a database programmatically.
When it gets to this line of code, it seems to only like a number itself
instead of a variable.
How do you clear the processes attached to a database programmatically?
Any ... more >>
Backup SQL 2000 Database using SQL 2005 Management Studio
Posted by Divyesh at 7/18/2007 10:01:28 AM
Hello,
I am using SQL 2005 Management Studio to connect to a SQL 2000
server. I was wondering if anyone knows of any issues in doing a
backup of a SQL 2000 database from 2005 Mgmt Studio?
Thanks...
Divyesh
... more >>
Returning multiple count values using Like with wildcards in an MSSQL Query
Posted by Karl Rhodes at 7/18/2007 9:06:30 AM
Hi all,
I've been pulling my hair out with this over the last few days as I'm
sure it must be possible but no matter what I try it fails somewhere
along the line...
In a table containing flattened user data, I have a field which holds
the users flattened hierarchy relative to where they are... more >>
INCLUDE in primary key
Posted by Jan at 7/18/2007 7:28:01 AM
Hi,
I love the INCLUDE feature to create covering indexes.
Now I am in a situation where the index I need already exists as a
nonclustered primary key; so it would be interesting not to duplicate this,
but to add the covering column. Is there a way to do this? I would have
expected this in... more >>
How to execute SQL code stored in a table?
Posted by miodrag.vidanovic NO[at]SPAM googlemail.com at 7/18/2007 7:15:04 AM
Hi,
I'm not an expert on MS SQL and I've run into a dead end. So, here's
the problem:
Let's say we have a table called "Updates" and this table contains
text column containing simple SQL statements
I would like to read and execute these SQL statements using a stored
procedure. No luck ;)... more >>
subtotals using procedure
Posted by Reddy at 7/18/2007 6:26:00 AM
I need subtotal in my output based on group column.
example:
results output
Dept No empid amount
101 1234 $120
101 2345 $320
201 2354 $150
201 3456 $120
I need to the out put something like this
Dept No empid amount
... more >>
Can you know the creator of a table ??
Posted by Hadidi at 7/18/2007 6:22:00 AM
Hello,
My domain users group are added to SQL server logins as one group, this
login has a sysadmin server rule.
when anybody creates a table or SP , the owner is assigned to owner.
But for some reason I want to know the table creator identity, Is it
possible ??... more >>
TRY CATCH BLOCKS IN SQL SERVER 2005
Posted by Prasad Peesapati at 7/18/2007 6:04:00 AM
Hi,
I have a question about the try/catch blocks feature in SQL Server 2005. We
know that when an error is generated in the try block, control passes on to
the catch block. But, what happens if there is an error generated in the
catch block itself? I mean, if there are 10 lines of code in t... more >>
Writing a SELECT that outputs char when a numeric column is NULL
Posted by bostonguy NO[at]SPAM gmail.com at 7/18/2007 5:51:47 AM
I am trying to write a SELECT that outputs a string when a money
column is NULL like so:
SELECT CASE
WHEN t.Salary IS NULL THEN 'No money'
ELSE t.Salary
END AS 'Your Salary'
FROM MyTable t
OR
SELECT ISNULL(t.Salary, 'No money') AS 'Your Salary'... more >>
Get time part of a timestamp
Posted by pascalbellerose NO[at]SPAM gmail.com at 7/18/2007 4:36:17 AM
Hi,
I could not find a built-in function that would let me extract the
time part of a timestamp value.
Could someone teach how to extract this value in an Ms Sql Server 2005
environment?
Thanks!
... more >>
login is locked out
Posted by Paul at 7/18/2007 3:52:04 AM
Hi,
SQL 2005 Standard 64bit on windows server 2003 64bit.
I have a user account that has become constantly locked out. I have had
this issue on another server running SQL 2005 standard on a 32bit windows
2003 server.
If I enable the account, close and reopen the Login Properties, it is loc... more >>
"Not enough memory for operation"
Posted by Nethesh at 7/18/2007 3:22:00 AM
My Microsoft Visual Basic 6.0 application uses Crystal Reports 8.0 as the
reporting development tool. After the application is distributed to a client
computer, when the application attempts to load a report the following error
message appears:
"Not enough memory for operation"
NOTE :
T... more >>
ER modelling is not part of relational model
Posted by kaja_love160 NO[at]SPAM yahoo.com at 7/18/2007 3:09:53 AM
hello
I tried to post the following questions in a thread I made several
days ago,
http://groups.google.com/group/microsoft.public.sqlserver.programming/browse_thread/thread/a16f0805cc392a4d/d18a6eccb9dcad00#d18a6eccb9dcad00
but for some reason my posts didn't appear in that thread. I apol... more >>
Calculating the number of years,months and days between two dates
Posted by Wilko at 7/18/2007 2:22:00 AM
I have been puzzling over the best way of working out the number of
whole days, weeks and years between two dates. This is for displaying
the length of a contract. I have now completed a function that seems
to work but I am sure there must be a more elegant solution.
My basic logic involves lo... more >>
Rollback in triggers
Posted by Fred at 7/18/2007 1:42:02 AM
Is possible to raise an error inside a trigger that will automatically
perform a rollback?
I know that I can call RollBack within the trigger, but this generates a
error:
Msg 3609, Level 16, State 1, Line 1
The transaction ended in the trigger. The batch has been aborted.
What I want is:... more >>
Joining on a table which has more than 1 record
Posted by Matt Urbanowski at 7/18/2007 1:09:41 AM
Hi.
I have a table (table1) with an ID which relates to an ID value in
another table (table2).
However, in table2, there is often more than 1 record with that ID.
Take the following example:
Table1:
Table1ID Table2ID
1 1
2 2
Table2:
Table2ID ... more >>
Need help with a INSERT SELECT
Posted by Marc Robitaille at 7/18/2007 12:02:09 AM
Hello,
I need help with this one. This is my table.
PK FK Date
1 1 2007-01-01
2 1 2007-02-01
3 1 2007-03-01
4 2 2007-01-01
5 3 ... more >>
sql 2k5
Posted by AlexS at 7/18/2007 12:00:00 AM
Is there any tool allowing to see server logs on Sql2k5 and sequences of
actions performed?
Something like journal functions' on AS400/iSeries?
... more >>
Using In statement
Posted by Paul at 7/18/2007 12:00:00 AM
I am trying to use the in statement where I pass the list of values as a
string.
I.e
Select id
From table
Where cast(id as varchar(50)) in (@pid)
Id is initially a int field and @pid is a varchar set by a web page as "
'5','7','40' "
The query runs but does not return any values .
... more >>
Need to know original column name from the Alias
Posted by deepak at 7/18/2007 12:00:00 AM
Hi There,
i have a requiremet ,where in i have a view which has some alias.so at
runtime using an application i will get the info about the view using
SP_HELP stored proc,but this only gives me the alias names ,but i
need to know the original column name(as in the table defintion part
of t... more >>
Timeout errors
Posted by Michael C at 7/18/2007 12:00:00 AM
Why is it that sqlserver still uses timeouts when executing a command? Isn't
this the most primitive form of programming that was abandoned some time in
the 1980s? Especially seeing sqlserver has a habit of using up all available
ram and taking long times on occassions to execute the most simp... more >>
Select issue
Posted by Matt Day at 7/18/2007 12:00:00 AM
I am using a DTS package to update some tables in an online database and
have run into trouble with one of the tasks.
The SELECT I'm using is;
SELECT DISTINCT d.ITEMRELATION, c.CONFIGID, d.FROMDATE, d.TODATE,
d.ACCOUNTCODE, d.ACCOUNTRELATION, d.AMOUNT, u.TXT
FROM PRICEDISCTABLE AS... more >>
SQL Query - count time in table
Posted by Leszek Gruszka at 7/18/2007 12:00:00 AM
When I run query from below, I'm getting incorrect result.
Can someone help me with correct query, that will count datetime from one
day, without overlaped time?
First query is counting time with overlap, second is counting overlap. And I
need a result first-second query.
SELECT (
SELECT... more >>
Where do you get the installation files for sql server 2000 reporting
Posted by YardDancer at 7/18/2007 12:00:00 AM
my apologies for this repeat posting but I am in a hurry on this one!
Where do you get the installation files for sql server 2000 reporting
services from?
I know you can get a 120 day evaluation version from the Microsoft.com.
Where do you get the commercial copy from. I have tried Amazon.... more >>
SELECT inside of CONVERT
Posted by 8675309TT NO[at]SPAM gmail.com at 7/18/2007 12:00:00 AM
I am trying to convert a field value to the length from another table.
Basically try to truncate the data so it will fit into another
table. My question can I put the select statement in place for the
length of the varchar?
Ex...
convert (varchar(100), Field_Value)
SELECT Field_Value,
... more >>
SQL DB PASSWORDS
Posted by sam at 7/18/2007 12:00:00 AM
How do I add, change and remove a password from a existing DB
TIA
Sam
... more >>
|