all groups > sql server programming > february 2007 > threads for thursday february 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
Rollback whole transaction save/keep error message/error severity information
Posted by Bob at 2/8/2007 10:38:21 PM
Hi all,
In SQL 2005, is it possible to rollback the entire transaction but
save/keep the system generated error message/error severity
information some where? I tried to store the error message in local
memory but once rollback I lost it.
Any ideas would be highly appreciated.
Thanks.
... more >>
how to backup logs when log shipping enabled?
Posted by prince at 2/8/2007 10:28:01 PM
Hi all,
I have the scenario as follows, I am using third party backup solution for
my backup and restore purpose. I need to backup the transactional logs while
backing up DB how do I accomplish this when log shipping is enabled in sql
2005?
thanks and regards
prince... more >>
How to open sql file on same connection?
Posted by john_c at 2/8/2007 10:23:58 PM
In SQL Server 2005, when I open an sql file, it prompts me to
connect. I already have Studio open with a connection. Is there a
way to have it not prompt me and do some type of implicit connection
to a specific server and database? I'm just trying to avoid getting
prompted and connecting ever... more >>
sending mail through stored procedure
Posted by Jagadish Babu at 2/8/2007 10:12:18 PM
How to send mail through stored procedure using SQL Server 2000.
EggHeadCafe.com - .NET Developer Portal of Choice
http://www.eggheadcafe.com... more >>
How to use BCP command to insert the result from query into the existing FOXPro DBF?
Posted by ABC at 2/8/2007 3:32:19 PM
How to use BCP command to insert the result from query into the existing
FOXPro DBF?
... more >>
Data Parsing
Posted by ST at 2/8/2007 3:07:27 PM
I have a column which is defined as 80 characters, but I need to load
the data into another column the first 35 characters of the data. That
truncates the data abruputly, so can we remove whole words from the
end so it doesn't appear truncated.
... more >>
Implement VB6 DatePart equivalent as a T-SQL UDF
Posted by Scienter at 2/8/2007 2:34:29 PM
Hi,
I'm trying to find a more efficient way to implement VB6 DatePart
function as a T-SQL UDF.
Is there a way to implement this as a UDF without using a lookup table? The
only parts of a date
I'm interested in processing using this implementation are: day of the week
(dw) and week of t... more >>
A Unique Constraint (sort of)
Posted by SJ at 2/8/2007 2:05:02 PM
Hi all,
i'm trying to prevent duplicate entries into a column yet still allow many
NULL values in that column.
(table and data script below)
this didn't work (because of duplicate NULLS)
ALTER TABLE TestTab ADD CONSTRAINT IX_TestTab_Col1 UNIQUE NONCLUSTERED
(Col1) ON [PRIMARY]
So i was... more >>
Don't see what you're looking for? Search DevelopmentNow.com.
Actual difference between a Unique Key and an Index which is Uniqu
Posted by michael at 2/8/2007 1:28:00 PM
What's the difference between creating a Unique Key and an Index which only
allows Unique values? Are they functionally the same? Are they structurally
the same?
--
Michael Hockstein... more >>
Highlighting differences in two text columns?
Posted by brett at 2/8/2007 1:19:57 PM
I have a few rows of data with text in an nvarchar(max) column. Each
row has one text entry. I can group the rows by textdocID.
Basically, it is an audit of changes to this text. I'd like to
present a selected row but highlight the differences in it compared to
another row. So, if an older r... more >>
Something Strange with select into
Posted by Pat at 2/8/2007 12:47:02 PM
Hi Freinds,
SQL 2k5
I an using this command to export records to new table
select '"'+convert(nvarchar(20),groupid)+'"' as
siteId,'"'+convert(nvarchar(20),memberid)+'"' as
member,'"MemberStatus"' as
attributename,'"'+convert(nvarchar(20),mlc_status)+'"' as
attributevalue
into mlc_status_... more >>
Afer Join, I have more records
Posted by Chanaka at 2/8/2007 12:15:02 PM
I have a table with 211 records, but when I join that with another table (a
LEFT OUTER JOIN) I get 222 records. Does anyone why this is?
appreciate your help!
Thanks
... more >>
openrowset and jet.oledb
Posted by Nick Thompson at 2/8/2007 11:34:01 AM
Please help,
since the introduction of SQL2005 the default mode for opening access mdb
databases with Openrowset appears to be in exclusive open mode
I wish to open the database in share mode so the other (non net) ADO threads
can open the database at the same time
I only wish to open the ... more >>
Update top (n) rows in Table ::::: N is not static during the run (quite different then typical top n updates
Posted by Ankit Dave at 2/8/2007 11:14:32 AM
Sorry for opening a new post for Same problem .. but i was not able to
reply in that particular topic. i t was giving some error.. Here is
the set.
On Feb 8, 9:35 am, "Mike C#" <x...@xyz.com> wrote:
> UPDATE YourTable
> SET City = 'Chicago'
> WHERE Name = (
> SELECT TOP 1 Name
> FR... more >>
NOT NULL Issue
Posted by Justin Drennan at 2/8/2007 10:53:18 AM
Hi Guys,
I need to select data out of a table, in a particular format. The table
contains a field with the datatype tinyint, however I need to convert this
to the 'int' datatype - this is not a problem using the COVNERT() function.
The problem I have is that I need to specify this ... more >>
Backup ssql2005 and error 3201
Posted by perspolis at 2/8/2007 10:23:57 AM
Hi all
I have an application that I use following command for backup my database:
command.CommandText = "use master; Backup Database mydatabase to
disk=c:\\mybackup\backup1.dat with Init"
this command works well in some Pc's but in others it gives me Error 3201.
I don'w know why??
tha... more >>
timestamp
Posted by cris at 2/8/2007 10:14:00 AM
hello,
i have table A which contains 5 feilds. table B contains 6 feilds. all the
fields are of the same datatype except for the first feild in table B which
is of datatype timestamp. how do i insert the data from table A to table B
without getting an error. thank you in advance.
... more >>
Easy string problem: invalid syntax????
Posted by .Net Sports at 2/8/2007 10:10:17 AM
I get an incorrect syntax error pointing to the semicolon when I run
this sql statement with a dynamic querystring (geid is primary key
integer datatype):
sql="SELECT firstname,lastname from general where geid = " &
request.QueryString("id") & ";"
...i've tried every possible combination... more >>
Date help
Posted by Mangler at 2/8/2007 9:50:36 AM
I cant figure out how to get some results based on yesturdays date.
This is what I got unsuccessfully:
SELECT *
FROM dbo.inventory
where date_in = CONVERT(char(8),GETDATE(),112) - 1
What do I need to do different here?
... more >>
Two Conditions - Basic SQL Syntax Question
Posted by MA2005 at 2/8/2007 9:46:50 AM
Hi Everyone:
I have two conditions, which I would like to use, if either one of
them is true, I would like to perform an update. I think there is a
syntax issue. Can someone help me with this please? I would appreciate
if someone could respond back soon. Here is condition:
(IF EXISTS(SELECT... more >>
system crash
Posted by Roy Goldhammer at 2/8/2007 9:45:50 AM
Hello there
This is the second time it happen.
two users has entered the same raw at the same time.
one of them got Timeout expired and the raw has been locked and all other
users.
in the loking window i see 3 users on that table.
how can i know which of the 3 users is locking the r... more >>
How to get a table offline in SQL Server 2000
Posted by Raj Joshi at 2/8/2007 9:36:00 AM
Hi,
Is there any way I can take a table offline in SQL Server 2000.
--
Raj... more >>
Update top (n) rows in Table ::::: N is not static during the run (quite different then typical top n updates)
Posted by Ankit Dave at 2/8/2007 9:22:11 AM
Hi
I have a table in SQL with following data :
Name City
X NULL
Y LA
z NY
p NULL
q NULL
now i have to sort table based on name and update the fist NULL value
to "CHICAGO"
the only t... more >>
DDL Trigger Question
Posted by Rick at 2/8/2007 9:04:02 AM
I’m having problems with a DDL Trigger. I created a trigger to capture DDL
changes and I’m putting the data in a table for audit purposes. My trigger
works perfectly unless a command to set ANSI_PADDING OFF is fired. I have
select out the problem and you can cut an past this select to see ... more >>
Please help with the query
Posted by Roy at 2/8/2007 8:50:00 AM
Hi all,
In my query I need to compare five date columns(d1, d2, d3, d4, d5) and get
the greatest (the result should be the column name not its value.)
If there are two columns I could write:
SELECT MyGreatestDate=CASE WHEN DATEDIFF("d",d1,d2)>0
THEN 'd1' ELSE 'd2' END
FROM Table1
But h... more >>
how to isolate a specific row from this dataset?
Posted by Rich at 2/8/2007 8:34:00 AM
create table #temp1(idcol int identity(1,1), fyear int, fld1 varchar(10),
fld2 varchar(10))
insert into #temp1
select 2000, 'abc1', 'abc12' union
select 2000, 'abc1', 'abc13' union
select 2001, 'abc1', 'abc12' union
select 2002, 'abc1', 'abc12' union
select 2002, 'abc1', 'abc13'
groupin... more >>
Count with Join
Posted by jack at 2/8/2007 8:28:07 AM
Hi all
i want the number of rows returned form the join.
My data is of two fiscal year and the count would be of number of
transaction happened in that month. and group by would be by month..
The query gives me the value but the problem is, it is taking 10
seconds to execute result.
i need... more >>
Derived Table along with LEFT OUTER JOIN
Posted by wnfisba at 2/8/2007 8:28:00 AM
I have the following syntax I need to run. The data I am getting from the
derived table from the USERINFO Table has nothing to do with the other data I
am getting. I am just trying to get a piece of data to include in my result
set.
How can I combine a derived table and LEFT OUTER JOIN???
... more >>
DBCC SQLPERF(Waitstats)
Posted by Nitin at 2/8/2007 8:25:02 AM
Hi All:
Can someone shed somelight on how to better analyze the output of dbcc
sqlperf(waitstats). Every now and then we run into issues where people start
complaining about slowness on the server and we cant run profiler on it at
that moment. I would like to know how can I get started with t... more >>
Value in Percantage
Posted by Anna at 2/8/2007 7:43:24 AM
Hi: Can any one please tell me how to i calculate the NGRate in
percentage?
Thanks.
"(Case NGPmts+Gross When 0 Then 0 Else NGPmts*-1/(case when
(NGPmts+Gross)*-1 = 0 then 1 " & _
"else (NGPmts+Gross) end ) *-1 End) As NGRate, " & _
QUERY
-----
sSql = "Select DU.User_ID ... more >>
INSERT column defined as DATETIME
Posted by wnfisba at 2/8/2007 7:42:01 AM
I have to INSERT rows to a transaction log table which contains a column
called changdate which is defined as datetime. The format of this column is...
5/6/2006 4:47:51 PM
Is there any easy way to insert the exact date and time rather than hard
coding it in my INSERT statement???
Thanks... more >>
Is this possible using a query?
Posted by signaturefactory NO[at]SPAM signaturefactory.com at 2/8/2007 7:36:46 AM
If I have three tables:
Table 1 Documents
--------------------------
DocID
1
2
3
Table 2 Training Specified
-------------------------------
TSID DocID
1 1
2 1
3 3
4 2
Table 3 Training records
... more >>
Table Design Question
Posted by CSAWannabe at 2/8/2007 7:18:48 AM
I'm trying to figure out the best way to design a couple of tables
given the following scenario.
Here's how I currently have it configured..
Table 1 called Packages is defined as:
Package Id smallint
Groups varbinary(256)
Table 2 is called Groups, which is defined as:
Gro... more >>
Database tunning
Posted by FARRUKH at 2/8/2007 7:12:00 AM
we have a 20,000 million data. i have to do tunning for my database. I just
dont know where to start.
anyone has ideas where to start tunings and stuffs
thanks... more >>
SQL Server Training and DBA Boot Camp
Posted by wnfisba at 2/8/2007 7:03:03 AM
Can someone out there suggest some good SQL Server Training and some good SQL
Server DBA Boot Camps that they have attended or know of that are really
good...
Thanks in advance for your help.
wnfisba... more >>
Delete all records without related transactions
Posted by hals_left at 2/8/2007 6:48:51 AM
I have a customers table with and various other tables with customer
Id in them, and foreign key constraints.
Is their a simple way to delete all records from the customers table
that are not vbeing referenced by other tables ?
... more >>
Delete all records without related transactions
Posted by hals_left at 2/8/2007 6:48:19 AM
I have a customers table with and various other tables with customer
Id in them, and foreign key constraints.
Is their a simple way to delete all records from the cuustomers table
that are not vbeing referenced by other tables ?
... more >>
Calculating Date & time Difference between text fields
Posted by SJ at 2/8/2007 6:40:01 AM
I am using MS SQL Server 2000.
I have 4 text fields
1. event begin date
2. event begin time
3. event end date
4. event end time
I have to find the day and time difference in months days hours and minutes
between the event begin date & time and the event end date & time – The event
b... more >>
Insert into table from table help needed.
Posted by Mangler at 2/8/2007 6:26:40 AM
I have 2 unlike tables to which i need to insert the sum of 2 columns
into the other. Below are the details and the query I tried but didnt
work.
CREATE TABLE [dbo].[bt](
[idtrans] [int] IDENTITY(1,1) NOT NULL,
[idrma] [int] NULL,
[phmodel] [nvarchar](30) COLLATE SQL_Latin1_General_CP1_CI... more >>
CREAZIONE NUOVO PROCESSO SQL SERVER AGENT
Posted by Presidente at 2/8/2007 5:18:45 AM
Salve a tutti,
ho un problema, devo creare un processo in sql server agent che deve
eseguire una stored procedure.
Se la stored procedure fallisce restituisce un valore intero
particolare che devo intercettare:
esempio:
declare @rv as int
declare @numeroRisorse as int
select
@numeroRis... more >>
SQL SERVER 2005 Enterprise Evaluation Edition
Posted by Adalberto Andrade at 2/8/2007 4:14:01 AM
I got that version to understand better and I´m making a pilot of a BI
application.
I know it is a trial version with 180 days, but how can I check and vefify
(exactly) how many days I can use this version before it expire and stop of
running ?
Appreciating any help
... more >>
Subtracting Dates SQL 2000
Posted by Phil at 2/8/2007 3:09:00 AM
Hi,
Hoping for some help with this, I have 2 columns with dates in them and I
want to subtract one from the other and find out if they are minus days or
plus days but also taking into account if the 2 dates span months as well as
being only able to return Working Days in the Answer field.
... more >>
Database Design Question...
Posted by Pablo at 2/8/2007 2:10:00 AM
Hi all,
First of all, I hope this question fits this newsgroup. Currently I'm developing a resource management application, and I need to implement some scheduling functionality for the employees (and other resources), and I'm facing some problems deciding how to logically design the databas... more >>
Problem with SQL Script.
Posted by Manny123 via SQLMonster.com at 2/8/2007 2:08:54 AM
Hi there,
Can anybody out there tell me what the heck is wrong with this script?
Between dateadd(Week,-1,dateadd(week,-1(datepart(weekday,getdate())*-1)+1,
convert(varchar,getdate(),101))) and
dateadd(second,-1,dateadd(day,(datepart(day,getdate())*-1)+1,convert(varchar,
getdate(),101)))
... more >>
User Defined Function that returns incremented value
Posted by Mukund Tambe at 2/8/2007 12:57:04 AM
I want to create a User Defined Function in Sql Server 2000 same as that or "Rownum" in Oracle.
If it is possible.. pls suggest how???
Rgds,
Mukund
EggHeadCafe.com - .NET Developer Portal of Choice
http://www.eggheadcafe.com... more >>
|