all groups > sql server programming > january 2007 > threads for monday january 29
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
Services
Posted by Ana at 1/29/2007 11:23:03 PM
How to reinitializing the MSSQL services automatically say, at night?
TIA
Ana
--------------------------------------------------------------------------------
Estoy utilizando la versión gratuita de SPAMfighter para usuarios privados.
Ha eliminado 2103 correos spam hasta la fecha.
... more >>
SQL Server 2005 Book
Posted by RON at 1/29/2007 9:54:07 PM
I am using SQL Server 2005 database. I would like to purchase a good
book on SQL Server database programming starting right from the
beginner's level to the professional/highest level.
Can someone please suggest me some good books to learn DB programming?
I know that different people might... more >>
How insert many records at once via script?
Posted by Ronald S. Cook at 1/29/2007 8:06:27 PM
How can I insert many records into a table at once better than what I have
below? I'm guessing BULKINSERT? If so, what is the syntax? Other/better
options? I'm just looking to have some scripts I can use when I need to
re-baseline a database with test data.
Thanks,
Ron
INSERT INTO [... more >>
Why isn't this filter working
Posted by Ant at 1/29/2007 7:49:00 PM
Hi, I'm using a subquery in the WHERE clasue to limit rows to only those
project revisions that have a status code of 'A'.
I know that on the Project table, there is only one record with a status
code of A for each group of Project revisions, however when I apply this
filter I get the same... more >>
Verifying a backup in a stored proc?
Posted by Juan Dent at 1/29/2007 5:55:41 PM
Hi,
I have a proc that backups up every database in a server. Then I need to =
verify that each of these backups is good. The command
RESTORE VERIFYONLY FROM DISK =3D 'k:\Backups\some.bak'=20
is not really comparing the contents of the backups with the DB =
according to help. So, how??
... more >>
Detect errors with sql profiler
Posted by SM at 1/29/2007 4:41:18 PM
Hi,
I want to detect stored procedures that return errors, I've added
"Exception" and "EventLog" events but it does not work.
Do I miss something
Thank you for your help
... more >>
Another way to join tables
Posted by Ant at 1/29/2007 4:28:00 PM
Hi,
Is there another way to join a table rather than by using join? For example,
if I want to use a value from a table as a filter criteria, but do not want
that value in the SELECT statement. I the simple example below, I want to
diplay rows from two tbls based on values in a third.
eg.... more >>
Performance issue on second join against table
Posted by Charles Calvert at 1/29/2007 2:57:35 PM
I've run into something I don't understand. I'm joining twice against
a calendar table (see
http://sqlserver2000.databases.aspfaq.com/why-should-i-consider-using-an-auxiliary-calendar-table.html
) to get two different dates. The second join is a huge bottleneck,
accounting for 82% of the time ... more >>
Don't see what you're looking for? Search DevelopmentNow.com.
value problem with simple xml - requires a singleton (or empty sequence)
Posted by B D Jensen at 1/29/2007 1:52:01 PM
Hello!
Reading examples i tried to make some simpel experiments (Sql Server
2005)
select t.c.value('@a', 'int') as a,
t.c.value('@b', 'int') as b
from (select cast('<r><h a="1" b="2" /> </r>' as xml) x) xx
cross apply x.nodes('/r/h') t(c)
-- results in: 1 2
select t.c.value('a',... more >>
BCP.exe Installation SQL 2005
Posted by tcs at 1/29/2007 1:52:00 PM
Does anyone know if BCP is part of the Client Utilites or the actual SQL
Server?
I want to deploy BCP.exe standalone on a machine to utilize BCP's
capabilites but I am not installing the SQL Server on this box.
MACHINE 1 will use BCP to insert records into the database on MACHINE 2.
D... more >>
CAST Table variable to varchar
Posted by Hitesh at 1/29/2007 1:51:52 PM
This must have been asked before but I am wondering is there anyway I
can CAST table variable as varchar?
Declare @TblTemp Table ( Numbers int, Location char (10), Notes
varchar(50))
Declare @temp1 varchar (4000)
set @temp1 = ''
insert into @body values('12345', 'xxxx', 'North west')
se... more >>
Problems with a select
Posted by charls.030987 NO[at]SPAM gmail.com at 1/29/2007 1:41:25 PM
how I can make a select inside another select
to take values of the second select
for example
SELECT
OBJECT_NAME(object_id) AS tableName
,name AS columnName
FROM sys.columns
WHERE is_identity =3D 1
in these select I Get the names of the Identity=B4s fields, but how I=20
can make a ... more >>
Returning the MAX COUNT
Posted by aljamala NO[at]SPAM gmail.com at 1/29/2007 1:40:18 PM
Hi All,
I have a quick question...
Say I have a table, with the following structure
UserID Contract # Branch
---------- ----------------- ------------
A particular UserID has many contracts, and each contract may belong
to a different branc... more >>
ADO Recordset from Store Procedure
Posted by Gus at 1/29/2007 1:04:01 PM
Hi I am trying to receive an status value from this store procedure,
I want to put the result in an ADO Recordset, I execute the procedure
and the recordset is
still empty.
Could somebody tell me what I am doing wrong.
CREATE PROCEDURE dbo.sp_Orders
@ncIdOrder INT
AS
UPDATE Orders
... more >>
getdate() query?
Posted by Sammy at 1/29/2007 1:01:01 PM
declare @date datetime
set @date = getdate()
print @date
When the query above runs I would like the seconds part of the datetime
returned as I have a query that compares times on the fly but if run during
the same minute no diff times are returned, is there anyway of doing this
without u... more >>
Counting across rows - need some help on how to do this.
Posted by Chris C at 1/29/2007 1:00:01 PM
I’m looking for a little direction on a query I’m trying to write. In a
nutshell, I’m trying to increment a variable based on whether or not a column
has a certain value. So, for the 30 or so columns in this table, simply to
add 1 to a variable called fieldCount if the row has a ‘1’ ... more >>
editing stored procedures
Posted by Gaby at 1/29/2007 11:49:07 AM
I am working on a website where several areas run off of stored
procedures.
I am not used to using SQL Server 2005 ( i learned using SQL Server
2000).
I am wondering what do I have to click to edit the procedures.
Whenever I click on modify it does not open the original. It seems to
cr... more >>
Compare tables
Posted by FARRUKH at 1/29/2007 10:47:02 AM
i want to Compare these tables from both sides : Stock_Report vs PH_Basket and
PH_Basket vs Stock_Report.
anyone has a good idea and query to compare tables
thanks... more >>
2005
Posted by CLM at 1/29/2007 10:46:00 AM
We need to go from 2000 to 2005 for security reasons on two heavily used 350
G servers. I am pushing to buy a separate server, put 2005 on it and then
migrate the databases in steps.
However, the group I am doing this for is worried about cost and is pushing
for an in place upgrade (which ... more >>
Problems with query
Posted by Mats Hansson at 1/29/2007 10:36:43 AM
Hi,
I have two tables, Author and Book. Every Author can have multiple Books,
but a Book can have only one author. I want to export this data to excel in
the following format:
Author 1
Book 1
Book 2
Book 3
Author 2
Book 1
Book 2
Author 3
Book 1
Author 4
... more >>
Display Cascade Delete relationships
Posted by hals_left at 1/29/2007 10:32:03 AM
We want to produce a summary sheet to accompany the diagrams to give
to programnmers when writing stored procedures , maybe there is
another way to approach this but if not is there any way to query /
display all the relationships in a database that allow cascade
deletes.
Also anyway to ... more >>
Accessing Connection Properties
Posted by Rob at 1/29/2007 10:18:54 AM
I need to know the following user connection information:
1. The name of the application used to connect to the database.
2. The last request sent to the server for a particular connection.
3. The time of the last request sent to the server for a particular
connection.
4. The name of the dat... more >>
Converting a SQL Server 2005 Database back to SQL Server 2000
Posted by Paul Davis at 1/29/2007 9:46:02 AM
Is there a way to do this? I upgraded and didn't back up a bunch of tables i
needed. I now need to go back to SQL Server 2000, but can't do it unless I
can take my 2005 databases with me.
Any help with this would be GREATLY apprecaited.
thanks... more >>
Create Table in SQL Server 2005
Posted by Sean at 1/29/2007 9:26:00 AM
I need to create the following table 'MyNewTable' based on TableA and TableB:
MyNewTable:
MyVal1 MyVal3 MyVal4 MyVal5 MyVal6 ----
44 66 77 88 99 ----
TableA:
ID Type Value
1 A MyVal1
2 B MyVal2
3 A MyVal3
4 A MyVal4
5 A MyVal5
6 A MyVal6
- ----(etc...)
TableB:
ID Value
1 44
... more >>
Ping Database Server
Posted by Joe K. at 1/29/2007 9:19:00 AM
I have approximately 35 database servers.
These database servers are SQL Server 2000 and SQL Server 2005 database
servers.
I would like to create a job to ping the database servers every 30 minutes
to make sure it's up.
Please help me create this job.... more >>
Convert Sub Query to Join
Posted by Skip at 1/29/2007 9:04:35 AM
Hi All,
I need to include a field from the jobs table [job_id] in the below
query. I think this requires it to be converted to a join. Can someone
please help.
select program_id,min(Date_Time) as Enddate ,max(date_time) as
Startdate,datediff(minute,min(date_time),max(Date_Time)) as ProgMin... more >>
Syntax to include all fields except specific fields?
Posted by David Billigmeier at 1/29/2007 8:54:01 AM
Within a SELECT query, is there any way to include all fields on a table
excluding a
specified list of fields? For example, something like:
select
* (exclude=var1,var2,var3)
from
table_name;
--
Regards,
Dave... more >>
Retrieving XML path based on attribute value - Revisited
Posted by Mike Miller at 1/29/2007 8:03:01 AM
Based on my post from Friday.
What I am actually trying to do is to create a virtual directory structure
for storing/retrieving content from a web application. Without going into
all the gory detail, I basically will have an HTPP Handler that will recieve
the path and then query to get the... more >>
how to backup/restore all user accounts on sql 2000
Posted by bringmewater NO[at]SPAM gmail.com at 1/29/2007 7:55:17 AM
How can I backup all my user accounts and restore them to a NEW server
both running SQL 2000?
Thanks very much for the help in advance.
... more >>
updating 'self' in trigger
Posted by ChrisA at 1/29/2007 7:16:03 AM
Can someone tell me the correct syntax for updating a new row on it's
Insert trigger?
I am trying to use a trigger to timestamp new records, to avoid modifying
a lot of existing code. So, I'm just trying to Update Orders Set dt =
GetDate() Where ?what?
I tried Where Exists ( Select ... more >>
HELP
Posted by charls.030987 NO[at]SPAM gmail.com at 1/29/2007 6:04:19 AM
please I need a SQL query that return the fields identitys of a
Table
thanks
... more >>
Easiest way to drop all tables ...
Posted by SqlBeginner at 1/29/2007 3:28:00 AM
Hi
I am having 'n' number of tables within a database. There are relationships
set between tables.
Now I am writing cleanup scripts for the database. i.e., when a need araises
i should be in a position to remove all tables from the database and then
rerun my create table scripts. Can any... more >>
Case function in SQL Vs iff function in access
Posted by sahirkaleem NO[at]SPAM gmail.com at 1/29/2007 2:22:18 AM
Hi I'm new to SQL and I'm having an issue with the Case function. I=20
have a field which has the Amount in various currencies. The problem=20
is that Yen has no decimal places so the flat files I use to pickup=20
the data does not include any leading zero.
e=2Eg. For =A3100 the field would sh... more >>
SQL 2005 Developer Edition Unable to create UDT Projects
Posted by cuban NO[at]SPAM nospamexecpc.com at 1/29/2007 2:19:18 AM
Hi and thank you
I have installed SQL 2005 Developer edition. When I try to create a UDT
User-defined type project, it does not have it? Am I missing something, or
is not allow
under the developer edition of SQL 2005.
Thank you
Tomas... more >>
xml insert
Posted by Ramesh Subramaniyan at 1/29/2007 1:50:00 AM
Declare @x XML
DECLARe @X int
set @x = '<Root> <Table> <Col1>1</Col1></Table> <Table> <Col1>1</Col1>
</Table> </Root>'
SET @y = 2
i want to insert the @y value int every node
Result @x = '<Root> <Table> <Col1>1</Col1> <Col2> 2<1Col2></Table>
<Table> <Col1>2</Col1> <Col2>2 </Col2></T... more >>
Filtering a group by
Posted by Ant at 1/29/2007 1:07:27 AM
Hi,
I'm trying to filter grouped rows. Any row with Staus 'I' or 'C' I do not
want retrurned.
Initially I thought i could simply filter them on the inner query, but that
didn't work, so I figured I need to filter the group clause using HAVING.
Still didn't work. I'm perplexed as to how t... more >>
|