all groups > sql server programming > december 2005 > threads for wednesday december 14
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
sql2005express sub, RMO in vb.net, merge agent status messages
Posted by S c o t t K r a m e r at 12/14/2005 11:22:14 PM
I can create, drop reint, & sync just fine (I built a small widget
like vb.net 2005 form)
However I can't figure out how to get status events out of the running
agent... I need to drive a progress bar & update a textbox with messages
while it's syncing
there's sample code in C#, (salesorder... more >>
Removing all between [ and ]
Posted by Simon Harris at 12/14/2005 10:48:29 PM
Hi All,
Does anyone know of a way of removing everything between, and including two
given characters in string using TSQL.
e.g. If my result set returns 'Sample Text [12345]' where 12345 is unknown
text, how can I make this 'Sample Text'
I know this is something perhaps best done at app... more >>
add working days to a date
Posted by Al Newbie at 12/14/2005 9:51:27 PM
I want to be able to pass a date to a function and add 4 days to it. The
quirk is that it needs to be 4 working days ie. Mon - Fri excl holidays.
so
I have a table of Holidays with 2 records in 2/1/2006 (2nd Jan) and 3/1/2005
(3rd Jan)
The 31/12/05 and 1/1/06 are a Sat and Sun
I have a ... more >>
Reboot required to revitalize server?
Posted by Chris at 12/14/2005 8:25:41 PM
I'm having a problem with my database server whereby performance decreases
after 12-18 hours in production and is only restored after a reboot. [almost
like hitting a wall]
Of course, the memory usage increases throughout the day and eventually
settles with a few hundred MB of free memory. ... more >>
what happen when access deny?
Posted by Ed at 12/14/2005 8:16:02 PM
Hi,
Can anyone please tell me what would happen if someone is in the process
of running a select / an update statment while I drop the user permission for
datareader and datawriter or I add the user for denydatareader or
denydatawriter?
Can the process still be finished or the select /... more >>
Index rename
Posted by HockeyFan via SQLMonster.com at 12/14/2005 8:04:09 PM
What's a SQL statement for renaming an existing index. I know how to add an
index at the time that the table is created, but how do you rename an
existing index.
--
E. coli Happens.
Message posted via SQLMonster.com
http://www.sqlmonster.com/Uwe/Forums.aspx/sql-server-programming/200512/... more >>
add index
Posted by HockeyFan via SQLMonster.com at 12/14/2005 6:29:47 PM
I know someone will refer me to online books, but I did a search on the
microsoft site and can't get to it.
I know the general format for adding an index is:
Alter Table tablename ADD INDEX indexname, type, FieldName
The thing is, I'm not sure what to put in for type? Do I use quotes? Ca... more >>
Setting Rowcount's in nested select statement
Posted by alberto.sasso NO[at]SPAM ai-solutions.com at 12/14/2005 4:53:02 PM
I'm currently trying to use SET ROWCOUNT for the purpose of limiting
my number of rows returned but the select statement is buried deep in a
nested SQL query for example:
-- Gets one row of the ProdouctAcquisition table
-- based on the ActualFileName
CREATE PROCEDURE Get_rsDeleteProducts_A
(... more >>
Don't see what you're looking for? Search DevelopmentNow.com.
CManualAccessor::CreateAccessor()
Posted by Thomas Hein at 12/14/2005 4:25:57 PM
Hi folks,
MSDN states the CreateAccessor method of class CManualAccessor as follows:
HRESULT CreateAccessor(
int nBindEntries,
void* pBuffer,
DBLENGTH nBufferSize
)
Does anybody know under which circumstances "pBuffer" is used (i. e.
filled)?
Whatever I try, this buffer stay... more >>
SQL 2005 CLR Dynamic SQLDataRecord
Posted by smoss at 12/14/2005 4:25:48 PM
Hello,
Here's one for the SQL 2005 CLR programmers!
I'd like to send a SQL 2005 CLR stored procedure a string of SQL and have it
execute and send back the result set.
I've got it to work if I hard code the SQLDataRecord values as per the below
code, but I'd like it to dynamically build th... more >>
Single User
Posted by Ed at 12/14/2005 4:24:44 PM
Hi,
There are some jobs running in the morning everyday. What I would like to
do is to log everybody out when the jobs are running to prevent all the
Locking/Blocking from other users... what would be the best way of doing
it????
I am thinking if I can use the sp_droprolemember to not l... more >>
IDENTITY Column!
Posted by Adam Knight at 12/14/2005 4:13:28 PM
Hi all,
I have noticed when i export data, that any resulting tables created don't
seem to include the IDENTITY attribute on the necessary columns.
These attributes are defined in the source tables, but don't carry over to
tables resulting from an export.
Can someone fill me in on what is... more >>
performance in using mutliple vs a single catalog for data
Posted by Tharon LeBlanc at 12/14/2005 4:04:04 PM
When designing a system we have used a single catalog for maintaining
clients data and differentiated by using a unique key.
Is it a better practice to map each user to a separate catalog or use a
single one in terms of performance on the server and clients? While I would
think this would mak... more >>
Loop a select statement?
Posted by Damon at 12/14/2005 3:45:50 PM
Hi,
I have a select statement which brings back several fields and several
columns. Within one of these columns is an email address. I want to be
able to cycle through each record in the select statement and email the
details attached to their email address. My SP is below:-
SELECT ... more >>
DISTINCT ORDER BY PROBLEM
Posted by Savas Ates at 12/14/2005 3:08:00 PM
I have q query like this
SELECT DISTINCT ([cinsiyet]) FROM URUNLER
WHERE cinsiyet NOT IN ('Bileklik' , 'Yuzuk' ,'Set' ,'Kupe' ,'Bilezik' ,
'Kolye') ORDER BY urunid
it returns
ORDER BY items must appear in the select list if SELECT DISTINCT is
specified.
i tried
SELECT DISTINC... more >>
Programmatically creating a blank password logins in 2005 Express
Posted by JDR at 12/14/2005 2:42:10 PM
I have an application using MSDE 2000 which uses the sp_addlogin statement to
programmatically create a guest login with read-only access to a set of
low-priority databases. Had I originally implemented this code, I would have
given the guest account a password, however low its permissions, bu... more >>
Help with stored procedure
Posted by Damon at 12/14/2005 2:36:59 PM
Hi,
I am trying to write a script which basically checks that a date is within 7
days of todays date. It then emails these details off to the officer
involved. My stored procedure does the first bit i.e. Get's list of details
within 7 days of todays date. I need to then cycle through the... more >>
from sql - checking if a file exists in a given share
Posted by Ramadan at 12/14/2005 1:37:23 PM
Hi,
from sql, what is the best way to check if a file exists in a share - given
the file's partial name (for example the first 20 characters) ?
I thought about saving the result set of "xp_cmdShell dir shareName ... "
into a temp table and query the temp table for the filename... but are there... more >>
fn_replprepadbinary8 function
Posted by Zack at 12/14/2005 1:31:00 PM
Hi,
Could someone please let me know where I could find
inofrmation/documentation about fn_replprepadbinary8 function (exists in
master db under functions)
Thanks!... more >>
how to restore a database (either in sql 2000 or 20005) on sql2005?
Posted by === Steve L === at 12/14/2005 1:14:45 PM
If you are asking if you can attach a 2005 file to 2000, the answer is
no.
They are not backward compatible in this manner. Forward compatibility
is
another thing, as you can attach 2000 db files to 2005.
I have a couple of questions about moving a sql2000 database to
sql2005. I was able to ... more >>
Insert - No Logging
Posted by JI at 12/14/2005 12:44:14 PM
Is there a way to insert data from one table to another table without
logging the transactions?
Thanks in advance,
ji
... more >>
Why Is @@Error Not Working in a User Defined Function
Posted by RitaG at 12/14/2005 12:39:54 PM
Hello.
I have a UDF that I created to pick out a value from a string that has
several values in the string separated by a delimiter. I pass the string, the
delimiter and the number of delimiters to find before picking up the value.
The UDF returns a Decimal(5,3) and it works fine but I wan... more >>
Help with a Query
Posted by George at 12/14/2005 12:33:45 PM
Am I able to do something like this? The syntax below is obviously
wrong, I'm looking to see if there is a way to accomplish this.
DECLARE @DBName varchar(5)
SET @DBName = 'pubs'
SELECT * FROM @DBName.dbo.authors
I have a master application and database containing data for several
companie... more >>
Export Table to Text File Using Query Analyzer
Posted by Justin Chandler at 12/14/2005 12:32:45 PM
I can use DTS and BCP, but I am trying to export a table into a text
file through Query Analyzer (I need to show documentation in QA). DTS
uses EM and does not leave a "paper trail"
I am looking for the reverse of BULK INSERT
... more >>
Trying to Create a Loop With Two Variables
Posted by cluilui at 12/14/2005 12:05:41 PM
Does anyone know if this is possible to do in SQL?
declare @product varchar (50)
declare @product1 varchar (50)
declare @product2 varchar (50)
declare @product3 varchar (50)
declare @product4 varchar (50)
declare @product5 varchar (50)
declare @product6 varchar (50)
declare @product7 varch... more >>
Text Fields - RTF Formatting
Posted by Bill Reed at 12/14/2005 12:01:02 PM
I am supporting a purchased product that uses a text field for comments. Is
there a way to query the column and format the contents w/o the rtf
formatting?... more >>
Read mail message with Database Mail
Posted by RC at 12/14/2005 11:34:36 AM
I have a need to read email being sent to an account. This is fairly easy
using SQL Mail, but I want to use the Database Mail provided with SQL 2k5 (as
SQL Mail is being phased out).
Is there a way to read mail as well as send, or is it a send only process?
Thanks!... more >>
sql login
Posted by Pohihihi at 12/14/2005 10:52:29 AM
I see tons of "18453 Login succeeded for user domain\username. Connection:
Trusted".
If this is a problem then it seems big because I see this line in event
viewer for every second for many hours.
What is going on pls help?
... more >>
Table Column Details
Posted by Ricky at 12/14/2005 10:48:05 AM
Hi
I was wondering if it possible to retrieve the max date of audit fields in
all tables, within a database.
i have looked at the sysobjects and sysindexes, but haven't had much luck,
since I am able to get the Tablename and rowcount, but the Audit field data,
I cannot seem to find.
I.e ... more >>
sql server 2000 tran log table
Posted by Wendy Elizabeth at 12/14/2005 10:37:55 AM
I am relatively new to sql server 2000. I have a transaction log that is 98
gigs in size that has never been backed up. This transaction log file is too
big and needs to be decreased in size.
Can you tell me how I would make my first full backup of this transaction
log file?
To shrin... more >>
Performance Question
Posted by mvp at 12/14/2005 10:37:51 AM
Hello Everybody,
I do have a question abt performance of one of my report store procedure.
We have a reporing application using Microsoft Reporting Services a Report
Front End and SQL SERVER 2000 as a DB. I have written one report store proc.
That report store proc is taking arround 30 sec to ... more >>
Why is 1 white space the same as 3 white spaces in a varchar?
Posted by LCooker at 12/14/2005 10:19:46 AM
I have a table with a varchar(3) column.
CREATE TABLE #Test1
(column1 int identity
, column2 varchar(3))
I run the following insert statements:
INSERT #Test1 VALUES(' ') -- one whitespace
INSERT #Test1 VALUES(' ') -- three white spaces
Then I run this query:
SELECT *
F... more >>
Deploying a managed code trigger
Posted by Ron_Coffee at 12/14/2005 10:18:56 AM
I am working on a managed code trigger using visual studio 2005 and SQL 2005.
When I try to deploy it I get the following error:
Incorrect syntax near 'EXTERNAL'. You may need to set the compatibility
level of the current database to a higher value to enable this feature. See
help for the ... more >>
@@identity
Posted by .... at 12/14/2005 9:48:57 AM
I have a problem hopefully someone can help with....
I have a stored procedure which ....
Writes to table A (table A has an identity column)
Gets the identity column using @@IDENTITY (OR @@SCOPE_IDENTITY)
Updates a table; setting column X to the IDENTITY value just retrieved... more >>
help with table update
Posted by Chris at 12/14/2005 9:41:46 AM
Hi,
I have two tables TABLEA on serverA and TABLEB on serverB.
TABLEA
ID QTY
1 4
2 3
3 1
TABLEB
ID QTY
1 1
2 4
They are both the same in terms of structure. I need to update TABLEB with
the contents of TABLEA based on the following
1. If the record exists in both... more >>
Multi connection problem
Posted by ATS967 at 12/14/2005 9:41:23 AM
Hi all,
In my accounting application if one user tries to execute a long report that
my take several minutes, the other users who are entering invoices almost
hang, and the process of enter products into the invoices or the saving the
invoices slow down significantly.
I'm using VC++ 2003... more >>
Can this be simplified?
Posted by nielsonj1976 NO[at]SPAM yahoo.co.uk at 12/14/2005 9:21:09 AM
I have the following table,
CREATE TABLE [dbo].[XXX_TBL] (
[PERSON_ID] [nchar] (10) NOT NULL,
[BEGIN_DT] [datetime] NOT NULL,
[END_DT] [datetime] ,
[TYPE1_ID] [nchar] (10) ,
[TYPE2_ID] [nchar] (10) )
that charts two attributes (TYPE1_ID, TYPE2_ID) assigned to a person,
over time.
... more >>
Calling SP2 from SP1
Posted by Carol at 12/14/2005 8:49:34 AM
I have 3 reports, and all 3 of them have an option that returns the
same information. So, I created a stored procedure to pull that info.
Now, I want to call that SP from another SP. Both will return the same
fields for the report.
I'm thinking what I need is probably very simple, but don't ... more >>
sysobject.status field bit-mapping
Posted by rmg66 at 12/14/2005 8:40:47 AM
Has anyone out there deciphered the "status" field bit-mapping of the
sysobjects table?
Specifically I want to identify all objects created for the purpose of
replication (eg. conflict tables, replication triggers, replication
procedures etc...).
Thanks.
... more >>
Determine if a temproary Table still exists
Posted by John Barr at 12/14/2005 7:31:06 AM
Does anyone know how to determine if a Temporary Table was dropped already or
not? If the Table still exists?... more >>
MSDE Username/Password
Posted by Ken at 12/14/2005 7:31:04 AM
Does anyone have any thoughts on how to generate a username/pw for an
application that uses MSDE?
I am working on an application that uses MSDE as a backend for some very
simple database operations. Users of the application shouldn't need to be
DBAs in order to use it. I am trying to come u... more >>
Any Thoughts!!
Posted by jsfromynr at 12/14/2005 6:58:07 AM
Hi All,
I know there can be lot better ways to do the same thing
(Finding all the childs of a given parent) . Please Provide some
insight to improve my understanding of the topic .Trees and
Hierarchies.
Create Table ParentChild
(
Pid varchar(20),
Child varchar(20)
)
Insert in... more >>
DISTINCT Value
Posted by scorpion53061 at 12/14/2005 6:30:06 AM
if I have 5 columns that I want to check for distinct values in all of them
(not just one columns distinct values - I want to eliminate duplicates from
the entire returned result set) will
Select DISTINCT col1,col2,col3,col4,col5 from mytable order by myfieldname
do the trick?
--
Do y... more >>
Datatype for Primary key fields ...
Posted by Vadivel at 12/14/2005 5:50:55 AM
Hi,
As far as my understanding goes, normally PK would be set on fields whose
datatype is INT. But in one of the project I saw 99% of the tables they have
used Varchar datatype for PK fields.
This internally means that it would string comparisons. I was arguing that
SQL server isn't goo... more >>
Assigning Variables
Posted by Peter Newman at 12/14/2005 5:50:24 AM
i have a snippit of a query
DECLARE @INPUTRPT int
DECLARE @ADDACSRPT int
SELECT a.companyname,
CASE WHEN EXISTS (Select @INPUTRPT = Count(Licence)
from INPUT_HEADERS as b
WHERE (b.DatePostedToBureau IS NULL AND b.licence =
a.licence))
... more >>
UK Contracting Rates
Posted by Damien at 12/14/2005 5:49:54 AM
Can someone give me an idea of UK contracting rates for T-SQL programmers? eg
migration work, non-DBA.
Bit vague I know, but I'm just after an idea.
Thanks... more >>
What data type to use in a table
Posted by Olav at 12/14/2005 4:54:40 AM
What data type do you recomend to use in a table to store positive an
negative numbers with 2 digits precision. It is important to be compatible
with different brands of sql-servers. Size up to +- 1 billion. In our C app
this value will be assigned to and from the double data type.... more >>
interview questions
Posted by vanitha at 12/14/2005 3:57:04 AM
hi friends,
i want some advanced interview questions that is questions, giving some
situation. and also some intresting questions.
thanks
vanitha... more >>
Ignore NULLS on UPDATE
Posted by AlCoast at 12/14/2005 3:40:02 AM
Hi prob a simple question. Need to update a row in a table. I pass into SP
the row ID and up to 10 parms. Any number of the parms may be populated. if
not they are NULL. What is a good way of updating the particualr row with
only the populated parms and ignore the nulls. Thank you.... more >>
Troubleshooting tips for deadlocks, blocking
Posted by parasada at 12/14/2005 2:27:03 AM
hi all,
we have been facing severe locking, blocking and deadlock issues on our
database
and it is really bogging down the system...since we developers don't have the
luxury of any DBAs, we've been asked to look into the issues. We have lot of
DTS
packages which are throwing alerts whenev... more >>
Debugging problem
Posted by SalamElias at 12/14/2005 12:55:02 AM
HI,
Running debugger on the server works like a charm, however, when my
developers try to doc the same thing from ther
desktop (with everything setup correctly), thety get the following error
-------------------------------------
Server: Msg 504, Level 16, State 1, Procedure sp_sdidebug, L... more >>
Improving a query
Posted by Enric at 12/14/2005 12:51:02 AM
Dear fellows,
I am generating monthly excerpts and I was wondering how would I do in order
to do things faster.
I would need to improve the following query so that it would be more
automatically:
General basis:
select count(*) , sum(Imp)
from dbo.TRU_Rec
where FechaCarga >= '2005-0... more >>
A Simple Query Help
Posted by sajid_yusuf NO[at]SPAM yahoo.com at 12/14/2005 12:23:35 AM
Hi!
I have two tables (Master and Slave). So I want to write a query (using
SQL Query Analyser) which will display all the records in Master which
are not in Slave.
Can anyone help?
Cheers!!!
... more >>
|