all groups > sql server programming > january 2005 > threads for friday january 7
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
SQL Server 2000 BUG?
Posted by Juraj Rojko at 1/7/2005 11:53:10 PM
Is the code below my bug or bug in SQL Server 2000 SP3a ? I hope it is
self-explanatory.
Can anyone help me to fix this problem or point to appropriate KB article?
Thanks in advance, Juraj
---------------------
CREATE TABLE xTable1(
Col1 money NOT NULL,
Col2 money NOT NULL,
CONSTRA... more >>
Is there an API for reading the Transaction Logs
Posted by Gopinath R at 1/7/2005 9:14:07 PM
Hello All,
Like the Backup/Restore APIs that are available for SQLServer, are there any
APIs available for reading the Transaction Logs.
I'm aware of tools such as the Log-Explorer that read the transaction log
but I was wondering if the APIs is available for the
Developer Community.
... more >>
Global Variables
Posted by Shahriar at 1/7/2005 8:47:31 PM
Is there a way to get all the Global Variables used in SQL 2000 ?
Many thanks
Shahriar
... more >>
DBCC Traceon
Posted by Tudor Sofron at 1/7/2005 8:36:35 PM
Hello all,
I have written a procedure which imports data into SQL Server from MySQL
using driver 3.51.06. Nothing unusual til now but the fact that the stored
procedure is using dbcc traceon (8765). So, I grant execute to an ordinary
user on the procedure, the user can execute it but the proc... more >>
Best practise for distributed transactions and oracle procedures.
Posted by Ado at 1/7/2005 7:14:10 PM
Hi All,
I would appreciate it if I could get some opinions on my proposed solution.
On a nightly basis I have to execute a batch job that would does the
following
1) Execute a Stored Procedure to return a recordset of IDs from a SQL2K DB
(Can be up to 750,000m rows) and insert these ids in... more >>
Why and Where Posts
Posted by David Pope at 1/7/2005 6:08:14 PM
Looks like someone is asking these questions for a school assignment.
... more >>
DMO & Maintenance Plans
Posted by HugoSousa at 1/7/2005 4:41:07 PM
Hello,
I'm using SQL-DMO to make an entreprise manager (sort off...) to distribute
to our clients that use MSDE.
All is going well, but how can one find the existing maintenance plans in a
database? Can't find it anywere.
I'm sure this is possible, since EM is done with DMO.
If anyone ca... more >>
Find Database users
Posted by Ann at 1/7/2005 4:17:03 PM
I'm wondering if there is a way I can query against a
system table to find out all the users on a server and
what permissions they all have? If anyone has any ideas I
would really appreciate it! Thanks!... more >>
Don't see what you're looking for? Search DevelopmentNow.com.
Why truncate
Posted by Ryu at 1/7/2005 3:52:17 PM
Hi,
I am trying to insert a string of text into Sql 2000 SP3. However when ever
I do that the string will be truncated. I have set the column's length to
1000 using nvarchar. My string of text is only 300 characters long. Please
help. Thanks
... more >>
what good is a filegroup?
Posted by Paul Pedersen at 1/7/2005 3:45:55 PM
I've read the documentation, and I still can't figure out what's the purpose
of a filegroup, why I'd want more than one, or even one for that matter.
What are filegroups good for?
... more >>
convert(datetime, datefld, 101) error
Posted by Ron at 1/7/2005 3:40:10 PM
Hello,
I read external data to a table that is all text fields
(will take any text). One field is supposed to contain
dates, like 1/1/2004, 1/2/04, 1/3/2004,
1/4/04, ...1/1/2005, 1/1/05, 1/2/2005, 1/3/05, ...
I want to just read the year value and am using
select year(convert(datetim... more >>
Loss of performance (SQL Server ya pervs!)
Posted by Rob Meade at 1/7/2005 3:35:21 PM
hehe, hi all...
Ok - so our SQL server appears to be struggling - as the day goes on it gets
worse and worse - regularl jobs start failing, time outs and so on...
I'm no great SQL Server admin but have started having a nose around - out of
our 1gb of ram in this server its currently gobbli... more >>
FullTextIndex
Posted by Rafael Chemtob at 1/7/2005 3:26:09 PM
In my search feature on my site, I placed all product names, UPCs,
Manufacturer, etc separated by a pipe (" | ") into one field in a table.
the table has the fields (product ID, searchText - which contains the info
above).
now, when I do a search for "digital camera",
SELECT TOP 100 tbl_searc... more >>
calculate the midle and end of the month
Posted by Gonzalo Torres at 1/7/2005 2:55:27 PM
Hi
I have a table with a datetime field that I use to get a date of process for
my application.
I have stored the dates:
15/01/04
31/01/04
15/02/04
29/02/04
15/03/04
31/03/04
15/04/04
.
.
.
a... more >>
How to access SQL Server on another domain with Windows authentica
Posted by CyberDigger at 1/7/2005 2:49:01 PM
I have two computers, client and server. The client is running Windows 2000
Professional and is in a workgroup, say "MyWorkgroup". The server is running
Windows Server 2003 Standard Edition and is in a domain, say "MyDomain".
The server has SQL Server 2000 Standard Edition with SP3a install... more >>
passing table to store proc
Posted by Zeng at 1/7/2005 2:36:07 PM
I am trying to monitor a set of tables (containing data for multiple
companies) for any update, inserted, or deletion using trigger, if there is
such event happens to certain set of companies, I'll have to update another
table. Basically I'm implementing data caching invalidation.
The problem... more >>
move tables to different filegroups
Posted by Mike Torry at 1/7/2005 1:55:02 PM
Are there any system stored procedures I can use to move multiple tables (as
many as 100 ) from current filegroup to a different filegroup?
Thanks in advance,
-Mike... more >>
error updaing view
Posted by Nikhil Patel at 1/7/2005 1:30:36 PM
Hi all,
I have a view with an Instead Of Update trigger. When I try to update
data using this view, I get the following error:
Server: Msg 4422, Level 16, State 1, Line 1
View 'WV_OrgChartMember' has an INSTEAD OF UPDATE trigger and cannot be a
target of an UPDATE FROM statement.
Can ... more >>
Casting a Bit datatype to a VARCHAR
Posted by Randel Bjorkquist at 1/7/2005 1:24:53 PM
Hey All,
Here is what I'd like to be able to do. I'd like to be able to use a query
to convert the values of a bit type field to a varchar with the values "YES"
or "NO". Other then created a query that uses a cursor to fill in a table,
that I then run another query from to view the results, ... more >>
SCOPE_IDENTITY vs Transaction scoped Select @@Identity
Posted by MattC at 1/7/2005 1:23:10 PM
Hi,
I have been using the following method for Inserted ID retreival:
BEGIN TRANSACTION
INSERT ......
SELECT @@IDENTITY
COMMIT TRANSACTION
would I be better off using:
INSERT ...
SELECT SCOPE_IDENTITY()
TIA
MattC
... more >>
Join is duplicating records
Posted by scuba79 at 1/7/2005 1:15:03 PM
I have the following statement:
SELECT [Month],
CONVERT(MONEY, dbo.[2004LECAdjustments].[Adjust Amount]) /
100 AS AdjustedAmount,
[2004LECAdjustments].[Return Code],
LECAdjustmentReturnCodes.Description, dbo.[2004LECAdjustments].[File Name]
FROM ... more >>
Print?
Posted by Hans de Bruin at 1/7/2005 12:39:13 PM
I have two question about print. The first one is how to flush prints
ouput. consider the fol owing:
create stored procedure sp_restore
as
print 'this is going to take a while'
restore database from disk=.....
with stats
When I execute this proc with QA the 'This is...' does not pri... more >>
ORDER by when aggregate grouping
Posted by Ian Boyd at 1/7/2005 11:39:03 AM
/*i have sample DDL, sample Data and desired output! Copy all this to QA:*/
CREATE TABLE Census (
Location varchar(50),
Province varchar(50),
Rank int,
Population int)
INSERT INTO Census (Location, Province, Population) VALUES ('Toronto',
'ON', 19330000)
INSERT INTO Census (Location... more >>
MSDE and vb.net
Posted by JFB at 1/7/2005 11:26:18 AM
Hi All,
I designed a database using MSDE (sql2000 server desktop engine) for a
vb.net application.
How can I incorporate this in my setup section so when I install the app on
the client side should install also the database.
The client doesn't have sql server or msde... Any ideas or help will... more >>
ideal location for temp db and trnaslog files?
Posted by === Steve L === at 1/7/2005 11:25:30 AM
sql2k
i'd like to re-post this topic and hope to get some more responses
1. if it's better for the transaction logs (ldf files) and the TempDb
be placed on a RAID 1 (mirror) drive, should that include other system
log files as well? (such as msdb, master, model), if so, how to move
them? (b... more >>
Transaction ID was deadlocked
Posted by Angel at 1/7/2005 11:25:05 AM
Hello, this is my peace of coding:
BEGIN
SET TRANSACTION ISOLATION LEVEL SERIALIZABLE
-- Insercion
BEGIN TRANSACTION
-- Verifica si existe la descripcion
IF NOT EXISTS( SELECT TT_COD_TIPO_TRABAJADOR
FROM TIPO_TRABAJADOR
WHERE TT_DESC_TIPO_TRA... more >>
help with datetime
Posted by JT at 1/7/2005 11:06:23 AM
why does @my_date print 'blank' while @my_other_date prints 'not blank'?
but if i select @my_date, it returns: 1900-01-01 00:00:00.000 (which, as
far as i know, does NOT equal '')
what is it that i am misunderstanding about dates??
declare @my_date as datetime
declare @my_other_date as... more >>
create index on big table
Posted by === Steve L === at 1/7/2005 10:44:28 AM
sql2k
when importing a big data file to a sql table, should i create indexes
on the table before the import or after the data are loaded? (in terms
of reducing load time).
thx :)
... more >>
SQL Server Cursors in SP or ADO.NET loops for Complex Processing?
Posted by Rupang at 1/7/2005 10:27:05 AM
Hi,
Scenario is; while developing a Web Application based on ASP.NET/C# and SQL
Server 2K, usually we need to have a complex processing which requires
multiple looping operations apart from math calculations!
So which is the best approach to encapsulate the Logic in?
1. C# Class which gets ... more >>
Help with Select statement
Posted by Terri at 1/7/2005 10:13:18 AM
How can I modify the following statement so that the LAST_UPD_DATE >=
(GETDATE()-1) part of the where statement only applies to orders with the
'CNCL' status. I want all New and Open orders and only those cancelled
orders that have been cancelled in the last day. Thanks
SELECT * FROM ORDER o W... more >>
SQL Server Query Analyzer faster than ADO.Net SQL Data Provider
Posted by vidya at 1/7/2005 10:08:48 AM
Hi,
I wrote a stored procdure in SQL Server which calculates some metrics.
This procedure always returns only one row with 11 columns of integer
values.
I ran it in SQL Server Query Analyzer thru a remote machine and it executes
the procedure in 5 to 6 seconds.
I wrote some ADO.Net SqlData... more >>
Creating System DSN programmatically
Posted by Kina at 1/7/2005 10:07:01 AM
I need to create System DSN programmatically.
Is there any function equivalent to SqlConfigDataSource in .net?
-Kina
... more >>
create text file from a stored procedure
Posted by Gene Vangampelaere at 1/7/2005 9:53:20 AM
Hello,
I have a stored procedure that makes a backup for each database. At the end
of the procedure I mail the output to a certain address. Is it possible to
save the data of a varchar to a text-file on the server ?
Gene
... more >>
String fields
Posted by Daniell at 1/7/2005 9:49:07 AM
I have three fields that if the conditions are right should be placed into a
field. The first field is a comment, the second and third fields are dates
that have been formated " / / ". What I would like to do is check the
date fields to see if there is any data in them and if so string th... more >>
Trace To Table Error MSG 568
Posted by Joseph at 1/7/2005 9:37:01 AM
I am getting an error (Msg 568) when I execute the following:
SELECT * INTO #Trace FROM ::fn_trace_gettable('G:\TraceLogins.trc', 1)
Please help.
Thanks,
--
Joseph... more >>
Reporting Service URL Settings
Posted by ~Chris~ at 1/7/2005 9:35:01 AM
I open a report in a pop-up browser and pass in the URL Parameters and
settings, including rc:Zoom=Page Width. When the user clicks and opens the
linked report the settings are returned to default (Zoom=100). How do I make
the URL passed settings persist throughout all child reports?... more >>
To know Current Database.
Posted by PVR at 1/7/2005 9:27:00 AM
Just like CURRENT_USER , CURRENT_TIMESTAMP function
Is there any function to know about the Current Database.
Thanks
PVR
... more >>
Stored Procedure/UDF help
Posted by Steve at 1/7/2005 9:20:42 AM
Hi Guys,
I'm trying to write a stored procedure which gets a result set back and
stores it to a temporary table. Once this is done, there are some extra
columns for each row that will need to be added from another relating result
set which is generated from a under-defined function. The prob... more >>
Truncate SQL server log
Posted by SPhan at 1/7/2005 8:52:58 AM
My situation is that my db's log file is growing so big and it takes a long
time for us to restore database from production to test.
Please help me understand the following:
-- Can I restore a db from Prod to Test without restoring the logfile?
-- Can I just totally truncate the log file assum... more >>
Acessing Multiple SQL servers
Posted by JP at 1/7/2005 8:41:04 AM
How (can) you acess databases across multiple servers in a single query?
In my quires I tried:
SERVER.database.dbo.TABLE.fieldname
but no luck
--
JP
..NET Software Develper... more >>
How to check stored proc dependency
Posted by SPhan at 1/7/2005 8:38:54 AM
Is there any way I can write a query that tells me what tables a stored
procedure depends on? What I mean is that I pass a stored procedure name and
the query returns me the tables that are being used in the SP.
I tried sp_depends but it does not return correct information.
I am using SQL se... more >>
convert Money to Words
Posted by JP at 1/7/2005 8:37:04 AM
I need to be able to take a Money parameter and convert it into Words. Is
there an SQL function that can do this or am I going to have to write the
longest SP in history in loop though each position in the number? This
application will be printing check so every will be words except for the
... more >>
DEFAULT doesn't work in COALESCE?
Posted by Vern at 1/7/2005 8:27:02 AM
I'm trying to insert values into a column using a parameter. If the
parameter is not passed or is NULL, I'd like to use the DEFAULT value defined
for that column. I've tried to do the following, but it gives me a syntax
error:
INSERT State(State, Name, DisplaySeq)
VALUES (@State, @Name, ... more >>
RAID advice
Posted by Nitin at 1/7/2005 8:27:01 AM
I would like to have some suggestions on placing System databases, user
databases (MDF, LDF), tempdb, and transaction log backups?
Which RAID is best for what kind of file placement.
Server will require lots of writes.
Sicne RAID 5 is not the best candidate for writes, I can't suggest to... more >>
UTF-8 for SQL Server.
Posted by ronaldoveira NO[at]SPAM hotmail.com at 1/7/2005 8:23:06 AM
UTF-8 for SQL Server.
Hi,
Sorry for my ignorance, but With the growing popularity of UTF-8
encoding I would think that next generations of SQL Server would use
UTF-8 encoding instead of the current UCS-2.
However, I see that even SQL Server 2005 still using UCS-2.
Why not use UTF-8 encod... more >>
Foreign Key Question
Posted by Brennan at 1/7/2005 7:05:01 AM
Hi All:
Is it possible for a table to conatain too many foreign keys? I am modeling
a database for a home builder that will track Customer choices for all of the
various color and material choices they need to make for their new home.
There are approximately 10 major areas of the house an... more >>
User ID and Password in the Query
Posted by VBB at 1/7/2005 6:03:06 AM
Hi,
How can I pass the user id and password in a simple SQL statement.
The scenario is, I am logged into a database. I do not have permission on a
table which is in another database of the same server. I had been provided
the user id and passoword of a user who has access to that table in... more >>
Insert data into database
Posted by Phil at 1/7/2005 5:45:01 AM
I know very little about SQL programming, but need to update a SQL database
with several hundred employee records. Can someone show me the script I can
use to automate this process. I assume it's some kind of INSERT statement.... more >>
Access mulitple databases in a single query
Posted by VBB at 1/7/2005 5:13:01 AM
I would like to query two database table object in a single query. How should
I do it.
Example:
Database1: sales
table1: employee
dbuser: scott
password: tiger
Database2: marketing
table1: associate
dbuser: john
password: cat
Both the users are assigned to the dbo role in their re... more >>
Crosstab queries and report queries
Posted by Hans at 1/7/2005 4:33:04 AM
Hello,
I have just setup my first sql 2000 server database with adp client front
end. In Access 2000 I had no problems with queries and reports.
With Access data project, I am having problems with crosstab queires, and
crosstab queires with parameters. Can anyone point me in the right dire... more >>
Unique Index and Primary Key - bits - confused
Posted by terryshamir NO[at]SPAM yahoo.co.uk at 1/7/2005 2:16:33 AM
Checked it out you are right.
The documentation is wrong:
Below from my SQL 2000 Books on line:
bit
Integer data type 1, 0, or NULL.
Remarks
Columns of type bit cannot have indexes on them.
Microsoft® SQL Serverâ„¢ optimizes the storage used for bit columns. If
there are 8 or fewer ... more >>
OLE DB Provider - how tell to not use cursor internally for join
Posted by chosse at 1/7/2005 1:27:02 AM
The OLE DB provider find way for join table in distributed query.
In some case it use cursor for join table dependent from capability of
target servers.
My question is - May I tell to the OLE DB provider to prohibit use te cursor
for join tables by set
some parameter (for example provider... more >>
Problem Transact-SQL Statement
Posted by Allen Yu at 1/7/2005 12:57:14 AM
I've come across a Transact-SQL statement as follows:
-- Statements start here
select 'EXECUTE sp_changeobjectowner ''' + name + ''', ''dbo''' from
sysobjects where type = 'U'
-- end here
Questions:
(1) How should the 'select' statement be interpreted?
(2) What are the rules for u... more >>
|