all groups > sql server programming > july 2005 > threads for monday july 11
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
Separate data in one field to individual column
Posted by Sql Fren at 7/11/2005 11:36:02 PM
I have a database records as below:
ItemId WhereUsed
A123 A124;B156;C679;D789
A133 A678
A143 H768;A789
A153 F899;S687
How can I remove the semicolon (;) and separate these values into different
columns as below:
ItemId WhereUsed1 WhereUsed... more >>
SPs & Triggers!
Posted by Arpan at 7/11/2005 10:08:11 PM
Do triggers get compiled & executed in the same way as stored
procedures i.e. after the first compilation & execution, do the
subsequent calls to the same trigger again recompile the trigger before
getting executed?
Thanks,
Arpan
... more >>
Getting Dates & Times
Posted by scott at 7/11/2005 5:44:42 PM
Below is my code that returns any records in my t_events table that occur on
a specific date. It works fine with eventStart_date records like 7/15/2005,
but doesn't pick up eventStart_date records that contain a date and time
like
7/15/2005 8:00:00 AM
How can I strip the time part off s... more >>
How to loop SQL Script for every user database?
Posted by Marco Napoli at 7/11/2005 5:09:13 PM
I have some SQL Script that I would like to run for every user database in
the SQL Server 2000. I have over 200 databases that I would like to run SQL
Scripts for.
Thank you.
Peace in Christ
Marco Napoli
http://www.ourlovingmother.org
... more >>
performance of recursive CTE's
Posted by Paul at 7/11/2005 4:31:30 PM
Is there any (even anecdotal) data out there on recursive CTE's efficiency
performing various queries compared to the methods presently at our disposal
in SS2K?
Paul
... more >>
grouping
Posted by Dion at 7/11/2005 4:25:07 PM
I am trying to group a query. I can do this in Excel, but want to do this in
SQL where my data resides. My data is a list of appointments. Each
appointment is for 30 min, but a person may have several appointments
back-to-back. For example, with the following 7 records:
Time Person
8:0... more >>
Changing the Primary Key and stored values?
Posted by Schlafcommodore at 7/11/2005 4:07:03 PM
The situation: All tables have primary keys that are GUIDS ie. type
uniqueidentifier. These GUIDS are creating untold problems in the front end.
They don't need to be GUIDS and front-end work much better with INTs - SO I
WANT TO REPLACE every PK with an integer - but then of course all FK... more >>
updating 4 fields based upon 4 other fields in a view
Posted by randy at 7/11/2005 3:55:03 PM
I'm looking for direction as to how to handle this in SQL server. I know how
I would do it in Access or VB, but don't know the 'correct' way of
structuring it in SQLServer - a stored procedure and a cursor? or triggers?
Since I'm new to newsgroups, I'm not sure how much explanation I should
... more >>
Don't see what you're looking for? Search DevelopmentNow.com.
osql and line numbers
Posted by helpful sql at 7/11/2005 3:54:23 PM
Hi all,
I generated a .Cmd file to execute some of my sql scripts using osql
utility. It works fine. But it displays line numbers when it executes. So
the users of the .Cmd file are getting confused and scared. So I was
wondering if there is a way to hide the line numbers and if possible,... more >>
AdventureWorks badly normalized?
Posted by DWalker at 7/11/2005 3:16:09 PM
In SQL server 2005, the sample database called AdventureWorks seems to be
badly normalized (or not normalized, or something).
The Products table has columns called EnglishProductName,
SpanishProductName, and FrenchProductName. Then there are other columns
called EnglishDescription, Frenc... more >>
enterprise or developers version?
Posted by HP at 7/11/2005 2:09:02 PM
how do i find out if i installed a enterprise or developers version of SQL
Server?
thanks!... more >>
Joins and nested query
Posted by GetGoing at 7/11/2005 2:06:03 PM
How can I implement a nested query like
SELECT au_id from authors where au_id not in
(SELECT au_id from titleauthor)
using joins...The above query returns 4 rows...author id of authors who have
not authored any book...these tables are in pubs database...
I tried....
SE... more >>
OPENXML of text > 8000 chars
Posted by Maurice Birchler at 7/11/2005 1:58:39 PM
We are OK with the smaller XML fields, but we also have inherited some that
exceed the varchar limit.
How can we OPENXML these large ones?... more >>
How to use temporary table in function?
Posted by Cogo at 7/11/2005 1:33:55 PM
How to use temporary table in function?
Create Function fn_example()
returns int
begin
return (select X from #temptable)
end
this function's message:
"Cannot access temporary tables from within a function"
... more >>
SQL select
Posted by SQL match data at 7/11/2005 1:11:04 PM
example:
data is field "4/20/2005 3:29:33 PM"
question
I need to match up all the records that has 4/20/2005.
how should i do this?
i tried
Select * from TBL_xxx where date2 in (4/20/2005)
... more >>
SQL Case statement
Posted by Jakio S at 7/11/2005 12:55:02 PM
How do write the following Query to set the date to 99/99/9999 when it
encounters a null value, and therfore return the formated date in this format
02/02/05
the following just sets everthing to 99/99/9999 when ts finds a null value
thanks in advanc
--------------------------------------... more >>
stored proc or dts when client logs on?
Posted by David Shorthouse at 7/11/2005 12:48:01 PM
Hello folks,
Is it possible to create a stored proc or schedule dts to occur when a
client logs on? While I do have a scheduled back-up, I would also like to
implement something like the above to export a table (with client logon &
timestamp in file title) as a text file to a specified ... more >>
Too many SPID's?
Posted by Cipher at 7/11/2005 12:40:25 PM
We've built an ADO.Net application that is utilizing one of two almost
identical connection strings that look as follows:
"SERVER=SQLServer1; DATABASE=SQLDatabase1;User ID=CustomUser;Password=pass"
"SERVER=SQLServer1; DATABASE=SQLDatabase2;User ID=CustomUser;Password=pass"
As can be seen ab... more >>
am I missing something?
Posted by Dman832 at 7/11/2005 12:38:20 PM
I am writing a database app in VC++. I need to take a row from one table, and
insert it into another table. How do you do this? I have tried using SELECT
INTO, with something like this: WHERE name like 'Name1' OR name like 'Name2'
OR name like 'Name3' etc. but it doesn't work because several ... more >>
Indexed Views not used by queries
Posted by Veeru at 7/11/2005 12:24:03 PM
We have a datawarehousing application with indexed views created on top of
all the fact tables and dimension tables .
Previously, when we looked at the query plan for Reporting queries we found
that indexed views are used.
But now,we do not know what has changed , Indexed views that are on... more >>
Import Text Error - Find Which Line
Posted by Job at 7/11/2005 12:15:14 PM
I'm attempting to import a text file that is about 1.5 gigs. dts will not
import and gives the error that it can't find the delimiter. This has
happened with smaller files in the past and I had to manually find the line
that had the error and correct the error in the raw data. Essentially t... more >>
Load Time Speeds
Posted by M.Siler at 7/11/2005 12:15:12 PM
Environment - Application is writing in ASP.net against a SQL database.
Screen is being loaded where there are 5 tabs.
There is a need to switch between tabs quickly so I'd like not to have to
read the data when I switch to the different tabs. Therefore I know I'm
going to need to load ... more >>
Query to help get rid Duplicates.
Posted by Ken at 7/11/2005 11:57:04 AM
Not sure if this post belongs here, if not tell me where i can post this.
I have a Table that looks like this
ItemNum, Part, Color, PartsPerBox
Now there are many of the same Part, with the same color but have different
QTY in the box.
What I'm programming a waste system and need to que... more >>
Select-Update in Stored proc
Posted by Marc at 7/11/2005 10:09:02 AM
I want to do a select on a table and change the fields in the rows of the
table that have been selected. The below code is running slow and is not
very optimized.
Begin Transaction
Select Top 10 * from Page where PageInProcess=0
update Page set PageInProcess=1 where PageId in
(Select To... more >>
varchar dataType
Posted by simon at 7/11/2005 9:39:14 AM
I heard on techED that column dataType should be nvarchar instead of
varchar.
The point is that internally SQl server is unicode and if data type is
varchar(that is not unicode) then
it first converts data to unicode before do anything.
So you should get better performance with nvarchar dat... more >>
Using results of Exec
Posted by John at 7/11/2005 9:17:43 AM
Hi,
Inside my stored proc, I build a dynamic SQL string and the invoke it
with:
EXEC(@sqlString)
Is it possible to use the resultset after this statement, still within
the stored procedure?
Thanks.
jr.
... more >>
How to get column list from a result set
Posted by Miguel Pascoe at 7/11/2005 9:06:04 AM
Hello all. I am trying to create a stored procedure that takes a generic
stored procedure name and creates a temporary table with columns matching the
columns of the result set.
How can I find the column names (and types) of a result set from a stored
procedure?
--
Cheers,
Miguel Pasc... more >>
Trouble with Inserts
Posted by Jose Molina at 7/11/2005 9:04:40 AM
Hello,
I am having issues inserting into a table. The error message I get is:
Server: Msg 208, Level 16, State 3, Line 1
Invalid object name 'mydatabase.dbo.mytable'
The database owner is already set to dbo so the problem here is not
ownership (I have sa priveleges so perm... more >>
Primary Key Constraint error
Posted by Dan Slaby at 7/11/2005 8:53:29 AM
I am importing data from one table to another using the import wizard and
sql query. However, I use an 'in (nbr, nbr)' to select data. When I use the
in clause, I get an error on the last row that terminates the statement
because it violates the Primary Key constraint. However, querying the
dest... more >>
Creating a comma delimited list
Posted by J Rieggle at 7/11/2005 8:41:15 AM
Hi,
I have a complex query where each row in the final dataset is a product.
However each product has a number of authors associated with it. What I
would like to do is have a query/subroutine join the authors to the product,
as a string:
ProductID Title Autho... more >>
READPAST
Posted by Souris at 7/11/2005 7:45:08 AM
I wnated my app to skip the record which using by another user.
I use READPADT lock hint, but it seems does not work.
I have a query like following
"SELECT * FROM MYTABLE READPAST"
I use my front end application to link to my query.
I use my client app which is MS ACCESS to log on on 2 ... more >>
Last Equivalent in SQL 2000
Posted by m.ramana NO[at]SPAM gmail.com at 7/11/2005 7:15:07 AM
I have data
Acct Amt
1234 $10
1234 $40
1585 $20
1585 $10
1585 $40
1585 $70
I want resultant to be
1234 $40
1585 $70
How can I achieve this in SQL 2000 ??
Any help would be greatly appreciated.
... more >>
Value as TAGNAME in For XML Explicit?
Posted by Art at 7/11/2005 6:57:01 AM
Is it possible to specify value of some record as the TAGNAME in the FOR XML
EXPLICIT query? For example, at an arbitrary row in an arbitrary table, value
of Col A = "HELLO" and value of Col B = "THERE". I would like to be able to
write SQL in such way that the output would be
<HELLO>THERE</... more >>
fmtonly on and temporary table in a stored procedure
Posted by Martin Moser at 7/11/2005 6:30:03 AM
Does somebody knows if there's a way to check (in a stored procedure) if the
fmtonly flag is turned on?
My problem is, that i have no choice of creating a temporary table. I can't
use a variable of type table, because I can't use it within an EXEC statement.
The part of the sp, which cause... more >>
columns help...
Posted by trint at 7/11/2005 5:35:51 AM
These values represent their descriptions (which are columns in a
table):
Select Amount, AmountTypeID, AmountName From tblAmounts
Amount AmountTypeID AmountName
1.20 21 Matrix
5.90 24 Transfer
6.00 28 s... more >>
Average count per day
Posted by Brian Shafer at 7/11/2005 4:19:02 AM
Hello,
I am new to these fourms and to SQL server. I do a query each day to make
sure my data is in several databases, Production and Data warehouse. I
usally get a count for a 24 hour period, but now I'd like to get and average
count of records for each day over a time period, say like a m... more >>
Urgent - Selecting several records and concatenating as a single c
Posted by Pogas at 7/11/2005 3:59:04 AM
Dear All,
Your help will be most appreciated in this query.
I have the following three tables:
contract, org and fncontent
org - Contract relationship is a one-to -many
contract - fncontent relationship is a one -to -many
I want to select all distinct contracts for all the org. v... more >>
Good Names???
Posted by ReTF at 7/11/2005 12:00:00 AM
Hi All,
I would like of some options about names:
Which are good names:
For tables:
tblCustomer or only Customer or other.
For Store procedure:
spAdd only SPAdd or StoreProcedureAdd or Add or other.
For Data Base:
dbCustomer or only Customer or other.
and else...
Than... more >>
::ID
Posted by ReTF at 7/11/2005 12:00:00 AM
Hi All,
What is best for ID:
int, guid, long...
PS: a table with o lot of registers.
Thanks...
... more >>
Internal SQL Server error.
Posted by Steve Le Monnier at 7/11/2005 12:00:00 AM
I recently encountered an Internal SQL Server error. (Server: Msg 8624,
Level 16, State 16) and I did what most people would of done.
1. Curse.
2. Check Newsgroups and Google.
3. Patch the SQL Server.
4. Curse some more when none of the above works!
I've managed to get my query working, but... more >>
reset autonmbering
Posted by Sam at 7/11/2005 12:00:00 AM
how can i reset the autonumbering in sql table?
thanks
... more >>
SQLDMO.DBFile.PhysicalName hard coded path?
Posted by Chris at 7/11/2005 12:00:00 AM
(If this is the wrong group for such a question, please let me know where I
should be! Thanks. :)
When creating a dbase using SQLDMO, according to the docs, I have to give it
a physical file name and path. All of the docs also include a hard coded
path (i.e. "c:\\Program Files\\Microsoft SQ... more >>
Read results of a stored procedure
Posted by Steve Powell at 7/11/2005 12:00:00 AM
Hi,
I would like to, in T-SQL, put the value of svr_name column returned by
sp_linkedservers procedure into a declared variable.
Can I do that?
... more >>
Cumulative Function
Posted by sv at 7/11/2005 12:00:00 AM
Hi,
I'm trying to find out how to make a query which gives me the third column
based on the first two columns:
COL1 COL2 COL3
-------------------------
JAN 19 -
FEB 16 35
MA 10 45
APR 6 51
MAY 9 ... more >>
Concat return Values?
Posted by perspolis at 7/11/2005 12:00:00 AM
Hi all
I have a Table that includes Name column.
I want to return all of names as one name.
I mean I want to concatenate Name column's values.
thx in advance
... more >>
|