all groups > sql server programming > june 2007 > threads for tuesday june 12
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
changing order of records
Posted by .nLL at 6/12/2007 10:40:39 PM
hi, i've got a problem. i need to change order of records in my table . here
is the table
id forumname
----------------
1 test1
2 test2
3 test3
4 test4
i need to write code that can move nay record up or down without changing
id of forumname. i thought about another column c... more >>
Objects related to DB
Posted by Jaisol at 6/12/2007 10:01:14 PM
Hi Folks,
I suppose should exist a way to find the relationship between all external
objects (logins, dts, jobs, ...) with one database. I mean, the objects
related\attached with database.
That is because we have to take off several databases including objects
related.
Of course we have... more >>
Question regarding multiple data sources and coalesce
Posted by david at 6/12/2007 9:06:32 PM
I inherited a db that is pulling data from 5 different sources and
storing them in 5 different tables. The tables all have the same
basic data, minor differences based on source. The company currently
creates a "summary" table by joining the 5 source tables and using
coalesce( ) to display dat... more >>
Oracle to SQL 2000 - Masking Data
Posted by Chamark via SQLMonster.com at 6/12/2007 9:06:16 PM
I obviously am breaking new ground here with my (lack of) expereince. I need
to be able mask and unmask Associd via a query. I was given an Oracle query
that is supposed to work. Some of the syntax used in Oracle obviously doesn't
convert over to SQL 2000. Can someone help me get this to work in ... more >>
exec and passing parameters with quotes
Posted by Danny at 6/12/2007 9:00:47 PM
Hi,
I have this stored proc :
CREATE PROCEDURE dbo.TEST
@thenumber varchar(200)
AS
SELECT f1
FROM Table1
WHERE f2 IN (@thenumber)
GO
And I run with :
EXEC TEST 'AAA,BBB'
I have many records with AAA or BBB in f2, but nothing is returned.
Where is the problem ?
(S... more >>
NULL parameter question
Posted by Kevin at 6/12/2007 8:39:14 PM
In SQL 2005, suppose I have a stored procedure with a parameter that
defaults to NULL...
Inside the stored proc, is there any way to distinguish between the
parameter value being NULL because it wasn't specified when the sproc was
called....as opposed to the parameter value being NULL bec... more >>
JOB ID : JM 1202 >>> Urgent requirment for Oracle DBA
Posted by Imran at 6/12/2007 6:42:32 PM
JOB ID : JM 1202 >>> Please refer to the Job ID in all your
communication both in subject line of your email and in the body
text.
* Note: My new Yahoo MSGR ID < mji_imms >
Hi Friends, Hope you doing good !
Urgent requirment for Oracle DBA
Oracle DBA All candidates must be experien... more >>
Views and the Management Studio Interface
Posted by Chris at 6/12/2007 5:51:01 PM
Why is it some views in my SQL 2005 Management Studio have the 'Data Diagram'
visible and some do not? It's frustrating to spend 30 minutes on something
this silly but once again I've wasted a bunch of time on something this
basic:(
Thank you!... more >>
Don't see what you're looking for? Search DevelopmentNow.com.
Find out the locks for the table
Posted by Jodie at 6/12/2007 5:16:01 PM
Hi All,
I have a table called userTable and I want to select to data from this table
and the query is never return back and I think there are locks on this table.
So is there any way that we can find the locks or deadlocks for this table.
Thanks in advance,
JP... more >>
Alter Table Add Identity
Posted by Mike Labosh at 6/12/2007 3:57:55 PM
SQL Server 2000.
Is there any easy way to alter an existing table so that its INT primary key
column can become an identity, without disassembling relationships, dropping
/ re-creating / re-loading the table?
I know how to do it in the above painful tedious way, but I would really
rather... more >>
sp_executesql question
Posted by CLM at 6/12/2007 3:29:00 PM
I've got a 2000 SP4 server whose disk i/o is going through the roof. I did
my DBA thing and ran Profiler and I found the culprits. Well, kind of. It
appears to be some third party software that is doing some table scans - 100
million records at a time.
But here is the problem. The text ... more >>
Confused about Parameter Sniffing
Posted by John at 6/12/2007 3:06:00 PM
I have a problem that appeared to be parameter sniffing. I had a SP that ran
very slow in a SP but very fast as a script in a query window. I did the
workaround using local variables assigned the values of the parameters, and
now the SP is just as quick as running it in a query window. Here... more >>
How to Query a CSV file in 2005
Posted by K. Abit at 6/12/2007 2:42:46 PM
In 2000, I could do a SELECT statement against comma separated CSV files. I
used it often to update tables with files that I received. I much prefer to
do a SELECT and use that inside an INSERT statement. I don't want to use a
wizard if I can avoid it, nor do I even know where the wizards ... more >>
Need 30 days worth of average times
Posted by Daniel at 6/12/2007 2:29:26 PM
we are looking to display average completion time for our 5 page
application....
since its will be a running 30day average, what would be the best and most
practical solution....
#1 create a table that will hold only 3 columns and 30days worth of data
Start End Average
#2 cre... more >>
Replacing NULL values with a string
Posted by Jen Niemeyer at 6/12/2007 2:10:00 PM
I have created a view that contains a left outer join. Obviously if there are
no results, it will return a NULL value. However, I was wondering if there
was some way that I could tell the statement if it was a NULL value, to
output an empty string, or a 0 numeric value? I don't want NULLS in m... more >>
AcitveX, DTS and deleting cells before export Data into excel
Posted by Dennis Rioux at 6/12/2007 1:43:02 PM
The objective of an ActiveX Script is to clear the contents of all cells in
an excel worksheet.Using SQL 2000, I have configured a DTS package that
consist of several steps as follow: ActiveX Script, Create Table, Connect to
Server, Transform Task and query definition, Copy result to intended ... more >>
Remove the last carriage return and line feed from sql text field
Posted by whitej77777 NO[at]SPAM gmail.com at 6/12/2007 1:20:02 PM
I am trying to write a user defined function that will allow me to
strip off the last carriage return and line feed from a text field.
We have address fields stored in a text field for our ERP system and
some of them have an extra carriage return and line feed at the end
of
them. This causes h... more >>
Server Guy playing DBA and needing help...
Posted by RNedrob at 6/12/2007 1:11:05 PM
Im trying to create the enclosed query to show the last contractor that the
employee worked for which is stipulated by the most recent date from
OrderStart. I want it to only return the Contractor, Name, SSN, and most
recent date. I've tried using GroupBy and Max Distinct on the OrderStart
h... more >>
How to transform output of an select to a string
Posted by Xavier at 6/12/2007 1:11:01 PM
Hi,
what is the best way to transform the output of an select
Select features FROM tblArticles where ProductId=44
which is for example
feature1
feature2
.....
featureN
to a string like
feature1,feature2,....featureN
Thanks
... more >>
query help please
Posted by bic at 6/12/2007 11:47:01 AM
Hi,
I'd appreciate it if you SQL gurus out there can help me merge these two
queries into one. Current the first query returns 128 rows and the second 7
rows. As you can see the first 2 columns are the same so I'd like it to
return with the third column and the fourth column all in one si... more >>
Converting MS Access to MS SQLSERVER
Posted by John at 6/12/2007 8:35:36 AM
First I am a novice at MS SQL Server so please bear with me.
I am converting an application that uses an MS Access DB to an MS SQL
Server DB. The Access DB has a memo field in each table for a running
log of changes to the table (customer, employee, etc) I need to append
an update to this fiel... more >>
cannot use CREATE SCHEMA statement in DDL Trigger
Posted by Sam Bendayan at 6/12/2007 8:30:46 AM
Greetings,
I'm trying to create a schema inside a DDL trigger and found that this
is not allowed. Does anyone know of a workaround?
Thanks,
Sam Bendayan
sam.bendayan@gmail.com
*** Sent via Developersdex http://www.developersdex.com ***... more >>
Return Maximum Value / Subquery
Posted by Jen Niemeyer at 6/12/2007 8:28:01 AM
Hi there! I am trying to figure out how to get a query to work. I think I
need to do a subquery of some sort, but I just can't nail it down to get what
I want.
I have a table that contains a JobID, PersonID and an Effective Date. I need
to return the JobID from this table where the effectiv... more >>
cannot use CREATE SCHEMA statement in DDL Trigger
Posted by Sam Bendayan at 6/12/2007 8:26:39 AM
Greetings,
I'm trying to create a schema inside a DDL trigger and found that this
is not allowed. Does anyone know of a workaround?
Thanks,
Sam Bendayan
sam.bendayan@gmail.com
*** Sent via Developersdex http://www.developersdex.com ***... more >>
How do I get RETURN value in Management Studio?
Posted by K. Abit at 6/12/2007 7:41:10 AM
In 2005's Management Studio, I want to see the RETURN value coming out of a
stored procedure. How do I call the stored proc and see the RETURN value?
... more >>
using computed columns
Posted by Michael Evenson at 6/12/2007 5:52:00 AM
Let's suppose I have a table with 4 computed columns that is a parent table
for 2 child tables. Let's call the parent 'header', the first child
'locations' and the second child 'names'. There exists a one to many
relationship between the parent and the two children. That is to say that
each ... more >>
self-referencing constraint with identity column?
Posted by Dave at 6/12/2007 5:47:01 AM
I have a table that requires to have a self-referencing constraint to enforce
a parent-child type of relationship:
ID (identity column)
ParentID (INT column that references the ID column).
To determine if I'm at the top-level of of the relationship, I was going to
leave the ParentID null,... more >>
Query help
Posted by vanitha at 6/12/2007 3:43:06 AM
Hi,
how to add conditions in the where clause?
i want to add something like case statement in the where clause
example
where
case
when a.freq_id = 1 and b.freq_id = 11 then 1 = 1
when a.freq_id = 11 and b.freq_id = 1 then 1 = 1
else a.freq_id = b.freq_id
end
thank you... more >>
Merge Module for SQLDMO.SQLServer
Posted by rupali0408 NO[at]SPAM gmail.com at 6/12/2007 2:48:01 AM
Is there a Merge Module available for SQLDMO.SQLServer 2005.
I need to deploy the SQLDMO.SQLServer object through Install Shield on
a server which does not have SQL Server installed? I am using the DMO
object to display the list of databases remotely from another server.
This should work for bot... more >>
Tracking Critical errors
Posted by raghu veer at 6/12/2007 2:44:01 AM
Apart from Sql Server error log from where can we track critical errors?
Are these major errors stored in any table?
Thanks in advance
movva raghu veer... more >>
Why my data never restored when working with filegroups
Posted by AliRezaGoogle at 6/12/2007 12:33:12 AM
Dear members,
Hi.
I have a big problem:
I use MS SQLSERVER 2000. I have a database called MyDB. I have placed
Table1 of my database in a filegroup called FileGroup1. Yesterday I
made a backup just from FileGroup1. After backing up, I made some
wrong modification on Table1 data. So I realized t... more >>
Generating System Wide Unique Key
Posted by David Sampson at 6/12/2007 12:02:42 AM
I've been working with SQL Server for many years as a Software Engineer, but
have never had to do this.
I need to generate a company wide unique key. Preferably, I don't want to
use the GUId, because I want it more user friendly for when we must do
manual research and analysis.
My idea i... more >>
Linked Tables
Posted by vovan at 6/12/2007 12:00:00 AM
MS Access allows to work with data stored outside of the database via Linked
Tables.
Is this feature available in MS SQL Server?
For instance I can create links to Intuit QuickBooks data file from Access
(I have an ODBC driver for it). Data added via QuickBooks interface is
visible in Access... more >>
SMO and Guest user - where is it?
Posted by Brad Jones at 6/12/2007 12:00:00 AM
Hi,
SMO question:
How can I detect if guest user exist in database?
Database.Users collection simply doesn't have it and guest user is active
for sure.
Thanks,
Brad
... more >>
T-sql: output in a txt/htm file
Posted by Marco Garutti at 6/12/2007 12:00:00 AM
Hi all,
someone how to get the output of a query in sqlserver 2000, using txt or htm
format.
I've only find-out "FOR XML AUTO" instruction, but I don't want an xml
format, because this output must be the body of an e-mail that I send via
store-procedure.
Thanks for any help.
Marco Garutti... more >>
Help on SQL code sought
Posted by Clinton M James at 6/12/2007 12:00:00 AM
Hi all,
I was wondering if somebody can point me in a directionwit this.
I have two tables. For demonstration purposes:
Table1.Col1: Table1.Col2:
ref #, SignificantDate
----
Table2.Col1 Table2.Col2 Table2.Col3
Ref # ActionDate DateLastPrinted
---
The SQL needs to grab a... more >>
|