all groups > sql server programming > february 2004 > threads for friday february 6
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
UPDATEÎÊÌâ, SQL state 37000 in SQLExecDirect
Posted by kajaa at 2/6/2004 11:27:05 PM
ÎÒÓÃPHPͨ¹ýODBC·¢ËÍSQLÃüÁîÈçÏÂ:
UPDATE Users SET Comment = "192.168.8.1" WHERE ID = 64
ÔÚä¯ÀÀÆ÷¶ËµÃµ½ÈçÏ´íÎó:
Warning: SQL error: [Microsoft][ODBC Microsoft Access Driver] '' ²»ÊÇÒ»¸öÓÐ
ЧÃû³Æ¡£ÇëÈ·ÈÏËü²»°üº¬ÎÞЧµÄ×Ö·û»ò±êµã£¬ÇÒÃû³Æ²»Ì«³¤¡£, SQL state 37000 in
SQLExecDirect in N:\Root_WWW\an... more >>
date time
Posted by Sudha at 2/6/2004 11:11:55 PM
I need to compare only datepart of the two fileds. Any
help please reply
Thanks... more >>
ASP/SQL Query Build - Myth Breaking
Posted by Laphan at 2/6/2004 9:16:02 PM
Hi Guys
I don't want to keep asking for your help all the time on each individual
query, so could you please help me to break the myths on the following:
1) I have 2 tables. Once is called ACCOUNTS and the other ACCOUNTBUDGET.
ACCOUNTS includes all of the usual details for customers and sup... more >>
How: Export Table script in MS Word or Excel
Posted by Ashish Kanoongo at 2/6/2004 8:46:42 PM
Is there any way or tool to export table script of all the tables in MS =
Word - Table and MS Excel?
It saves my lot of time to create db specs for copy each field =
information in word one by one.
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.... more >>
Partitioned Views on Multiple Columns?
Posted by Robert S. Wallace at 2/6/2004 7:26:32 PM
Is it possible to implement Partitioned Views on multiple columns?
While distributing the data by accounting period (i.e. 200401) moves 46
million rows into 12 tables at 3.8 million a piece, we would like to
distribute each 3.8 million in multiple tables as well. We have a column to
base this ... more >>
UNION very slow
Posted by Al Blake at 2/6/2004 5:54:33 PM
I have a view that is composed of a union of 3 selects.
I have timed each of the 3 selects and get the follwing cpu timings:
a: 8656 ms
b: 3422 ms
c: 2516 ms
So all three selects separately take 14594 ms.
Hwoever when joined together with UNION the composite view takes:
283640 ms of C... more >>
Trigger getting recompiled very frequently
Posted by Mo at 2/6/2004 5:47:40 PM
Hi,
Specific trigger and stored procs are getting recompiled
many times (1000 times within an hour) causing huge
blocking and performance issues.
There was no code change and the recompile options are
turned off on these stored procs/triggers.
Any idea as to why this is happening and how... more >>
Difference between "select" and "set" ?
Posted by JollyK at 2/6/2004 5:20:17 PM
Hi there...
What is the difference between betwenn "set" and "select" in the following
context..
[code]
set @variable = 'Hello World'
and
select @variable = 'Hello World'
[/code]
Thanx
... more >>
Don't see what you're looking for? Search DevelopmentNow.com.
Help with SqlStatement
Posted by Jose Ines Cantu Arrambide at 2/6/2004 5:16:55 PM
Hello,
I dont if this is possible to do with a sql statement... I want to know
given the table below which numbers are missing for each code.
CREATE TABLE [dbo].[test] (
[Code] [char] (3),
[Consecutive] [int] NOT NULL
) ON [PRIMARY]
INSERT INTO Test(Code,Consecutive) VALUES ('AAA... more >>
help on sproc
Posted by LonPra at 2/6/2004 5:00:54 PM
Can you give me a hand with the following sproc: I need to write a sproc to
move a file. The file is named Data_20030903.txt and is found in DataIn
folder on the H: drive of the server on which the SQL server instance is
hosted.
After that I need to move the file to the DataDone folder on the ... more >>
update a cursor with where Current of
Posted by Michael at 2/6/2004 4:17:44 PM
Hi,
I am trying to update a cursor, but I alway got this error msg, kindly
please tell me how to do it?
Server: Msg 156, Level 15, State 1, Line 6
Incorrect syntax near the keyword 'SET'.
Thx
Michael
Here is my codes:
Declare @id varchar(30), @desc varchar(40)
DECLARE @C CURSO... more >>
Newbie having problems with update method failure
Posted by Rod at 2/6/2004 4:16:08 PM
Apologies for the what is probably a daft question
We have a VB client accessing a smallish back end SQL Server 2000 database
We have been getting on fine but have a problem when adding a new row to one of the larger cross reference tables in the db (approx 140k rows)
We have established the c... more >>
table variable in IN() clause
Posted by aamirghanchi NO[at]SPAM yahoo.com at 2/6/2004 4:04:29 PM
Hi I have a Table datatype variable that lists all the county names in
the state. Ineed to use this table in the clause "WHERE CountyName
IN(@tblCounties) " of SELECT statement. Obviously I can't use it since
I have not aliased it. But I can not alias it since its not being used
in the FROM cla... more >>
Using Cursors On Enterprise Edition of SQL 2000
Posted by Raja at 2/6/2004 3:25:58 PM
Hi,
We have a new m/c on which the eval version of SQL Server
2000 (enterprise edition) is loaded. We found that when we
use cursors on this m/c the code is taking longer than
usual. The same query when run on a standard edition
database is giving very good performance results.
Why is th... more >>
DATETIME value handling
Posted by douglas at 2/6/2004 3:24:56 PM
Hi all,
What should I do if I want MSSQL 2000 Server automatically store <null>
value into a DATETIME column instead of '1899.12.30', '1899.12.31' and 'AM
12:00:00'.
For Example, If I run the following
Update table1 set column1 = '1899.12.30'
Then... <null> can be automatically store... more >>
Editing Column Formula
Posted by douglas at 2/6/2004 3:18:21 PM
Anyone know how to reference a field name when editing column formula of SQL
SERVER 2000...
Thanks a lot
... more >>
Function
Posted by André Almeida Maldonado at 2/6/2004 3:05:17 PM
Hey guys,
I created a Function, but when I call I receive this error:
'RetornaTotalNota' is not a recognized function name
I call it here:
SELECT a.NotaNume, b.Clienome, a.notadasa, c.vendnome,
RetornaTotalNota(3030) as notatota FROM notas a, clientes b, vendedores c
WHERE b.cliecodi =... more >>
Insert Trigger Issue when exception occurs in transaction
Posted by g_swearingen NO[at]SPAM hotmail.com at 2/6/2004 2:29:53 PM
I have an insert trigger that is used to call an outside program (uses
a VB COM object). After the object is called another SQL statement is
created based off information returned by the COM object.
I want the insert to occur regardless of the results of the COM
object. For example, if the o... more >>
need immediate help.
Posted by kevin at 2/6/2004 2:19:04 PM
I need to update 100 million rows in a table should it be
in few seprate batches or in one go.
I need to update every 10 million rows with a diff.
criteria.
or it could be that a column needs to incremented by a
value 10 for all (100 million) rows.
Thanks a lot.
... more >>
index
Posted by meera at 2/6/2004 2:09:13 PM
what is the diff. between clustered and unique clustered
index.
TIA,
meera
... more >>
dynamic table and column creation...?
Posted by ajaymehra at 2/6/2004 1:54:20 PM
Hi,
Im trying to create a table dynamically and add columns to it base
on a count I pass to my sp.
Heres the code
CREATE PROCEDURE spHoursForDays
@Count Int
AS
BEGIN
Declare
@lsSql Nvarchar(4000),
@Dcolumns Nvarchar(4000),
@lnI Int
Set @lnI = 1
Set @lsSql ... more >>
Analysis Services Memory Bottleneck
Posted by anonymous NO[at]SPAM discussions.microsoft.com at 2/6/2004 1:47:04 PM
I ran Performance Monitor on my OLAP Server and during the
building of cubes the "memory available" went from "141"
in MBytes to "4" and the "memory pages/sec" went from "0"
to a range of "35 to 100". I checked the other counters
and there was no cpu or I/O bottleneck.
The current value... more >>
Dynamic OpenRowset
Posted by dw at 2/6/2004 1:46:05 PM
Hi all. We need to do a IF EXIST with a WHERE clause that has to be dynamic,
and we're using an OPENROWSET. Here's what it looks like,
If Exists (Select a.* from
openrowset('SQLOLEDB','mySQLServer';'myid';'mypassword','select * from
test.dbo.tblDocuments where doc_no = ' + @prmDoc_No) as a)
... more >>
order by
Posted by Abraham at 2/6/2004 1:44:46 PM
select constant ,description from action order by description
--Here description is a varchar datatype. And collation for database is
SQL_LAtin1_General_CP1_CI_AS.
My question is what order the sorting happens.It's not ASCII value because
numbers come before _ in ASCII.
Thanks
constant ... more >>
How can I find a record and get it's fields in a string?
Posted by Trint Smith at 2/6/2004 1:40:49 PM
Ok,
My database name is tribidz. The table name is TBL_BuyrReg. The fields
are bnum fnam lname. The strings I want them in are number1 fname1 and
lname1.
cmd.CommandText = "FIND?? [tribidz].[dbo].[RegBuyer]..
..........
cmd.ExecuteNonQuery()
After changes are made to a 'found' record, ho... more >>
removing duplicates
Posted by TJS at 2/6/2004 1:36:42 PM
trying to remove duplicates with this procedure but it seems to run a *very*
long time
is there something wrong here or a better solution available ??
====================================
CREATE PROCEDURE .[RemDup] AS
insert temptbl
select distinct * from tblRes
truncate table tblRes
... more >>
how to set the database name via variable?
Posted by JollyK at 2/6/2004 1:28:51 PM
Hi folks..
I need to set the name of the database that is required to be used via a
variable and it is not working.
Here is the code that I am using...
[code]
DECLARE @db_name1 varchar(20)
SET @db_name1 = 'abcDatabase'
USE @db_name1
GO
[/code]
With the above code I get an error m... more >>
Need T-SQL Performance Tips
Posted by Gopinath Munisifreddy at 2/6/2004 12:54:17 PM
Hi, can u plz tell where i can find articles related to T-SQL performance
optimization tips.
... more >>
Howto:Handle BCP Errors
Posted by Gopinath Munisifreddy at 2/6/2004 12:41:32 PM
Hi,
To migrate data from one database to another databse I'm generating a
batch file which conatains series BCP commands to import and export data. I
want to pause batch process when an error while running the scripts. If
there is not error i want to proceed further...
Is there any way to h... more >>
Table Contents Last Changed
Posted by Patrick Fogarty at 2/6/2004 12:06:09 PM
I'm trying to develop a piece of software that will cache information
frequently accessed in a database, obviously to reduce the amount of data
being read.
Since the contents of a desired record from a single table may be sizable
and therefore labor-intensive, I want to setup a cascading syste... more >>
convert char to smalldatetime
Posted by killer at 2/6/2004 11:59:18 AM
I have a field cast with data like 30012004
How can i convert this in a field like 30/01/2004?
Thanks
... more >>
System SPs changed to User
Posted by Dale Wilson at 2/6/2004 11:36:45 AM
Hi All
I've noticed that the system stored procs in one of our databases (those
beginning with 'dt_') have a type value of USER instead of SYSTEM. Any ideas
as to how this could have happened and what's the best way to change them
back.
Dale
... more >>
Group by week
Posted by Enggas at 2/6/2004 11:34:40 AM
Hi,
I am having a table with 2 columns, Date and Amount.
Instead of listing the sum of amount for every Date by using "Group by
Date".
I want to list the sum of amount for every week.
Example output:
Week of Amount
1/2/2004 $10
8/2/2004 $8
15/2/2004 ... more >>
Triggers and transaction
Posted by Marina at 2/6/2004 11:28:49 AM
Let's say that an insert/update/delete statement causes a trigger to run.
The statement is running inside a transaction - does the trigger
automatically run inside that transaction as well?
Is there any documentation to this effect?
... more >>
Getting fiscal year
Posted by Eric D. at 2/6/2004 11:27:44 AM
Hi,
Is there a way to get the beginning & ending date of a
fiscal year that begins on April 4 and ends on March 3.
For example:
If I want the fiscal year of 2003 I should get the value
2003-04-01 and 2004-03-31.
TIA,
Eric... more >>
TempDB
Posted by AL_D at 2/6/2004 11:11:10 AM
SQL 6.5 would allow you to locate tempdb in RAM. Is there any way to do that in 2000
Thanks,... more >>
Export Dynamic Crosstab to Excel
Posted by Culam at 2/6/2004 10:57:27 AM
Hi,
I have a Dynamic Crosstab Query that need to export to
excel. Is there a way I could write code to export to
excel automatically, ie stored procedure.
I am aslo looking into DTS approach as well, but I am not
sure if it could be done dynamically. DTS required the
out put file in th... more >>
I read
Posted by sandip at 2/6/2004 10:48:33 AM
Transforming domains into data types and constraints.
I want to know what exactly is domain.
Thanks a lot.
... more >>
Recommended practice for items not on file
Posted by george r smith at 2/6/2004 10:44:43 AM
What is the recommended method for checking if an item is in the database
and if it is not then inserting the new item.
Do you use a try/catch or something else
this
addressBookName = "Primary"
{
addressBookNameId = GetAddressBookNameIdByName(addressBookName);
}
catch
{
addressBookName... more >>
doubt
Posted by sree at 2/6/2004 10:43:07 AM
When converting from a logical to physical data model,
does the software like erwin automatically generates the
DDL script (for any db like sql server, sybase or
oracle) or do we have to generate the script manually.
Thnaks a lot and have a good day.... more >>
What is the command to call a sql script file from within another sql script?
Posted by JollyK at 2/6/2004 10:40:17 AM
What is the command to call a sql script file from within another sql
script?
For example,
suppose I have a script file called tables.sql and in that script file i
have "create table" statement. Now within the tables.sql file i want to call
another script file called proc.sql which contains a... more >>
Cursors in UDF
Posted by Vern Rabe at 2/6/2004 10:35:05 AM
SQL Server 2000, SP 3. The following returns the
error "Server: Msg 1049, Level 15, State 1, Procedure
AnyFn, Line 7
Mixing old and new syntax to specify cursor options is not
allowed." Eliminating the INSENSITIVE eliminates the
error. Since cursors in UDF's cannot be global, at first I
t... more >>
clustering sequence
Posted by sandas at 2/6/2004 10:32:17 AM
what is "clustering sequence for the data "
any thoughts.
TIA.
... more >>
index type
Posted by shandy at 2/6/2004 10:29:29 AM
I just know clustered and non clustered indexes. How do I
find that which is the catagery of my index. for example.
b-tree, bit map, reverse key, hash, partitioning, etc.
This news group has been very useful in the past.
Also I want to know what is the diff. between clustered
and unique cl... more >>
need more ideas on importing delimited text files
Posted by TJS at 2/6/2004 10:19:41 AM
I need to import delimited text files (several thousand records each) on a
shared hosted website:
currently building insert statements from ASP.net file but this is pig slow
and burns way too much cpu.
Constraints:
- webhost locked out bulk insert ( says it is a security risk )
- building ... more >>
Error suppression
Posted by JMNUSS at 2/6/2004 10:17:38 AM
in ss 7.0
Ok, try and stay with me.
We use an SS xp to uncompress a varbinary bitmap so that
we can convert them to display in Crystal Reports. When
the query is run directly against the data base we get get
most of the records that we expect to see BUT we also
receive and error. The... more >>
DTS as ETL tool
Posted by pooja at 2/6/2004 10:15:13 AM
I need help, Can anybody pls tell me how Microsoft DTS
can be used as ETL tool. This is what i have been asked
in a recent int.
Thanks a lot.... more >>
SQl-Query "...not in..." ??
Posted by Hans Pickelmann at 2/6/2004 9:56:08 AM
Hello
I have a´Problem with the following SQL-queries. I don't get the expected results..
Select ID, POnr FROM dbo.WEingang where id=22
Ergebniss
ID PoNr
----------- -----------
220 15
it's okay..
Select ID, POnr FROM dbo.AssetManagementOld where fk_WEing... more >>
UPDATE query and memory leak
Posted by Jarek Mielcarek at 2/6/2004 9:19:05 AM
hello,
I'm vb6 and ado programmer. I decide to transfer my db from access to
msde and now I've problem with some UPDATE query which consume memory.
here's example:
m_oConnection.Execute "UPDATE tblOrderLine SET " & _
"OrdRef='" & Me.OrderRef & "'," & _
"BuCodeCnee='" & Me.Bu... more >>
Cannot debug SPs from client workstations
Posted by Carlitos at 2/6/2004 9:08:55 AM
This is not the first time I have posted this problem, and at this point I
have not found a solution.
We cannot debug SPs from client machines. We have to go to the server to
debug.
We have tried several suggestions and checked things out. Permissions to
sp_sdidebug, DCOM configuration, s... more >>
With data in records, how can I find and edit one?
Posted by Trint Smith at 2/6/2004 9:02:14 AM
Ok, my program connects and enters a record...how can I find that record
and edit it? Any vb code is appreciated.
Thanks,
Trint
.Net programmer
trintsmith@hotmail.com
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!... more >>
Insert Trigger Help
Posted by g_swearingen NO[at]SPAM hotmail.com at 2/6/2004 8:44:41 AM
I have an insert trigger that is used to call an outside program (uses
a VB COM object). After the object is called another SQL statement is
created based off information returned by the COM object.
I want the insert to occur regardless of the results of the COM
object. For example, if the o... more >>
Sorting and server-side recordsets
Posted by Casey at 2/6/2004 8:42:45 AM
Greetings:
I have a data grid that is bound and needs to support user-defined sorting.
The sorting would be like click on a column header and sort Asc/Desc based
on previous sort.
The thing I'm running into is that you can't sort on server-side recordsets.
I had this problem earlier but was... more >>
how to find out how many columns in one table??
Posted by cody at 2/6/2004 8:36:05 AM
hi
I am struggling find out how many columns in one table programmablly! I can find out the column name using : select col_name(OBJECT_ID('line'), 2), is there any way to know the number of columns so as to i can use the metadata function col_name(table_id, column_id) to loop through all the col... more >>
Using user-defined functions
Posted by Cold at 2/6/2004 8:06:11 AM
I want to create and use a user-defined function. I have tried to use an example found in internet. The function is
CREATE FUNCTION dbo.DBCreationDat
( @dbname sysname
RETURNS datetim
A
BEGI
DECLARE @crdate datetim
SELECT @crdate = crdate FROM master.dbo.sysdatabase
WHERE name = ... more >>
passing a variables to SUM function
Posted by shaab.mohagir NO[at]SPAM bonbon.net at 2/6/2004 7:38:39 AM
I'm trying to pass a variable @colname to the SUM function after I got
the variable value from the sql below, the result of the SUM is not a
number bu the actual field name!!!!
I tried to cast the @colname to a varchar but still the same results.
Any help is appreciate.
------------------... more >>
Using >1 columns in a Not Exists Clause
Posted by Cathryn Lindner at 2/6/2004 7:31:40 AM
I'm trying to grab records that aren't in another table with the same
combination of 2 fields. I can get it to work with:
Select Col1, Col2 Into #tmp from Table1
Then delete the rows that already exist in the table that I'm comparing:
Delete #tmp
From Table1, TableCompare
Where Tabl... more >>
Comparing > 1 column using Exists Clause
Posted by Cat at 2/6/2004 7:26:06 AM
I'm trying to grab records that aren't in another table with the same combination of 2 fields. I can get it to work with:
Select Col1, Col2 Into #tmp from Table1
Then delete the rows that already exist in the table that I'm comparing:
Delete #tmp
From Table1, TableCompare
Where Table1.Col1 =... more >>
Good example of Excel to SQL Server writeback samples
Posted by belindacur NO[at]SPAM yahoo.com at 2/6/2004 7:09:50 AM
Can any of you please point me to some good samples on Excel to
SQL Server tables writeback templates or samples.
Thanks
Belinda... more >>
How to fix this error : Cannot resolve collation conflict for equal to operation.
Posted by jeancarter NO[at]SPAM glanbia.ie at 2/6/2004 7:04:35 AM
I'm new to Sql server.
I'm trying the following query below and the error is as follows
Server: Msg 446, Level 16, State 9, Line 1
Cannot resolve collation conflict for equal to operation.
The join involves 2 tables each from a different database.
SELECT DISTINCT A.USER_ID, p.NAME
FR... more >>
Query help -- if possible
Posted by Peter Newman at 2/6/2004 6:30:29 AM
I have a query thiat i use to produce a direct Debit
collection file. I would like to modify it so that it
obly shows the balance due on the accounts, ie if there
is a credit applied to the account, then deduct ir from
the invoice balance
Credits are as + figures
Debits are as - figures
... more >>
A SQL Query Question
Posted by Cyont at 2/6/2004 6:07:39 AM
I feel bad to ask this kind of question. But I am running out of options
because the time is almost up and my SQL knowledge is limited. This might
be a very simple question to some of you. If you could give me a solution,
I would be really appreciated.
This is my problem:
I have to tables,... more >>
Know the "Country version" of SQL Server
Posted by paolo.riba NO[at]SPAM email.it at 2/6/2004 3:39:18 AM
Hi!
How I can know the "Country version" of SQL Server using VB.NET
(perhaps with the SQLDMO)?
I mean: if the SQL Server is in "English version" or in "Italian
version" or ...
Thank you so much!!
Bye... more >>
Triggers, set based.
Posted by Stijn Verrept at 2/6/2004 2:20:59 AM
Already posted this, but with wrong title and got no responses, I'm
explaining in more detail now.
Triggers are working set based. Now I have this instead of insert
trigger that I need to make which inserts invoiceslines. Sometimes the
amount of the invoiceline is depending on the the amount... more >>
need some quick tips
Posted by toylet at 2/6/2004 12:02:29 AM
what are the t-sql for:
1. list available database on a sql server
2. list the names of tables in a database
3. list the column names of a table
4. list the structure (ie, column definition) of a table
which chapter in Books-OnLine should I read?
--
.~. Might, Courage, Vision. ... more >>
|