all groups > sql server programming > september 2006 > threads for monday september 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
add parameter within openquery
Posted by Tango at 9/18/2006 10:17:01 PM
Hi,
is it possible to add a parameter into an openquery which is a oracle
database ??
here is my query
select derivedtbl_1.XYZ1, derivedtbl_1.XYZ2, derivedtbl_1.XYZ3
FROM OPENQUERY(HODEV1, 'select T.XYZ1, T.XYZ2, T.XYZ3
from ACCOUNT A , TRANSACTION T where A.XYZ1 = T.XYZ1 and
(T... more >>
How select a date Range
Posted by hon123456 at 9/18/2006 9:48:15 PM
Dear all,
I got a table like this:
month year
amount
4 2006
10
5 2006
20
... more >>
Newbie Trigger: Remove main record, tag records in another table..
Posted by Dia Nagele at 9/18/2006 9:37:01 PM
I want my trigger to ..update a bit column wherever the ID exists.
How can I do this?
What I have threw together so far:
CREATE TRIGGER RegInfo_tbl_Del
ON RegInfo_tbl
for DELETE
AS
Declare @Registrant As Int
SELECT @rcount = @@rowcount
IF @rcount =0
return
select @Registran... more >>
rename a sql login
Posted by qjlee at 9/18/2006 9:36:01 PM
Hi,
I have a user with a sql login name as "abc" and I want to change it to "efg".
Can you tell me which statement to use?
Thanks,... more >>
NOLOCK vs READ UNCOMMITED
Posted by laimis at 9/18/2006 9:14:28 PM
I am learning some stuff about transactions and I arrived at the
question which goes something like this:
what is the difference between
SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED
SELECT * FROM TableName
and
SELECT * FROM TableName (NOLOCK)
assumming that I don't know anythin... more >>
sql statement for querying dynamic columns
Posted by benliu at 9/18/2006 9:13:08 PM
I am working on a project in which a customer wants to be able to list
and search their inventory and display the items in a table/grid on a
web page.
Each item in their inventory has a set of properties - for example,
manufacturer, price, serial number, name, etc. The complicated part is
th... more >>
recording 1,45 he records in the base 145,00
Posted by Frank Dulk at 9/18/2006 8:11:18 PM
I have an application all done in VB with base Access and Oracle.
I migrated the base for SQL Server Express, the problem this now in the
decimal numbers.
When recording 1,45 he records in the base 145,00
In the oracle it was enough to alter the section for " alter session set
nls_territory... more >>
Starting SQL server from code
Posted by Rob at 9/18/2006 6:22:24 PM
Bit of an question of "don't be so idle" but...
On my PC at home, I don't start SQL up by default as it slows down start-up
and uses up memory. However, I always forget to start it when doing
development on a program I'm writing so it would be real neat if I could add
a bit of start-up code... more >>
Don't see what you're looking for? Search DevelopmentNow.com.
How To Select a Certain Limited Number of Rows Per ID?
Posted by unabogie NO[at]SPAM gmail.com at 9/18/2006 5:46:16 PM
I have a table with entries tied to a membership database. The problem
is that I want to select a limit of sixteen entries per member, per
day, where some members have 16+ entries per day.
I have this so far ( which I've simplified for this post)
SELECT dbo.members.firstname, dbo.members... more >>
eLapsed Time in Mins & Secs
Posted by Bob McClellan at 9/18/2006 4:43:23 PM
What is the best way to calc eLapsed time when
Minutes and secs are needed
something like
set eLapsed = datediff(ss,@pd, DateAppended)/60
but where the minutes and secs are returned like 03:27
Thanks in advance,
bob.
... more >>
Order results by attribute Vaule in XML column
Posted by Jesse at 9/18/2006 4:19:01 PM
Hi,
I am trying to order a resultset by a value that is stored in an xml
datatype column of my table. The following query works but it is extremely
slow.
Select RegistrationId
From RegistrationData
Order By RegistrationXml.value('(/form/activity/@value)[1]', 'varchar(50)')
asc
I ha... more >>
Decimal(Precision,Scale) - Remove Trailing zeros
Posted by Jay at 9/18/2006 3:47:53 PM
Hello all,
I'm attempting to store decimal data the varies in precision and scale.
I don't mind storing with a default precision and scale that is large
enough to accomodate all the values. But how do I trim the trailing
zeros when quering the data? I'd like to avoid parsing the value, just... more >>
Using CASE in SEECT
Posted by Mark Goldin at 9/18/2006 3:42:37 PM
Can I have CASE for something like this:
........
........
where id in
case @TestVal
when 1 then
(select min(id) as id from ......)
else
(select max(id) as id from ....)
end
Thanks for help.... more >>
Archive Data From Database Server A to B
Posted by Joe K. at 9/18/2006 3:28:02 PM
I would like to create t-sql script to archive data from all tables in
Database Server A to Database Server B.
Thank You,
... more >>
Data not displaying correctly
Posted by HearSay at 9/18/2006 2:52:14 PM
Here is my SQL statement. Using Access 2000
SELECT tblUsers.UserID, tblTaskLog.TaskDetail, Count(tblTaskLog.TaskDetail)
AS CountOfTaskDetail1, tblUsers.UserName, Sum(tblTaskLog.TaskTime) AS
SumOfTaskTime, tblTaskLog.TaskDt
FROM tblTaskLog LEFT JOIN tblUsers ON tblTaskLog.UserID=tblUsers.Use... more >>
Best design question when using tables as a queue
Posted by CSAWannabe at 9/18/2006 2:12:24 PM
I'm looking for design suggestions.
I have a very performance critical system. Requests are received from
another system via tcp/ip sockets. An c++ application receives the
requests and stores them in a "Requests" table.
Its possible to receive 100 requests per second or more.
When re... more >>
sql 2k5 64 bit vs 32 bit...
Posted by === Steve L === at 9/18/2006 1:16:58 PM
I need some advices about the hardware.
Our company plans to buy additional servers soon, and 64 bit server is
an option.
we already have serverl sql servers and they are 32 bit.
are there any known issues for mixing 64 bit and 32 bit servers?
(replication, mirroring, reporting services and s... more >>
Determine if a column is being used?
Posted by brianpmccullough at 9/18/2006 12:33:02 PM
Hello,
I just inherited an application, and I have to make some updates. For some
of the updates, I should drop some columns on some tables, but I need to be
sure no other database objects are using these columns. I remember being
able to do this with SQL Server 2000 (I forgot how), but i... more >>
Find the duplicates in the table and remove one of them
Posted by dhiman2002 NO[at]SPAM yahoo.com at 9/18/2006 11:55:00 AM
A table has some duplicate entries except the ID column.
Now i need to first select the duplicate entries to display it in a
report.
Next i need to delete one of the entries.So that duplicates have been
removed!!
... more >>
getdate() as default value
Posted by nkw at 9/18/2006 11:35:01 AM
for example, a table T has a column TS with default constraint getdate().
and the following inserstion will take a while since it will insert a lot of
rows.
insert into T (A) select ....
-- TS will be filled with getdate()
It seems SQL Server let the column TS will be assigned only one val... more >>
Stupid 101 Question (Inserts with data conversion)
Posted by Matthew at 9/18/2006 11:28:58 AM
Trying to Insert a value, it comes in as an integer, and i want to
convert it to a specified text. I totally forget the syntax. Its
something like below.
TIA
-Matt-
[Code]
INSERT System_Monitor_Information_Win32_PhysicalMemory (SystemName,
Capacity, DeviceLocator, FormFactor, MemoryType... more >>
index on a view
Posted by SQL Ken at 9/18/2006 11:05:50 AM
please show me how to index a view?!!
this doesn't work
create nonclustered index indx_Myview on Myview(Mycolumn)
Thanks
ken
... more >>
max year and month query issue
Posted by stoppal NO[at]SPAM hotmail.com at 9/18/2006 10:53:58 AM
How do I filter my table by the max date? When I have the month and
year seperate?
TABLE
[year][month][field1][field2]
2005 12 data1 data2
2006 1 data11 data22
2006 2 data 1 data2
So now I need a SQL query to get all records that are Feb(2)... more >>
sp_who2
Posted by Rick Charnes at 9/18/2006 10:41:56 AM
Using SQL Server 2000, I've just started using SP_WHO2. In the older
SP_WHO, I could display only SPID's that pertain to my own login with:
SP_WHO "mylogin"
But I see that --
SP_WHO2 "mylogin"
returns *all* logins What am I missing? (I don't even see SP_WHO2 in
my version of BOL!)... more >>
help date range - weekly
Posted by Sarah at 9/18/2006 10:18:42 AM
Hi,
I'm assigned a task to retrieve data of last week. How can I get the date
range of last week automatically every time I run the job? I wanted to
schedule this job to run every Monday.
Thanks,
Sarah
... more >>
Cursor Performance
Posted by SHBOSTON NO[at]SPAM gmail.com at 9/18/2006 9:46:57 AM
Cursor performance for a real world application.
I have a table that holds records for a stops along a bus route. Each
records has a number of people getting on, number of people getting
off, a spot check, and a current load column.
The spot check column is the to verify that the sensors on t... more >>
Moving data to a reporting database
Posted by Craig HB at 9/18/2006 9:45:01 AM
We have an Inventory database (SQL Server 2005) that supports our Inventory
website and also all the inventory reports. The website slows down when large
reports are run, especially reports that span many months (or even years).
Therefore we have decided to split the database into a transactio... more >>
How to find all the indexes consisting a particular column?
Posted by Peter at 9/18/2006 9:44:02 AM
I want to find all the indexes consisting a particular column of a table in
SQL Server 2000 and 2005. I notice that sysindexes contains some records
which are created by SQL Server for internal uses such as statistics. How
can I filter all those records so I can obtain indexes records only?
... more >>
Count orders by date range
Posted by raz230 NO[at]SPAM gmail.com at 9/18/2006 9:14:01 AM
I would like to have a query that returns a list like:
Order Date Count
-----------------------------------------
09/08/2006 11
09/09/2006 17
I am using this:
select count(*) as Orders from mailorders
where receivedate between '09/01/2006' and '09/02/2006'
group by receivedat... more >>
Transactional replication and full-text index
Posted by betbubble NO[at]SPAM gmail.com at 9/18/2006 9:05:39 AM
I set up transactional replication between a data entry publisher and a
reporting subscriber and it is working fine for articles, SPs etc.
However, I also need to replicate the full-text index from the
publisher service to the subscriber service.
I could not find a way to do this so we are cre... more >>
sql7 compatibility
Posted by JoeM at 9/18/2006 9:03:39 AM
I have been handed some scripts to run on a sql7 database, but was later
told that they were developed in sql2000. I don't have sql7 here so I can't
do any preliminary testing. To go through the code, is there a list of
incompatibilities between the two that I could review? I just don't tru... more >>
problem with vs2k5 install?
Posted by rodchar at 9/18/2006 8:10:02 AM
hey all,
are there any problems if i install sql server 2005 on the same machine that
has visual studio 2005 installed on it? Because i think by default sqlExpress
is installed by default too?
thanks,
rodchar... more >>
Help Running a VBS Script Inside a Job SQL 2005 (Code Included)
Posted by Matthew at 9/18/2006 7:51:17 AM
My Problem is really simple. I can run a VBS file via the command
prompt (No Problem, No Errors) Place it inside a ActiveX Step inside of
a job, the Step just sits there indefinitely, No errors, no time outs,
nothing nada, zilch.
Create a database called DBAdmin_Dev
Run these SQL Command to... more >>
Returning data for a given month?
Posted by zashah NO[at]SPAM gmail.com at 9/18/2006 7:51:03 AM
Hi all
Hopefully this will a fairly straightforward request. I need to
generate a report from a config database that brings back all the
databases created on our co-host/farm servers for a given month at a
time.
In this database there is a column dbcrdate but this isn't a type
datetime, it... more >>
T-SQL subquery: Every order that is not the latest within one day
Posted by George Shawn at 9/18/2006 6:58:11 AM
Hi,
I am fairly new to T-SQL although I would not classify myself as a complete
beginner.
Last week I came across a strange business requirement for an application,
and I am still trying to figure out how to address it in T-SQL. I need to
pull a list of each customer's last order for a s... more >>
Limiting the amount of characters returned
Posted by kevin NO[at]SPAM kevingibbons.co.uk at 9/18/2006 3:59:34 AM
Hi,
I am looking to return the first 50 characters from a database field.
Does anyone know if there is a SQL function that returns a defined
amount of characters from a database field?
Thanks in advance,
Kevin
www.seoptimise.com
... more >>
How to update top 20 records in sql server 2000
Posted by manaparai vincent at 9/18/2006 2:46:31 AM
hai,
I have using sql2000 server i met one problem in upadate
query.
My table name is reserve
sno. cmname allocated
451 raja no
555 kumar yes
338 prabu no
224 mari no
993 arun no
330 makesh yes
This... more >>
web exception error ..can you help please?
Posted by Nab at 9/18/2006 2:06:01 AM
I have a web service connected to a sql server 2005 express. The service has
a web method and information is extracted from the database through a stored
procedure that has two parameter:input and output. So for example some one
could supply a stock brokers name and in turn one gets the stock ... more >>
SQL query to find last application
Posted by blueboy at 9/18/2006 1:36:48 AM
Hi all, wodered if anyone could give me some guidance, i have wrote a
view which brings me back all deals each specific client has done and
the date and have used the following
convert(numeric(10),V_current_status.start_date,103) as n_Start_Date to
get the days see below;
deal ref clein... more >>
Newbie - How to compare this creteria?
Posted by Cylix at 9/18/2006 12:37:02 AM
I always found that some fields structure like the follow:
members
-------------------------------------------------------------------------------
1,2,4,5,6,13,16
If @student=6 (INT)
What is the best way the found out weather the @student in the members
or not?
For existsing, I use three ... more >>
xp_fixeddrives and sysadmin role
Posted by Ray Mond at 9/18/2006 12:00:00 AM
In SQL Server 2005, it appears that the xp_fixeddrives will only run if the
logged in user (using SQL authentication) is a member of the SQL Server
sysadmin fixed server role.
I would like to implement this in our own extended stored procedure. Can
anybody tell me how this is done? Thanks... more >>
How to get previous row field value ?
Posted by Luqman at 9/18/2006 12:00:00 AM
Is there any way to get the previous field value in sql server.
My task is to calculate moving average of an Inventory Applicaiton.
If quantity is negative or issued, its rate should be the average of
previous transactions.
So, I just want to copy the previous row rate to the current row.
... more >>
A view loosing some of it's columns
Posted by Boaz Ben-Porat at 9/18/2006 12:00:00 AM
Our customers database (SQL Server 2000 - SP 4) contains two large tables,
which grow fast as well. The base table contains ~4,000,000 rows and child
table ~40,000,000 rows.
On these tables there are a number of views defined, and some views are
based on a join between two other views.
T... more >>
How to enable direct catalog changes in sql 2005?
Posted by Søren Chrsitensen at 9/18/2006 12:00:00 AM
I need to run this sql statement: UPDATE sysobjects SET xtype = 'S' WHERE
name = 'dtproperties'
In Sql server 2000 I had to 'Allow modifications to be made directly to the
system catalog'.
How is this done in Sql server 2005?
Thanks,
Søren
... more >>
**discover the latest service pack**
Posted by M at 9/18/2006 12:00:00 AM
Hi
In sql 2000 how can I find the last service pack version which was
installed?
any help would be appreciated.... more >>
Difference of two calculated columns
Posted by Robert Bravery at 9/18/2006 12:00:00 AM
HI all,
I want to present on the same row the difference of two calculated columns.
Cuurently I have Month, YTD and FullYear. YTD and Fullyear are calculated, I
want a column that represents BOY(Balance of year) as FullYear-YTD on the
same row.
My current query is:
select dimensionvaluen... more >>
|