all groups > sql server programming > july 2006 > threads for thursday july 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 30 31
Cursor Question
Posted by Chris at 7/6/2006 9:12:02 PM
I have a cursor that pulls the name of the tables one by one on my server and
I need to use it in a sql statement to compare the counts to the same table
names in another server. How can I get the Cursor that holds the name of the
table to work in the from clause? It keeps giving me an error.
... more >>
[SQL2000] How to retrieve this value in activex?
Posted by Sphenixs NO[at]SPAM gmail.com at 7/6/2006 8:00:28 PM
This is the code where I retrieve the value from the task
'**********************************************************************
' Visual Basic ActiveX Script
'************************************************************************
Function Main()
Dim DTS, ExecSQL, SQLStatement
Set ... more >>
view vs table & when
Posted by sali at 7/6/2006 6:38:51 PM
is there supposed to be some significant overhead or other difficulty for
example:
select *
from table1
where deleted=0
and year(datefield)=2006
compared to:
select *
from view1
where year(datefield)=2006
assuming view1 is view created on table1 where deleted=0
the idea is to hi... more >>
insert query runs in Query Analyzer, but not in Job
Posted by Randall Arnold at 7/6/2006 5:07:22 PM
I created the following query to perform an hourly update grabbing data from
a linked server (mpws_live) and placing the new rows in my personal server
database (asoqa):
insert into ASOQA.dbo.MPWS_L_DNN SELECT * FROM OPENQUERY(mpws_live, 'select
* from dbo.L_DNN') a where a.create_ts not in... more >>
COALESCE and data types
Posted by Vern Rabe at 7/6/2006 4:33:02 PM
What are the steps that occur during a COALESCE execution? The following
script exemplifies my question:
DECLARE @c char(10), @v varchar(1);
SET @v = '5';
SELECT COALESCE(@c, @v) + ']',
DATALENGTH(COALESCE(@c, @v) + ']'),
LEN(COALESCE(@c, @v) + ']'),
DATALENGTH(COALESCE(@c, @v)),
LEN(... more >>
stored proc with cursor for inserts becomes slower
Posted by P Platan at 7/6/2006 4:22:23 PM
Hi
I have a procedure that contains a trigger(fast forward read only) which
takes ~300000 records from a table in database A and inserts them in 4
tables in a database B. (We do this because we are in a transition to jump
from the old db schema to a new one and we keep the dbs synchronized)... more >>
INSERT raws from another table
Posted by Hitesh at 7/6/2006 2:51:40 PM
Hi,
I have two almost identical tables in two diff databases... let's say
tbl1 and tbl2. The only diff is that tbl2 has one more column called
date.
I want to insert any raws that is not in tbl1 but exists in tbl2 and
also want to insert today's (current date) when I insert all those
raw... more >>
Update statement too slow .....
Posted by Balaji Rajaraman at 7/6/2006 2:35:46 PM
All,
In Sql Server 2000, Update statement in a stored procedure is too slow.
The table holds more than 30 milliion records and i am trying to update
the records.For updating the records i am joining an another table
which also contain 30 million records(i have indexed the column that i
have use... more >>
Don't see what you're looking for? Search DevelopmentNow.com.
Stored Proc: Re-Assigning Parameters to declared variables
Posted by honusbam at 7/6/2006 2:29:01 PM
I have a proc with three parameters:
@tmpStartDate1 datetime,
@tmpEndDate1 datetime,
@tmpSkuNbr1 nvarchar(15)
When I run the query with hard-coded values, the query runs super-fast, like
3 seconds or less. However, when I convert the query to a proc with the
aforementioned parameters, ... more >>
Implementing a Business Rule
Posted by Alexander Kuznetsov at 7/6/2006 2:23:35 PM
I need to implement a business rule. Here is the original DDL:
create table parent(parentID int not null,
ValidFrom datetime not null, ValidTo datetime not null)
go
create table child(childID int not null, parentID int not null,
ValidFrom datetime not null, ValidTo datetime not null)
B... more >>
Locking tables for UI
Posted by lord.zoltar NO[at]SPAM gmail.com at 7/6/2006 2:18:16 PM
Part of my application displays a Datagrid of rows from a table.
Double-clicking a row will bring up a detailed edit window which allows
editing. To confirm the changes, the user presses a "save" button which
commits the transaction. It is possible (and quite likely) that
multiple users may try ... more >>
missing rows in procedure output
Posted by Keith G Hicks at 7/6/2006 1:57:46 PM
I'm getting a result set that seems to be missing some rows in one
situation. I have some code like this in a stored procedure:
Select * From vwCustomers
vwCustomers is a view on several different tables.
When I run Select * From vwCustomers in QA all by itself it returns 88 rows.
When I ... more >>
Sub Queries and Performance
Posted by arock at 7/6/2006 1:53:34 PM
I need some suggestions. I am currently trying to enhance the
performance of a stored procedure that uses sub queries to sum some
cumulative values. Here is an example with 1 sub query:
---------------------------------------------------------------------
SELECT
T.period_number, T.Weekending,... more >>
xp_sendmail @subject problem
Posted by Matt Sonic at 7/6/2006 12:43:03 PM
When I do this the record is added but I don't get an email. The @subject is
causing the problem because if I remove it, it works.
CREATE TRIGGER tExpressItemAdded ON [dbo].[ExpressItems]
FOR INSERT
AS
Declare @ID as nvarchar(100)
set @ID = (SELECT ExpressItemID FROM Inserted)
Declare @r... more >>
Use Management Studio to Update MS Access db?
Posted by Jeremy at 7/6/2006 11:08:34 AM
Can I use Management Studio to connect to a MS Access '97 database? I want
to update some data in the .mdb file before bringing it over to SQL Server.
I don't want to issues these [many] queries from within MS Access (I just
prefer to use Management Studio or Query Analyzer rather than MS Acce... more >>
Is null and indexes
Posted by RLoski at 7/6/2006 9:54:02 AM
I have a set of queries that I run against a SQL Server 2000 database:
-- Statement 1
select count(*) from myTable
-- Statement 2
select count(*) from myTable where col is not null
-- Statement 3
select count(*) from myTable where col is null
-- Statement 4
select count(*) from myTab... more >>
SQL Table Design Question
Posted by jonfroehlich at 7/6/2006 9:18:43 AM
I am relatively new to SQL server. I am currently using SQL Server
Mobile 2005 to store user response data, which can either be text or
binary. If I understand the documents correctly, I can use the SQL
datatype "image" to store binary data of any kind. I'm wondering which
design below is the pr... more >>
Auditing MSSQL 2000 Data Changes
Posted by Jordan at 7/6/2006 9:02:06 AM
I'm looking for advice and insight into best practices in auditing.
We have a new application coming online in the next year and are defining
auditing requirements now. We want to be able to: identifiy who/when/what
changed in a particular record for select tables. This is going to be a
lar... more >>
Date Calculation for n days ago
Posted by Patrix317 at 7/6/2006 7:54:01 AM
Just a quick question that I'm stumped on getting an answer:
I have a date field in my table and would like to select those records that
are n days old. Example: Show records that are 17 days old:
[fldDate] >= GETDATE() - 17
Unfortunately, it doesn't pick up records that are exactly 17 d... more >>
Your thoughts???
Posted by AJ at 7/6/2006 7:52:02 AM
Hi all,
Below is a copy of a discussion i have been having at my work with some other
developers and IT crew. I must confess, having used by MySQL & MS SQL, i
much prefer MS SQL; for me it is the case of MySQL = Good, MS SQL = Best.
Anyway i am posting the result of this discussion to see ... more >>
Restoring the master database
Posted by Sammy at 7/6/2006 7:49:02 AM
Is there any point in restoring the Master Database the company I am in
restore it each quater for a clean up. I see no point unless it was danmaged
does anyone else do this.
thanks for any advice
Sammy... more >>
Pirmary Key versus Unique Index
Posted by GCeaser NO[at]SPAM aol.com at 7/6/2006 7:15:47 AM
OK - So I have read about the difference between the two and summarized
them below:
1. Unique index defaults to non-clustered - Primary Key index defaults
to clustered
2. Unique indexes allow nulls in columns - Primary Keys do not.
This seems to sum up the technical difference between the... more >>
Distributed transaction from trigger
Posted by muted.p NO[at]SPAM gmail.com at 7/6/2006 4:41:03 AM
There are two servers with Win2k (SP4) in LAN. MS SQL 2000 SP4 has
installed on the first server and MS SQL 2005 - on the second.
There is a DB on every servers. Both of DBs have a table t1 with
structure: (ID int, PCT int). Both of table have a triggers for update.
For table on MS SQL 2000:
... more >>
Paging in Sql 2k
Posted by SqlBeginner at 7/6/2006 4:22:01 AM
I have a table without any PK (pls don't ask me why :) ). I need to do paging
using the records in the table. Can anyone help me in the right direction.
Regards
Prasanth... more >>
How to Convert binary into Image
Posted by Andry Cahyadi at 7/6/2006 4:02:02 AM
Dear All,
I am new in my office, i have a job to make a report...I must convert Binary
data to Image in Excell.
I don't know how to make that, Can u all help me, plz, it's very urgent..
I have a data like this
0x424DBE7B000000000000360000002800000059000000760000000100180000000000887B00008... more >>
Update Table
Posted by Selvarathinam at 7/6/2006 2:32:15 AM
Dear All,
I created a new table as TABLE15 to import few columns from TABLE10.
The table was created with the below query.
SELECT INVNO, SUM(ADJUST)
INTO TABLE15
FROM TABLE10
GROUP BY INVNO
HAVING SUM(ADJUST) <> 0
However, TABLE10 rows were updated on daily basis. Now I need to
updat... more >>
'Containing text:' option of Windows Search not working in *.tql f
Posted by Bob at 7/6/2006 1:23:02 AM
When using Windows Explorer to search my template (*.tql) files for certain
text, it's not returning any results. Has anyone come across this before?
I'm using Windows XP and have both SQL2K and 2005 installed. The .tql files
are now associated with 2005. Does this make a difference?
I'... more >>
log shipping error
Posted by VSS at 7/6/2006 12:00:00 AM
I m getting following error in copy/restore operation
"The process cannot access the file because it is being used by another
process."
This come against the file first_file_000000000000.trn every time copy
restore is done. Only first time it went successful. Error number is 32.
Please tell... more >>
Displaying table/view schema
Posted by Robert Bravery at 7/6/2006 12:00:00 AM
HI all,
I have used this statement to display rows from an excel worksett range:
Select * from OPENROWSET('Microsoft.Jet.OLEDB.4.0',
'Excel 8.0;Database=C:\work\coke\Detailed P&L June RE.xls', 'SELECT top 1 *
FROM [import1] order by f1 desc')
How can I find out the schema for such
Thabk... more >>
Text datatype
Posted by Microsoft at 7/6/2006 12:00:00 AM
hi,
i have a string variable with a length of more than 30000 chars which is
populated
from external system.
i'm unable to handle the string using any stored procedurs. and im unable to
use
text datatype in stored proc.
please suggest how to handle this lengthy string
-dnk
... more >>
|