all groups > sql server programming > may 2007 > threads for thursday may 17
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
Trigger execution plan takes up to 10 seconds to compile
Posted by Steve Troxell at 5/17/2007 11:18:01 PM
I have a trigger on three identical tables on three different SQL Server 2000
servers. In two of those cases, the trigger always runs in subsecond
execution time. On the third server, the same scenario results in 5 - 10
second execution time on the trigger the first time it is executed, and
... more >>
Convert String to rows in sql 2000
Posted by kamal hussain at 5/17/2007 11:09:49 PM
i am having a string with ';' seperator
Ex: xyz@yahoo.com;abcde@yahoo.com;ABCDE@rediff.com
i need a sql query that retruns me above string in to bellow table
format.
Mail Id
--------------
xyz@yahoo.com
abcde@yahoo.com
ABCDE@rediff.com
Thanks in advance
*** Sent via Developer... more >>
help with db schema design
Posted by AMDIRT at 5/17/2007 9:52:02 PM
Got a puzzler for anyone wanting to take on a challenge.
I have some data, which represents something like an insurance policy. The
customer may call up and change the level of coverage at any time. These
changes may or may not produce a change in premium but may produce a change
in legal... more >>
Deadlock error in sql server
Posted by priya raj at 5/17/2007 8:35:12 PM
i am getting following error in error log after submitting some details from asp.net application. The stored procedure is inserting data to 10 tables.
Transaction (Process ID 150) was deadlocked on lock resources with another process and has been chosen as the deadlock victim. Rerun the transact... more >>
Help importing large csv file into SQL
Posted by Brad at 5/17/2007 7:39:18 PM
I have a very large csv file that needs to be imported into sql 2000.
The file is larger by fields and by characters than what can be
imported in one import process.
I can import it into two or three different SQL tables doing selective
imports of sections of the file by selecting only certain... more >>
Using TransferData
Posted by Mike Baker at 5/17/2007 5:42:00 PM
Hi,
I've been trying to get a SQL Server database copied within the same server
instance for several days. SMO.Transfer is the closest thing I can find right
now but the TransferData method is failing. I've been chasing down errors in
the database and correcting them as I go but currently i... more >>
Large repeated inserts and datalayers.
Posted by MattC at 5/17/2007 4:16:59 PM
We have an import process that parses a text file (about 60Mb) which leaves
us with about 250,000 rows worth of data to insert.
Out platform is .NET 1.1 and SQL 2000
Currently we create a command object call the set the SQLParameters, call
the Prepare method, then open the connections and ... more >>
temp table strategy
Posted by Jiho Han at 5/17/2007 4:14:02 PM
I have a set of stored procedures in a hierarchy, like:
sproc1\
sproc1a
sproc2\
sproc2a
I create some temp tables in sproc1 and sproc2 for use in sproc1a and
sproc2a respectively. Their schemas are exactly the same, only the data
would differ. So, I thought I was being clever ... more >>
Don't see what you're looking for? Search DevelopmentNow.com.
error on alter login
Posted by Dave at 5/17/2007 3:44:00 PM
I am a member of a NTUser group that has a login on SQL Server that is a
member of the sysadmins server role.
When I try to execute this:
ALTER LOGIN XUser
WITH password=pw'
old_password='';
I get this...
Msg 15151, Level 16, State 1, Line 1
Cannot alter the login 'XUser', because... more >>
Line Number Item
Posted by jonefer at 5/17/2007 2:56:01 PM
In a table like this (tblTracking):
SSN | CourseName |Req Date
111223333| General | 5/10/2007
111223333| HIPAA | 5/11/2007
222334444| General |5/15/2007
What is the best way to achieve line numbers (CoursePriority) like this:
SSN | CourseNa... more >>
Cursor Question
Posted by loufuki NO[at]SPAM gmail.com at 5/17/2007 2:36:35 PM
DECLARE MyCursor CURSOR FAST_FORWARD FOR
SELECT LastName, FirstName
FROM Student
For the above statement:
Does it mean that I declare my Cursor name as MyCursor
and load the the data from the table Student into Mycursor?
Thanks
... more >>
inlining function call on a exec sproc
Posted by Jiho Han at 5/17/2007 2:27:48 PM
I am trying to do the following:
exec mysproc fn_getuserbyname('lastname', 'firstname'), 'another arg'
fn_getuserbyname is a scalar function that returns the id (int). when I
execute the above, it complains: incorrect syntax near 'lastname'. so I try:
exec mysproc myschema.fn_getuserbyna... more >>
simple Query to retrieve data from a linked table
Posted by ykffc at 5/17/2007 11:28:01 AM
How should I write a store procedure to retrieve data from two tables INV and
ORDER. INV is a local table (SQL server 2005) and ORDER is from a linked
Oracle Server.
Say I want the query to return INV.FLD1, INV.FLD2, ORDER.FLD3, ORDDER.FLD4.
The two tables are linked by one field (say I wa... more >>
Temp Table
Posted by loufuki NO[at]SPAM gmail.com at 5/17/2007 11:20:44 AM
Hi,
In a sp, the #temp table, where it is created inside the sp, is
automatically drop after the the sp is executed.
therefore, we don't need to check the temp db to see see if the
#tempTable is existing or not.
Please confirm if I am right (or wrong).
I am new to this company and this i... more >>
Import vb.Net xml file to sql server 2000?
Posted by Rich at 5/17/2007 11:16:01 AM
Greetings,
In a vb.net program I write data from a dataTable to an xml text file. The
program creates the xml text file which I can read from another vb.net
program, so the xml is well formed and validated...
But when I try to import the file using DTS wizard (sql Server 2000), I
select... more >>
Validate if first char in string is numeric
Posted by VMI at 5/17/2007 10:52:02 AM
How can I check if the first char in string is numeric?
Thanks.
... more >>
please comfirm I am right/wrong on #TempTable
Posted by loufuki NO[at]SPAM gmail.com at 5/17/2007 10:50:53 AM
Hi,
In a sp, the #temp table, where it is created inside the sp, is
automatically drop after the the sp is executed.
therefore, we don't need to check the temp db to see see if the
#tempTable is existing or not.
Please confirm if I am right (or wrong).
I am new to this company and this is ... more >>
Help needed handling single quotes
Posted by es330td at 5/17/2007 10:31:40 AM
I am looking for a good (hopefully, complete) reference on handling
the ' single quote character. I recently started work at a company
with a mature SQL Server based application. The app has a web
interface for the average user and an Access backend interface for
system administration. Throug... more >>
Generate insert scripts from existing data
Posted by Naveen at 5/17/2007 10:21:01 AM
Is it possible to generate insert scripts from existing DATA in a table? For
e.g., I have a table called CCModule that contains data (that can be
generated from the sample script below). GIVEN a new database with the same
database schema, I need to generate "Insert" statements from the old ta... more >>
How Should Records Be Inserted?
Posted by RON at 5/17/2007 10:20:53 AM
A HTML Form has multiple checkboxes plus a few textboxes for users to
enter their personal info. When the Form is submitted, a ASP page
collects this data & inserts it in a SQL Server/MS-Access database
table. The name of all the checkboxes is the same but their values,
which are distinct, are n... more >>
Are cross-collation queries possible
Posted by B. Chernick at 5/17/2007 10:08:01 AM
I have been trying to write a query (within a user defined function) that
needs to access 2 separate tables from 2 separate databases on the same
server. I have just found out that one db (the one hosting the query) has
Collation = Latin1_General_CS_AS. The other is SQL_Latin1_General_CP1_CI... more >>
Indexes (Field1 & Field1 + Field2)
Posted by ThomBeaux at 5/17/2007 9:31:01 AM
If you have one index called table1_Field1 (with just Field1 in it) and index
table1_Field1&2 (with a combination of Field1 & Field2 - in 1 then 2 order),
is this a waste of space.
If you did not have table1_field1 index, would the Query Plan use index
table1_Field1&2 just like it would ha... more >>
Metadata for table variable?
Posted by Liam Caffrey at 5/17/2007 8:34:15 AM
Hi,
I am trying to get the metadata for a table variable. Where can I find
it. It is not in tempdb.
I would prefer to use table variables to avoid recompiles
Regards
Liam
create table #mytab
(
myvar varchar(1)
,yourvar int
)
select o.name
,c.colid as column_order
... more >>
What is wrong with this query?
Posted by ewest305 NO[at]SPAM comcast.net at 5/17/2007 8:24:51 AM
DECLARE @XLSFILE VARCHAR(255)
SET @XLSFILE = 'C:\DATA\CLSFILE.XLS'
SELECT * INTO CDMUPDT_CDMGMC_BDMLINK322 FROM
OpenRowSet('Microsoft.Jet.OLEDB.4.0',
'Excel 8.0;
Database=' + @XLSFILE + ';
HDR=YES;IMEX=1',
... more >>
SqlDependency OnChange only works for 2 minutes
Posted by mpaine at 5/17/2007 8:21:02 AM
Hi,
I've been stumped on this problem for months and hopefully someone can fill
me in on my mistake. Basically, everything works but only for 2 minutes. I
figure I would give the newsgroup one chance before I open a incident
directly with Microsoft so I can get to the bottom of this. Ple... more >>
Parse Field into Multiple Records TSQL
Posted by Patrix317 at 5/17/2007 8:16:01 AM
Has anyone done this before?
I have a record with a field value that represents multiple items. I would
like to show multiple records based on the value.
Example:
Record layout: name/value/description
John/E2A/AppleOrangeLemon
Mary/E1A/AppleOrange
Harry/E1B/OrangeLemon
What I want... more >>
xp_fileexist with wild card does not return true
Posted by VJB at 5/17/2007 8:13:39 AM
I am using master..xp_fileexist to check for the existance of a file.
Since, the file carries a new label everyday, I am using a wild card
within the file name.
exec master..xp_cmdshell ' dir
\\SKQNABF110\G$\Downloads\TSSCallXfer\CALLXFER*.out', which returns a 0.
If I do exec master..xp_... more >>
Speed SQL
Posted by Lina Manjarres at 5/17/2007 7:18:01 AM
Someone told me yesterday that a where clause like this:
where a=x or a=y is faster than
where a in(x,y)
Is this true?
Many thanks, Lina... more >>
Ok to use LEFT OUTER JOIN even when FK will not be null?
Posted by Ronald S. Cook at 5/17/2007 6:54:34 AM
In the below example, PenTypeID is a NOT NULL FK in the Pen table while
YardSectionID is allowed to be null.
I'm thinking the below code is proper.
SELECT p.*,
t.PenTypeName,
t.PenTypeDescription,
s.YardSectionName,
s.YardSectionDescription
FROM Pen p
INNER JOIN PenType t
... more >>
Need help on table structure ???
Posted by calderara at 5/17/2007 5:47:02 AM
Dear all,
I am preapring my MCSD.NEt exam and I use transcender test for that and I am
actually face to a sitiation where I do not catch the reason of a particular
table configuration. If you can help I will apreciate.
The scenario is as follow :
It is mention to identify the correct rela... more >>
SQL server not starting
Posted by Aditya at 5/17/2007 5:37:01 AM
I am new to sql and today I downloaded evaluation version of sql server
2000 and installed successfully. I created new sql server group Master.
Inside that I created one sql server first . I given first window
authantication then edited to sql authantication but server does not ... more >>
Identical Systems Returning Different Sorted Order
Posted by dwopffl NO[at]SPAM yahoo.com at 5/17/2007 5:11:06 AM
We have 2 systems, with the same version of SQL 2005, and the same
data.
We run a similar query on each system:
Select PersonNumber, Date, Comment
from Comments
Where Number = <unique number>
Order By Date
For this unique number, on one system, the Comments come back in the
correct, lo... more >>
Query Analyzer Returns Rows in Different Order
Posted by dwopffl NO[at]SPAM yahoo.com at 5/17/2007 4:57:29 AM
We have 2 systems at different sites running the same version of SQL
2005 and that also have the same data.
We are using Query Analyzer to return data on both systems.
On both systems we are running a query similar to this...
Select PersonNumber, Date, Comment
>From AccountComments
Where... more >>
Optimalization
Posted by marianowic at 5/17/2007 3:49:24 AM
Hello everyone.
I have got a simple question, but very important for me.
I making a quite big report and I have a lot of conditions to compare.
And I wonder, what is faster:
One SELECT statement with three comparing conditions
OR
Three SELECTS, each with one comparing condition
All the condit... more >>
SSRS 2005 - user rights
Posted by farshad at 5/17/2007 1:15:01 AM
Hi,
I am using SSRS 2005.
Created several reports on the server where SSRS is installed.
In addition I managed to develop a few more reports on my work station and
then deployed the reports to the server.
From my local machine I can brose to http://servername/reports and view/run
the reports... more >>
SPSS with SQL Server
Posted by IT Developer at 5/17/2007 1:10:00 AM
Hello,
Please help me with following:
I have a table with 5 columns. One for dependent variable & rest for
independent variables.
However number of columns can increase for independent variables.
Y X1 X2 X3 X4
0 5 4 3 2
1 5 3 7 2
0 7 3 7 2
1 7 3 7 2
... more >>
Alternatives to TIMESTAMP.
Posted by Duracel at 5/17/2007 12:00:00 AM
I'm trying to think up alternatives to using a TIMESTAMP field, in order to
keep my implementation relatively independant. Ordinary Date/Time field
does not have the required granularity for a row version but I was thinking
perhaps an integer field that I update in the stored procedure whenev... more >>
Interesting problem with order by
Posted by Michael C at 5/17/2007 12:00:00 AM
I've got a case where the first item from my order by clause is being
interpretted incorrectly. In the example below Category.Name is interpretted
as just Name from the select list. It appears to be completely ignoring the
table specifier and just looking at the field called name in the select... more >>
|