all groups > sql server programming > may 2007 > threads for tuesday may 8
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
SQL Query For Timestamp
Posted by farhadtarapore at 5/8/2007 11:38:24 PM
Hello,
I have a table like this:
ID (int) TIME (datetime)
---------------------------------------------------
1011 2007-05-04 05:48:41.467
1011 2007-05-05 01:38:40.398
1011 2007-05-06 01:39:41.597
1011 ... more >>
SQL Query For Timestamp
Posted by farhadtarapore at 5/8/2007 11:33:47 PM
Hello,
I have a table like this:
Col1 (int) Col2 (datetime)
---------------------------------------------------
1 2007-05-04 05:48:41.467
2
... more >>
concat query result rows to a string
Posted by nrv.vikram NO[at]SPAM gmail.com at 5/8/2007 7:58:02 PM
Hi,
I am forced to do this at the data layer than in the code. I have a
query that results rows and I need to have the results in a single
string so I can present in UI layer.
ex:
Table 1 has
student_id book_id
Table2
book_id book_name
If I need to see waht books a student bor... more >>
Why does the select statement trigger SQL Transaction Event?
Posted by Peter at 5/8/2007 6:49:02 PM
I have a SQL Server 2000 trace and I don't understand why there is SQL
Transaction event:
EventClass----------EventSubClass-------TextData
RPC:StmtStarting------------------------select statement #1
SP:StmtStarting-------------------------select statement #1
SP:StmtCompleted-----------------... more >>
Alter Identity
Posted by Lontae Jones at 5/8/2007 6:05:02 PM
Hello,
I have table LootSQ01 and I have an identity on it starting at 4000. I want
to alter this value and have it start at 6000. Also 2 other tables
(LootSQ01, LootSQ02 )are foregin keys to this table and have the same
Identity column. Do i have to alter these tables for that same column... more >>
Extended Stored Procedure
Posted by spamawayau at 5/8/2007 5:48:23 PM
I am using SQL Server 2000 and have written an extended stored
procedure to calculate the string differences using the Ratcliff/
Oberselp alogrithm and is written in C. This method has been tested
and is super quick (1 million itterations in a few seconds)
This procedure is called from within... more >>
HELP IN THIS SPECIAL JOIN
Posted by nallan.gt NO[at]SPAM gmail.com at 5/8/2007 4:57:54 PM
Kindly give me an idea how to do this
table1
- - - - - - - - -
id col1
1 a
1 -
table2
- - - - - - - - -
id col1
1 b
1 c
OUTPUT WILL BE like this id | col1 from table1 | col2 from table2
id col1 col2
1 a b
1 null c
NOTE: I do n... more >>
Need help with results being returned
Posted by Daniel at 5/8/2007 4:54:35 PM
I am calling the following procedure from my page:
ALTER PROCEDURE [dbo].[emp_search_name]
@cfname varchar(50),
@clname varchar(50)
AS
SELECT C.cid,C.st,C.stat,C.etype,
C.cssn,C.cfname,C.cmname,C.clname,HT.cid,HT.hireflag,HT.termflag
FROM EmpCandidate C, EmpHireTerm HT
WHERE C.... more >>
Don't see what you're looking for? Search DevelopmentNow.com.
sql statement question
Posted by mecn at 5/8/2007 4:33:24 PM
hi,
Any ideas why I got error for running the statement below?
declare @s varchar(50)
declare @d varchar(100)
select @s = '(' + char(39) + '12'+ char(39) + ',' +char(39) + '13' +
char(39) + ')'
set @d = 'select * from test where intmid in ' + (@S)
exec SP_executesql @d
Thanks
... more >>
Finding the last updated record
Posted by Mick Walker at 5/8/2007 4:19:49 PM
Hi All,
I have a problem.
When my user updates his/her profile, I have a stored proc which updates
a datetime field, which contains the date the profile was last modified.
What I now need is a way using t-sql that I can pull the row from the
table, where the datetime field is closest to the... more >>
Generate XML Schema
Posted by Michael Kansky at 5/8/2007 2:19:19 PM
Is there a way in SQL server Transact-SQL to generate an XML Schema for the
table?
Thank you,
Michael
... more >>
Calling a stored procedure from another stored procedure
Posted by portCo at 5/8/2007 1:28:22 PM
Hi there,
I have a problem with my stored procedure so, I need your big favour.
What I was trying to do is that I have two stored procedures, AA and
BB. I want to call the AA stored procedure from the BB stored
procedure and set the value of AA stored procdure to a variable that I
created. ... more >>
Create database
Posted by nkg at 5/8/2007 1:01:50 PM
we have a shared environment of dev sql servers. we want to give each
developer "create database" ONLY.
permission, so they can restore and manage their own databases, without
dba's help.
Will there be any problems. in developers accidently overwriting other user
databases?
thx
... more >>
initalizing column in Trigger?
Posted by ChrisA at 5/8/2007 12:31:04 PM
I am trying to set a 'created date' column in a trigger. This is being done
because there is existing code that doesn't set it that no one wants to
modify.
<<trigger code
Update tblOrders Set CreateDate = GetDate()
Where exists (
Select * from inserted i
Where tblOr... more >>
@@FETCH_STATUS not being reset
Posted by Kevin at 5/8/2007 11:36:02 AM
I have a scroll sursor which loops thru a table using a fetch next statement.
At the end of the while statement block, there is a close & deallocate cursor
statement for cleanup.
On subsequent runs of the sql code however, the WHILE @@FETCH_STATUS = 0
statement terminates because @@FETCH_S... more >>
Question about the integrity of a view
Posted by B. Chernick at 5/8/2007 10:59:02 AM
We're running SQL Server 2000 and I've created a view. (I'm not a DBA but I
play one in this job. :-) One of the fields of the view is a datetime field
(direct from the table, no modification.) As apparently many operations do,
we have a date ('1/1/1900') that signifies no date at all.
... more >>
SP_VERIFY_JOBSTEP
Posted by A. Robinson at 5/8/2007 9:48:01 AM
I have a slight problem. I've got a job I created in SQL 2K5. Inside the job,
the command that is being run is over 3000 characters in length, which is no
problem for SQL 2K5. However, when I try to create the same job on SQL 2K, it
blows up with the following message:
Msg 14250, Level 16, ... more >>
OSQL preload
Posted by Jaco at 5/8/2007 9:48:00 AM
Hi,
Does osql do a preload before it loads the actual data? I am having problems
with loading large sets of data (250mb +) from text files into a table.
It seems to time out and doesn’t load any of the data into the table which
makes me think it preloads and times out. My timeout is set to... more >>
Table Design
Posted by RON at 5/8/2007 9:33:50 AM
In a web app, users are shown a list of classes & whether they are
available on a particular date so that users can join the classes. By
classes, I mean dancing class, singing class, cooking class etc.
This is how I am designing the SQL Server DB table but would like to
know whether this desig... more >>
Need to create Array in Stored Procedure
Posted by Techhead at 5/8/2007 9:10:47 AM
I have a stored procedure as shown below:
USE [DB_NAME]
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER OFF
GO
ALTER PROCEDURE [dbo].[StoredProcedureName]
@ID int
, @Preference VarChar(20)
, @PrefValue VarChar(255)
As
insert into preference (
user_id,
preference,
pref_value)
v... more >>
unexpected results with a query
Posted by Dan D. at 5/8/2007 8:52:02 AM
Using SS2000 SP4.
CREATE TABLE [tblimport2] (
[mailfile_id] [int] NULL ,
[branch] [varchar] (4) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
[prop_state] [varchar] (2) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
[drop_date] [smalldatetime] NULL
) ON [PRIMARY]
CREATE TABLE [tbldrop1fix] (... more >>
Setting a constant value to a destination field in DTS transformat
Posted by R C at 5/8/2007 8:23:02 AM
Hi
i have a dts package that imports data from a flat file to a table. I am
using a transformation task to import into the table. When i set the
source/destination for each field, i need to set a field in the row record to
a constant value (that isn't in the file). how would i do this?
t... more >>
Access to SQL Server Conversion
Posted by bcb at 5/8/2007 7:47:39 AM
Hi there,
I'm in the process of converting an Access DB to SQL Server; and I'm
almost there...I've got one small problem with a query I'm hoping for
some help with:
This is a query that runs on a button OnClick within an Access form.
SELECT [l_name] & ", " & [f_name] AS UserName, [name] &... more >>
Incorrect syntax near Create Sproc
Posted by Bil Click at 5/8/2007 7:44:01 AM
I wrote a stored procedure that runs fine when I execute from SQL 2005
Management Studio, and runs ok when I step into it from VS2005. Both return a
value of 0, drop, create & populate the table.
But when I run it inline in the vb.net code, I get an error:
+ ex {"Incorrect syntax near '... more >>
Property IsPrimaryFile is not available for DataFile
Posted by Mukut at 5/8/2007 6:49:32 AM
Hi all,
I have restored a database in SQL SERVER 2005.After restoring the
database, I can make query on that particular database.But problem is
when I right click on the database name(to open the properties etc.),
I am getting the following error .....
TITLE: Microsoft SQL Server Management Stu... more >>
Application Name in connection string and logins...
Posted by Ronald Green at 5/8/2007 6:46:36 AM
Hi,
I have some software running against my SQL Server (2005) and
management asked to let users access the database only through this
program. Users must login to SQL using their windows account (for
auditing purposes) so it's tricky... I thought of using Application
Roles but since I can't c... more >>
Problem with "NOT EXISTS" query
Posted by Fendi Baba at 5/8/2007 5:18:44 AM
I wroe the following SQL query and I got the following errors. I dont
know what may cause it. I have tried to change the name of the tables
but still faced the same errors. Where did I go wrong?
Thanks in advance
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Select* FROM dbo.... more >>
Pivot Query
Posted by vanitha at 5/8/2007 4:26:02 AM
Hi,
The query is as follows
select
s.report_id,
paramName,
paramValue,
f.descr,
d.descr
from
Scheduled s
JOIN Parameters p on p.report_id = s.report_id
JOIN ParameterValues pv on s.[id] = pv.sched_id AND p.[id] = pv.param_id
JOIN Frequency f on s.frequency_id = f.[id]
JOIN Delivery... more >>
Adding assembly with references in SQL Server 2005
Posted by richard.hallgren NO[at]SPAM gmail.com at 5/8/2007 2:04:33 AM
Hi!
I've never tried to run CLR code in SQL Server until now and I'm
having some problems. The assembly I'm adding have references to a
couple of other assemblies. These assemblies have dependencies to a
couple of other assemblies and so on. The dependency tree soon gets
kind of big (it's a a... more >>
Copy database diagrams from one database to other in SQL 2005
Posted by Sriram Mallajyosula at 5/8/2007 12:34:01 AM
Hi,
Is there a way of copying the database diagrams from one database to the
other in SQL 2005. Assuming that the table structures, references are the
same in the source and the destination database.
Thanks in advance.
Regards,
Sriram Mallajyosula... more >>
Memory pressure issues when running CLR stored procedures.
Posted by Sydney at 5/8/2007 12:10:01 AM
We have a product that uses SQL Server 2005 SP2. It includes CLR stored
procedures that are loaded from SAFE and UNSAFE assemblies.
We have found that execution of CLR stored procedures results in the
following error:
Error 6513, Level 16, State 27, Procedure -, Line 1, Message: Failed to... more >>
JPEGs into image column
Posted by CyberDwarf at 5/8/2007 12:00:00 AM
Hi
I've been trying to sort this one for a couple of months now, without
getting a definitive solution!
I have a client spec which requires us to store JPG photos (thumbnails)
within the record (ie, we will not store the link to the image stored on
disk - yes, I know that would be easier ;... more >>
single column to multiple
Posted by Rob T at 5/8/2007 12:00:00 AM
I would like to write a query that can take a single column and return it as
multiple columns. for example, If my normal query was "Select myResult
from MyTable", it would obviously list a single long column. To save some
space on my output, I want to display it in 3 columns instead.
Tha... more >>
MSDE 2000, SqlConnection and Async=True
Posted by Elad at 5/8/2007 12:00:00 AM
Hi,
I'm trying to connect to a local instance of MSDE 2000 using SqlConnection.
Since I need asynchrony, I specify "Async=True" in the connection string.
When I try to open a connection, I get the following error:
An error has occurred while establishing a connection to the server. When
... more >>
About Stored Procedure Schema Binding
Posted by Norton at 5/8/2007 12:00:00 AM
Dear All,
Is there any method to check whether the stored procedure's dependency
objects (like table schema, views schema...) has changed or not? I have
several hundred of stored procedures and need to check if it can run
successfully or not.
Thanks in advance!
Regards,
Norton
... more >>
|