all groups > sql server programming > september 2004 > threads for monday september 6
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
Comparing Times
Posted by Simon Harris at 9/6/2004 11:17:29 PM
Hi All,
I have a table with three columns - price,fromtime and totime
The fromtime/totime columns are date/time format - I have stored just a time
in them - e.g. 8:30 / 10:30
I am trying to run queries based on time alone (Not dates) but do not seems
to get any results back.
e.g.
... more >>
Permissions of a user
Posted by Banu_tr at 9/6/2004 11:11:01 PM
I want to get the list of
1. permissons of a user
2. permissons of role
byT-SQL query.
... more >>
two process
Posted by Savas Ates at 9/6/2004 6:12:57 PM
can i gain in an asp page which using a stored procedure with execute
method...
i want to execute the query and return the count value the query at the same
time.. is it possible?
... more >>
Shrink is safe
Posted by Oded Kovach at 9/6/2004 6:03:07 PM
Hello there
I've heard that it's not save to srhink sql's database
Is it true?
... more >>
Simple Question: Extending a string in code over a few lines.
Posted by Matthias S. at 9/6/2004 5:46:04 PM
Hi,
This is probably rather stupid, but how can I have a string expand over
a few lines. In earlier days and Visual Basic, I think one could do it
with a underscore character at the end of the line.
Thanks in advance.
Matthias... more >>
xp sendmail/attaching data in message
Posted by Jaygo at 9/6/2004 5:39:24 PM
Just setup xp sendmail and its working fine.
I would like to use it for sending data inserted
into the rows of two tables automatically as soon
as the data is inserted but am a little unsure of how
to proceed. also is it possible to include the current date
and time into the @subject line, I kn... more >>
Binary Fields
Posted by Rikesh at 9/6/2004 5:27:05 PM
Hi
Is it possible to extract the information from a binary ID, as a whole
number?
I'm playing around with CAST etc..... but can't really get to grips with it.
We have, in our system, an Binary ID field, which has 2 parts to it, the 8
bits is the location of the server (Asia/US/Europe) an... more >>
Copying records to another table
Posted by CJM at 9/6/2004 4:37:03 PM
I have two table that have the same structure, but different data...
I want to combine the two sets of data by copying the data from TableB to
TableA. I have created an extra column in each which records the origins of
the data: the Type field of TableA is set to A, and the corresponding field
... more >>
Don't see what you're looking for? Search DevelopmentNow.com.
TRIGGER (AFTER INSERT) and Store Procedure ... insert failed !
Posted by Herve MAILLARD at 9/6/2004 4:30:46 PM
Hi,
I have a trigger on a table "CR_OF". :
CREATE TRIGGER Manage_hist ON dbo.cr_of AFTER INSERT AS
EXEC Manage_Data
If my SP is empty (juste keep DECLARE instructions) I have no problem to
insert records in my table.
The problem is that if I remove the comments in my SP then the insert... more >>
Is there any tool (freeware) to generate SQL Script for the data present in the database
Posted by Peri at 9/6/2004 3:41:57 PM
Hi,
Is there any tool (freeware) to generate SQL script for the data present in
all the tables of a database.
Thanks and Regards,
Peri
... more >>
use quote or without quote to represent the value with type int
Posted by Matt at 9/6/2004 3:35:29 PM
If the data type is int, we can use quote or without quote to represent the
value
For example, the following will work, so we can use either one??
SELECT * FROM STUDENT WHERE ID='1001'
SELECT * FROM STUDENT WHERE ID=1001
However, if the data type is string, then we need to use quote to re... more >>
return
Posted by Savas Ates at 9/6/2004 3:06:20 PM
in my stored
CREATE PROCEDURE sp_freezeaccount
@userid numeric(38)
AS
select * from users where userid=@userid
GO
in my asp page
con.execute ("sp_freezeaccount @userid=' "&session("userid")& "')
how can i learn and return it my asp page count value of the query in my
stored...
... more >>
Violation, Level 14 and Rollback
Posted by kurt sune at 9/6/2004 2:35:20 PM
I have a stored procedure doing some inserts/updates and containing rollback
statements in case something goes wrong:
DECLARE @tc integer
SET @tc = @@TRANCOUNT
IF @tc = 0 BEGIN TRANSACTION
do an insert
IF @@error <> 0 GOTO ERROR
do another
IF @@error <> 0 GOTO ERROR
OK:
... more >>
Problem with UPDATE in SP
Posted by Amin Sobati at 9/6/2004 2:00:17 PM
Hi,
I have created this SP:
---------
create proc p2 as
select * into table2 from table1
alter table table2 add field2 float
update table2 set field2=[any value...]
go
-------------
When I execute this SP, I encounter with error: Invalid column name
'field2'.
The update command fails.
An... more >>
Semi-colon separated columns
Posted by Kristoffer Persson at 9/6/2004 1:44:56 PM
I want this (dynamic) statement
select @x, @y, *
from TableX
where Id = @y
to return this
Col1: @x
Col2: @y
Col3: The columns in TableX separated by ;, i.e. ColA;ColB;ColC;ColD
How can I do that?
- Kristoffer -
... more >>
String manipulation - taking one long csv string and putting into separate record fields
Posted by Keith Langmead at 9/6/2004 1:31:21 PM
I'm using SQLMail to pull in e-mails which contain a load of csv formatted
text, in this particular case it is the output from the event log.
I can get SQL to see the text content, but for ease I want to split up the
text into it's respective sections, and put each line into its own record,
wi... more >>
xp_fileexist to SAMBA-mounted drive
Posted by Tillman Erb at 9/6/2004 1:01:03 PM
I am unable to get xp_fileexist to view files on a SAMBA-mounted Unix/Linux
share using SQL 2000. I have successfully mounted the drive as a mapped drive
on the SQL server. I am using UNC to reference the share.
Is this possible? Am I missing a network or security setup configuration?
Tha... more >>
Validity of rowcnt/rows in sysindexes for indid=0/1?
Posted by Joergen Bech NO[at]SPAM at 9/6/2004 12:32:26 PM
Are these values updated at *all* times, or are there situations where
they are out of sync with the tables?
I read somewhere (Delaney 2001?) that a SELECT COUNT(*) counts the
leaf
pages of the smallest index (if present) to find a row count, but if
those sysindexes values are valid(?) why ... more >>
LEFT OUTER JOIN ERROR
Posted by mk at 9/6/2004 12:27:48 PM
Hi to all.
I'm using SQL Server 2000 and I have this syntax in my application:
SELECT t1.name,
t2.product,
t3.description
FROM
t3 LEFT OUTER JOIN t2 ON .....,
t2 LEFT OUTER JOIN t1 ON ....... more >>
Default recovery model on new databases on MSDE 2000 sp3a?
Posted by Joergen Bech NO[at]SPAM at 9/6/2004 11:52:21 AM
When I install MSDE2000a on a clean WinXPSP1a system,
the recovery model for "model" seems to be FULL, but if I
create a new database (using EM on another machine),
the recovery model for the new db is SIMPLE.
Yes, I know I can change it later, but in the scenario above,
where does it get t... more >>
cast-ing a datetime to a string
Posted by ben h at 9/6/2004 11:51:48 AM
I'm struggling with this most simple of problems :|
I have a smalldatetime, and need to compare it to a CHAR(12) of the form
yyyymmddhhmm.
Reason is legacy code and poor ddl.
my stored proc has two input dates @d1 and @d2, I need to count the number of
rows in table 'events' between these... more >>
T-SQL escape character for single quote?
Posted by ricard at 9/6/2004 11:10:15 AM
What is escape character for single quote?
let say I want to do this
PRINT 'I'm hungry'
i try this
PRINT 'I\'m hungry'
PRINT "I'm hungry"
nothing works..
please help, thanks !
... more >>
multiple updates
Posted by Richard Wilde at 9/6/2004 11:08:02 AM
Hi all , my mind is stumped... I need to be able to update the quantity on a
products table based on what was ordered by a particular person (the order
is a simple basket -> basket item relation) I have a query which returns
the orderedQuantity the idProduct and the stock level (sample tables... more >>
Logical filename
Posted by Kurt Callebaut at 9/6/2004 11:07:47 AM
Hi,
When a make a backup of a database and restore it to a new database,
then i have to change the fysical filename, but cannot change the logical
filename.
Otherwise i get an error when restoring.
When restored, looking at the properties of the new database i still show
the logical filena... more >>
Can anyone check this query
Posted by Anup at 9/6/2004 11:07:22 AM
Basically I want to retrive all the records till the last month.
So if it is sept 2004 I want all the data upto Aug 2004
can anyone see if this query will not work
select * from <table> where datepart(mm,ent_date)
<=(datepart(mm,getdate())-1)
... more >>
Selecting nth character in a column
Posted by harry at 9/6/2004 10:54:53 AM
Hi
i'd like to know if there is a way to select the nth character of a db
colimn. For example, I store preferences in a comma delimeted string. The
column should hold a string with a value of 0,0,0,0,1,0,0,0,0. If i want to
find the 9th character of that string to return the number 1, Can I d... more >>
sql statement, please help...
Posted by Utada P.W. SIU at 9/6/2004 10:30:57 AM
Hi All,
I have some question about sql statement. I have tried many time but cannot
success. Any idea?
Here's my data in table
booth_size join_date
5 2004-02-08
7 2004-03-08
10 2004-03-31
15 2004-01-15
12 200... more >>
SQL statement question
Posted by Utada P.W. SIU at 9/6/2004 10:17:59 AM
Hi All,
I have some question about sql statement. I have tried many time but cannot
success. Any idea?
Here's my data in table
booth_size join_date
5 2004-02-08
7 2004-03-08
10 2004-03-31
15 2004-01-15
12 200... more >>
¿Se puede ejecutar scripts con C# al igual que podía con VBScript?
Posted by Liber at 9/6/2004 10:09:40 AM
con Sqlserver 2000, puedo ejecutar trabajos con ActiveX, con
VBScript y Javascript, ¿puedo hacer lo mismo con C#, es decir ejecutar
scripts hechos en C#, con trabajos de Sqlserver 2000?
¿Se puede ejecutar scripts con C# al igual que podía con VBScript?
Con VBScript escribo codigo en un archivo... more >>
Importing unique records
Posted by nh at 9/6/2004 9:56:23 AM
I have a DTS Package which imports a huge text file into a table.
The table has a 'Unique Values' clustered index covering four fields, partly
to aid queries and partly to prevent duplicate data as any record with these
four fields matching must be a duplicate..
The problem is that occasiona... more >>
XML IN SQL 2005
Posted by Marco De Rossi at 9/6/2004 9:45:04 AM
Hi,
I don't know if there is some newsgroup dedicated to SQLServer 2005, so I
posted here my question.
How can I use a constructed xml value in a modify(insert statement, like this
UPDATE Tree
set Folders.modify('insert sql:variable("@XmlRow")
as first
into (sql:variable("@XmlPath")... more >>
Date part of a datetime
Posted by CB at 9/6/2004 9:24:57 AM
Hi
I am interested in finding the most efficient way to get just the date part
of a datetime field.
Lets assume that I have a a table called "Sales" and a field called
"SalesDate" which is the date and time that a sale took place.
There are a few different ways in which I could get just the... more >>
Stored procedure
Posted by David Way at 9/6/2004 8:32:08 AM
How do I write a stored procedure that selects and orders
n records from a table and then updates each record
selected with 1 through n corresponding to the order in
which they were seleceted ... more >>
Roll Back
Posted by AQ Mahomed at 9/6/2004 6:24:50 AM
Hi
I have used query analyzer to update a table, is it possible to roll
back the query as i have done this two days ago.
Many Thanks in advance
AQ Mahomed
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!... more >>
variable i order by
Posted by (karditsi NO[at]SPAM csd.uoc.gr) at 9/6/2004 6:01:02 AM
Hello,
Can I set a variable in an order by clause
and if yes how?
Thanks in advance
Korina
**********************************************************************
Sent via Fuzzy Software @ http://www.fuzzysoftware.com/
Comprehensive, categorised, searchable collection of links to ASP & A... more >>
Cleanse non-alphanumeric characters
Posted by confused NO[at]SPAM dodgeit.com at 9/6/2004 5:39:43 AM
Hi,
I'm trying to cleanse a table column of all non-alphanumeric
characters by replacing them with a "space" character.
I've been using code originally posted by Steve Dassin:
(URL:
http://groups.google.com/groups?selm=8t6uhq%24elt%241%40nnrp1.deja.com
)
declare @k int
create table #ba... more >>
Count rows
Posted by webermax2004 NO[at]SPAM yahoo.fr at 9/6/2004 3:36:30 AM
This is a refinement of my previous problem. I have the following
table :
C0 | C1 | C2
----+----+----
A | 1 | X
----+----+----
A | 1 | X
----+----+----
A | 2 | X
----+----+----
A | 1 | Y
----+----+----
B | 1 | X
----+----+----
B | 1 | X
I want to write a request... more >>
Word documents
Posted by langhera NO[at]SPAM egaspari.net at 9/6/2004 2:55:04 AM
How can i store a word document (or any other kind of file managed from an
OLE application (excel, Pdf, ecc)) object in a Table and how can i retrive
that from the table to use with his application?
I have to make something like "document Data base".
I use Vb.Net 1.1
Thank... more >>
GROUP BY and COUNT
Posted by webermax2004 NO[at]SPAM yahoo.fr at 9/6/2004 2:23:29 AM
Hello,
This must be a easy problem, but I'm a newbie in SQL. I have the
following table :
id | name
---+-----
1 | X
---+-----
1 | X
---+-----
24 | Y
---+-----
45 | Y
---+-----
13 | X
---+-----
13 | X
---+-----
13 | X
---+-----
I want to count the number of X with different... more >>
How to get parameter info for a SP?
Posted by Bill Hertzing at 9/6/2004 12:53:01 AM
I would like to query a database to get information about the number of
parameters and their types for a SP. What tables hold this information?
--
Bill Hertzing
Tools Development
TeaLeaf Technology, Inc.... more >>
|