all groups > sql server programming > march 2007 > threads for monday march 5
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
Recursive "Instead of" Trigger
Posted by Leila at 3/5/2007 11:12:49 PM
Hi,
BOL states that "Instead Of" triggers can be fired recursively but I could
not experience it by a simple table and trigger. It works fine with After
triggers. Are there any special consideration?
Thanks in advance,
Leila
... more >>
real to datetime - how to...?
Posted by machina at 3/5/2007 9:09:28 PM
Hi,
I would like to convert real data type to datetime type. Example:
I have a real data type which is: 23,613456 (23 hours and 0,613456). I
would like to have it in hh:mm:ss format. How to do this? Can I use
convert/cas function?
Thanks for help
Rgds
Mario
... more >>
LEFT JOIN
Posted by Dan Aldean at 3/5/2007 6:17:49 PM
Hi,
I try to use a Left Join to bring anything from the first table and from the
second one thouse that match criteria.
Instead I get the ones that match both tables
here are the scripts:
CREATE TABLE [dbo].[TE] (
[id] [int] NULL ,
[col1] [varchar] (50) COLLATE SQL_Latin1_General_CP1... more >>
Use of trigger to enforce uniqueness
Posted by Dave at 3/5/2007 5:02:00 PM
I have a table with a customer id and a vertical id. The custid is not
unique for any vertical but vertical id 4.
I need to enforce the uniqueness of the the custid for vertical id 4. What
is the best of doing this?
My first thought is to use a trigger to roll back an update or insert th... more >>
Deallocate statement hangs
Posted by Nigel A at 3/5/2007 4:52:22 PM
In the query below, the job hangs on the deallocate statement. If anyone has
any idea why I would be very grateful.
CREATE PROCEDURE Blah (
@BatchDateTime VARCHAR(20)
) AS
SET NOCOUNT ON
DECLARE @ErrorCode INT
DECLARE @ErrorMessage VARCHAR(100)
DECLARE @rowCount INT
... more >>
How to transfer comments to SQL Server2005 from SQL Server 2000
Posted by Joel WZ at 3/5/2007 3:41:39 PM
We have several SQL Server 2000 databases that have been fully documented
using the column Description property from the design window. TO report on
these, we used the dbo.sysproperties.[value] from the database. I am
attempting to copy some of these databases to SQL Server 2005 and it does ... more >>
Deadlock issues
Posted by ngorbunov via SQLMonster.com at 3/5/2007 3:39:29 PM
How can I write code to trap the deadlock error and re-submit the transaction
in SQL?
Does anyone have any sample code?
Thanks,
Ninel
--
Message posted via SQLMonster.com
http://www.sqlmonster.com/Uwe/Forums.aspx/sql-server-programming/200703/1
... more >>
flag a record as "exported"
Posted by Leo Selmani at 3/5/2007 2:46:16 PM
I am using a DTS package to export a bunch of records using a select
statement. I would like to know fi there is a way for me to tag the
"exported" records with a DateTime stamp for example during / or right after
exporting? Maybe being ablt to invoke some sort of trigger or something
simlia... more >>
Don't see what you're looking for? Search DevelopmentNow.com.
Find a computer that is inserting records into my database
Posted by Computer at 3/5/2007 2:10:32 PM
Is there a way to track the source of an insert into a table? A database I
support has a rogue process running against it and this rogue process is
running inline SQL in a WSF file and it is inserting records via an ODBC
connection. Changing the DB password is not an option.
I am trying ... more >>
OpenXML: XML parsing error: Reference to undeclared namespace prefix: 'n1'
Posted by Jeremy Chapman at 3/5/2007 1:20:36 PM
I'm getting a strange xml parsing error "Reference to undeclared namespace
prefix: 'n1'" that I can't explain.
I've included the xml and my sql below. It's strange because the first
select succeeds, but the second select (for the transaction node) failes
with the above error. Is my OpenXML... more >>
PDF into a sql table
Posted by Blasting Cap at 3/5/2007 12:33:13 PM
Is there a way to put a pdf file (a one page word document converted to
a .pdf file) into a sql table?
I've seen some examples of doing it thru code, but all I want to do is
to put some in a sql table using TSQL, quick & dirty.
Also, regarding setting up the table - I am sure the data type... more >>
Linked server only shows local database table results
Posted by MattSQLDBA_Atlanta at 3/5/2007 11:48:01 AM
I have a linked server (sql 2005) from a sql (2000) machine. When I
am on the 2K machine and run a query like this 'select * from [the
linked server].master.dbo.sysdatabases' it pulls up results but the
data is from the local machine. I looked at the excution plan and it
shows it is running a ... more >>
region
Posted by Ken at 3/5/2007 11:05:41 AM
there is #region in c# or vb.net so I can use toggle.
Is there something like #region for stored procedure ?
... more >>
Table design Question. Type field?
Posted by Eric at 3/5/2007 10:32:36 AM
I'm trying to design a table that has a ID field that could possibly be from
two different tables. Is this possible? ... more >>
Another PDF question
Posted by Ratcliff at 3/5/2007 10:15:56 AM
Hello All,
Is there a way to do a dynamic ole insert of a PDF file into a Crystal
Report based on a value like a pathname coming from a SQL Server
database? For example, I have an application which I cannot modify
(don't ask), back-ended by a SQL Server 2000 database. The app. has a
reportin... more >>
SSIS - 1st row nulls on import
Posted by shawn.dba at 3/5/2007 9:52:26 AM
I'm using the Import/Export wizard in Integration Services 2005 to import
several sheets from a spreadsheet. I'm experiencing an issue when the sheet
has null values in cells in the first row.
Recreate:
Import a spreadsheet with INT values in each of the cells of the first row
- any ... more >>
SQL Server 2000 PRINT
Posted by JayKon at 3/5/2007 9:26:05 AM
Is it possible to supress the CRLF on a PRINT statement, or do I just need to
complete the entire string in a variable before printing it?... more >>
How best we can rewrite this SP without using Dynamic sql ...
Posted by SqlBeginner at 3/5/2007 9:15:48 AM
Hi,
This is one of the SP which I have in my existing SQL Server 2005 DB. Kindly
let me know the best way to tune the performance of this.
ALTER procedure [dbo].[Sample]
(
@SortExpression varchar(200),
@LowerBound varchar(2),
@UpperBound varchar(2)
)
As
Set Nocount ON
Declare @S... more >>
Deletion using multiple records without using cursor
Posted by scuba79 at 3/5/2007 8:54:33 AM
I have a table that contains about 200 records, that contain an id field and
they are tagged with a bit flag. I also have a stored procedure that deletes
information from about 10 tables using the id field from the table. Without
using a cursor, how can I call the stored procedure for all th... more >>
Commented out SQL Block
Posted by wnfisba at 3/5/2007 8:17:08 AM
I have this "Rollback" portion of code that I'm trying to comment out and am
getting an error message which states...
Server: Msg 113, Level 15, State 1, Line 4
Missing end comment mark '*/'.
Server: Msg 170, Level 15, State 1, Line 29
Line 29: Incorrect syntax near '*'.
Here's my synta... more >>
XML (How can I pass parameter to Xquery?) please help...
Posted by Alex.T. at 3/5/2007 6:57:22 AM
I need select data from XML column according to specific path
The 1st select return XML block,
but the 2nd does not...
How do I modify the 2nd select ...
declare @xmlpath varchar(1000)
set @xmlpath = '/item/list/dbvrequestsource/root'
1)
SELECT
SessionVariableValue.query('/item/list/db... more >>
Insert into mySQL via SQL Server OpenQuery
Posted by bigHairy at 3/5/2007 6:07:58 AM
Hello all.
I have a legacy mySQL database that holds some key information. We are
looking to migrate a number of our systems to SQL Server and a .NET
interface.
In the short term it would be nice to be able to use linked server to
read and update the mySQL data. We can read this fine, but w... more >>
Time change and service packs
Posted by Sandy at 3/5/2007 5:16:05 AM
Hello -
I have an application in production with a backend Sql Server 2000 database.
There are NO service packs on it. I am concerned about the upcoming time
change. 1). What service packs should I install and 2). What do I need to
watch out for? 3). I am assuming I am going to have to... more >>
run a console application from inside a trigger?
Posted by Dan at 3/5/2007 5:11:36 AM
Dear all
I am trying to run an application from inside an trigger.I have an on
insert trigger. The application that i have is an console application that
pretty much is supposed to receive paramaeters that have been inserted in the
insert statement and talk to a database on a diferent serv... more >>
Assignment in text data type in sql server 2000
Posted by Archana at 3/5/2007 4:55:16 AM
Hi all,
can any one tell me how to assign null value to text data type?
any help will be truely appreciated.
... more >>
NOT IN with a subquery
Posted by SmikeC at 3/5/2007 4:53:28 AM
Hi there,
A bit late to this post, but it's a problem I just had myself...and to
stop anyone else scratching their head over this wondering what an
earth is going on...
I suspect you needed to check if you'd been playing with your
ANSI_NULLS connection setting!
If SET ANSI_NULLS ON, if any... more >>
PLS Help-Synchronizing using SQL server 2005
Posted by Nassa at 3/5/2007 4:45:38 AM
Hello everyone,
I plan to synchronise two drivers of my computer which contain the
database.
I want to synchronise the folder or file or drive of my database by
using SQL server 2005-standard Edition.
What should I do?
Can I use SQL server 2005 or I should use something else?
Thanks,
Nas... more >>
Data Fetching Problem
Posted by Rahul at 3/5/2007 4:44:38 AM
Friends,
How we can fetch data like this:
Create Table tbl
(
Description VarChar(100),
Flag Char(1),
Amount Numeric
)
Insert Into tbl (Description, Flag, Amount) Values ('Des1', 'A', 1000)
Insert Into tbl (Description, Flag, Amount) Values ('Des2', 'A', 2000)
Insert Into t... more >>
Something Like subclass in SQL Server
Posted by hoveisi NO[at]SPAM gmail.com at 3/5/2007 3:40:50 AM
Hi *.*
I've a problem with one of my programs and no source code is
available to change it, so I need to do something like what is called
subclassing in visual programming, means before the SQL Server execute
a Query, I can change the Query, executing the original query and
changing the resu... more >>
Updating a table
Posted by kvizay NO[at]SPAM gmail.com at 3/5/2007 3:23:27 AM
Hi .
How to update a table without locking entire table ?
thnx
vizay
... more >>
Update through dts import/export
Posted by kvizay NO[at]SPAM gmail.com at 3/5/2007 3:18:53 AM
Hi ..
i want to update the destination table DT from source table ST in the
same DB .
after setting both the connections .. i selected the "user a
query ....for data transfer " then i wrote my update statement
mentioned below ..
UPDATE pb SET pb.C1 = tt.C1 FROM test tt
INNER JOIN tblpaye... more >>
Error reading varbinary data
Posted by Rahul at 3/5/2007 1:57:37 AM
Hello guys,
I am trying to read a varbinary data file (in single cell of
varbinary(MAX)) of about 400 MB which I stored in SQL server using
the .WRITE method (essentially fragmenting the file and storing the
data recursively in small parts at a time)
Now when I try to read the file, I alway... more >>
A couple of time-tracking questions
Posted by Earl at 3/5/2007 12:26:40 AM
I have a potential client who tracks trucker employee time as a lump sum
value for the day (transcribed from job tickets) and thus does not use a
"time-in/time-out" scheme. Other employee time is tracked using time-in and
time-out. It seems that in addition to the TimeIn and TimeOut attributes... more >>
Smart join when working with UNION
Posted by Jorgen [DK/2200] at 3/5/2007 12:00:00 AM
Hi,
a have a view, which used UNION to collect data from 70 identical tables.
My problem is now that I need to join these data against another table with
a join. Is there a smart way of doing this ??
I want to avoid adding the join code for each of my 70 unions.
regards
jorgen
... more >>
performance problem
Posted by Roy Goldhammer at 3/5/2007 12:00:00 AM
Hello there
I stuck with very strange thing.
I have store procedure with bad performance (9 seconds to run).
on the store procedure there is NOT IN.
I replace it with left join, which suppose to improve performance and the
oposite happen.
How it is possible?
... more >>
Performance problem
Posted by Roy Goldhammer at 3/5/2007 12:00:00 AM
Hello there
I have store procedure that runs two slow (9 seconds).
on the sql inside the procedure , there is NOT IN.
When i change it to Left join and ,Where is null , the process has become
even slower.
What can cause the left join to be slower then NOT IN?
... more >>
Insert update / select from other table
Posted by luna at 3/5/2007 12:00:00 AM
I need to insert data from one table into another, the structure is the
same,
It needs to update if the row exists, or insert if not (Column1 is a unique
number, not a key)
cheers
Mark
... more >>
database roles & installation of a database
Posted by LeAnne at 3/5/2007 12:00:00 AM
I've created an application which uses SQL 2000 as the datastore.
In the installation script of the application (using
instalshield/installwise, etc), i create the necessary database & the
tables.
However, I've been adviced to deny access to the PUBLIC role (for the new
database & tables c... more >>
|