all groups > sql server programming > august 2007 > threads for wednesday august 1
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
How to write SQL statement to compare non-english characters
Posted by leejosh78 NO[at]SPAM gmail.com at 8/1/2007 11:47:01 PM
The following statement is not working, always return 0 row. I'd try
to use "=3D" also no luck.
SELECT *
FROM lists
WHERE lst_caption like %=E6=9D=8E%
Anyone can help? Thank you!
... more >>
How to convert Excel date seriel number to SQL Datetime?
Posted by Matt at 8/1/2007 10:22:01 PM
for example, 1/1/2007 is 39083 in Excel.
How to convert the number 39083 to SQL Server datetime type?
declare @datetime datetime
set @datetime = ...???...(39083)... more >>
Using SQLDMO - getting access denied error, where file system access exists
Posted by Rico at 8/1/2007 7:54:30 PM
Hello,
I have a program that uses SQLDMO to run the backup and restore of a
database to (or from) a remote machine. I'm running into an issue where I'm
receiveing the following error;
-2147218303 [Microsoft][ODBC SQL Server Driver][SQL Server]Cannot open
backup device '\\SQLServer2\c$\SQL... more >>
Enforce Select Queries Only
Posted by bastmalone NO[at]SPAM gmail.com at 8/1/2007 7:45:10 PM
I want to write an app that provides a window for a user to enter a
SQL query. However, I want to ensure that no data in the database can
be changed by the user executing the query. In other words, only
select queries will be allowed.
If it helps, once my app establishes the connection to the... more >>
is there reporting service in sql 2005 express edtion
Posted by Rajesh at 8/1/2007 7:42:32 PM
is there reporting service in sql 2005 express edtion. if yes how to
use it.
Rajesh
... more >>
FIRST in MS Access
Posted by childofthe1980s at 8/1/2007 7:18:02 PM
Hello:
Other than TOP, is there anything in SQL that would substitute for the MS
Access function of FIRST(column)? This returns the value of the first record
in a specified field.
childofthe1980s... more >>
Dynamic Search with no SQL Injection
Posted by Bob at 8/1/2007 5:17:13 PM
I think this will allow me supply a dynamic search to satisfy
a recent request.
I believe SQL Injection can not be used to sabotoge my db.
Please let me know if I am missing something.
thanks in advance...
bob.
--use tm
--exec DynaSearch 'b0b', null, null,NULL, '7/20/07', null, 'MCDOWEL... more >>
Link SQL 2000 Server to SQL 2005 Server
Posted by Stout at 8/1/2007 3:47:18 PM
Is it possible to link 2000 Server DB to 2005 Server DB? I can go
from 2005 to 2000.
Thanks.
... more >>
Don't see what you're looking for? Search DevelopmentNow.com.
Updating Only If Necessary
Posted by Ray at 8/1/2007 3:39:36 PM
I don't have to do a lot of SQL programming - so I hope I'm just
missing something... BUT...
How would you structure your UPDATE statement if you only wanted to
update records where the values of the fields being updated are
different than the values you are updating them with....
WITHOU... more >>
Moving Jobs to backup server?
Posted by schwartz.ken NO[at]SPAM gmail.com at 8/1/2007 3:21:17 PM
Hi,
I'm hoping there's an easy way to do this, but, so far, I've not found
anything. If there is no easy way, I'll settle for a hard way.
We are in the process of moving our back-up methodology from using
replication to using DB mirroring. I know that jobs are not moved, and
scripting them ... more >>
Sliding Active Window
Posted by Karch at 8/1/2007 2:53:48 PM
In a single query I would like to update the active window in a table. At a
given time, two rows will be "active". So, in the query, I will want to set
the first active (1) row in the table to inactive (0) and the first row
AFTER the last active (1) row to active (1).
CREATE TABLE [dbo].[Wi... more >>
OpenRowSet with Excel file issue
Posted by Matt at 8/1/2007 2:14:01 PM
I am using
set @sql = '
select *
FROM OPENROWSET(''Microsoft.Jet.OLEDB.4.0'', ''Excel 8.0;DATABASE=' +
@excelFile + ''', ''Select * from ['+@tab+']'')'
exec(@sql)
Some column has text value and number value (right aligned). However, the
result shows that all number value is null.
H... more >>
Select logic question
Posted by B. Chernick at 8/1/2007 2:02:01 PM
Refresh my memory. We're running SQL 2000.
I have a table with a datetime field, a due date. I wish to write a query
roughly like this: Select id, count(id), sum(datediff(day, datedue,
getdate())) from table1 group by id.
I only want positive returns from datediff added to the sum. I'd... more >>
Date time conversion
Posted by Rick at 8/1/2007 11:44:03 AM
I have the following query where I want to dynamically get a total count for
data for an entire month. I created the script below, but I keep getting the
error bellow the script. What confuses me is that when I make it so that I
can print out the select statement and then run it it works howev... more >>
pulling just the first record
Posted by childofthe1980s at 8/1/2007 9:16:01 AM
Hello:
I need to build a view in SQL. I have my dataset, but I only want to
extract certain records of it for my view.
Specifically, I want to select only the first record of data based on the
journal entry number (JRNENTRY field) and the account number (ACTNUMST
field).
At the be... more >>
How to track changes to status of customer?
Posted by NH at 8/1/2007 7:50:02 AM
Hi,
I am looking for some advice on the best approach to this. I have a
Customers table and each customer is marked with a status as "New" or
"Existing".
Now I also have a forecast table which just holds sales forecast values for
the year for these customers. At any point in time the use... more >>
Identity Column problems with Unique Constraint Violations
Posted by MistaG at 8/1/2007 7:22:04 AM
Hi there,
I have a table as follows:
CREATE TABLE [dbo].[sampletable]
(
IdColumn INT NOT NULL IDENTITY(1,1) CONSTRAINT [pk_idcolumn] PRIMARY KEY,
OtherIdOne INT NOT NULL,
OtherIdTwo INT NOT NULL,
Description VARCHAR(100) NOT NULL DEFAULT ('Some Text'),
CONSTRAINT [idcolumnsunique] UNI... more >>
Help pulling from 2 tables via a drop down list selection
Posted by Joe M at 8/1/2007 4:48:01 AM
Hi, this is something that i have never run accross before; new to more
complex SQL programming so excuse the newbness if there is such a thing.
What I have is about 25 different sections that are a table and I have a
drop down list that they are all in. What I would like to do is when a u... more >>
Does anyone know how this is done
Posted by SG2008 at 8/1/2007 4:10:01 AM
Do you know how this company achieved this SQL 2005 Add-i
http://www.etekglobalinc.com/Downloads/SQLServerDownloads/tabid/320/Default.aspx
It does load the Stored Procedures in the Query Editor window itself. I
haven't found much documentation about the Add-In. All I know is MS doesn't
suppo... more >>
MSDTC Error
Posted by Hayatbakhsh at 8/1/2007 2:02:02 AM
Hello
I have created a View. In this View I refrenced to another View using
LinkedServer like as this:
create view dbo.MyView AS
select * from server1.db1.dbo.view1
In View1 that is maked at server1, I have code like as this:
create view dbo.View1 AS
select * from server2.db2.dbo.Table2
... more >>
Need help with create SQL query
Posted by staeri NO[at]SPAM gmail.com at 8/1/2007 1:06:21 AM
I have a booking system where bookings are saved per product, city and
week in tblSchedule
tblSchedule:
ScheduleID
CustomerID
ProductID
CityID
WeekID
All weeks are saved in tblWeek with WeekID from 1-52.
tblWeek:
WeekID
WeekDescription
I need help with creating a SQL query which ... more >>
Job executing very slow
Posted by Ghanshyam Lohar at 8/1/2007 1:06:10 AM
I have a stored procedure which does some kind of summarization for
reporting. The stored procedure completes in about 2 minutes going through a
few million records. I have hardcoded a few values like scheduleddate and
some id in the query. I need this SP to run in a scheduled job. So I create... more >>
how we can use stored procedure 7 why it is use?
Posted by at 8/1/2007 12:30:34 AM
how we can use stored procedure 7 why it is use?
... more >>
REORGANIZE INDEX in SQL 2005
Posted by offer.sasson NO[at]SPAM gmail.com at 8/1/2007 12:28:52 AM
I am using SQL Server 2005 ENT 64.
I have a NONCLUSTERED INDEX and NO PARTITION index which I want to
REORGANIZE:
I am using the following command:
ALTER INDEX [INDEX-NAME] ON [OBJECT] REORGANIZE WITH (LOB_COMPACTION =
ON)
The command finishes very fast, and after checking the report un... more >>
Column Count -vs- Table Count performance trade-offs?
Posted by Bob Milutinovic at 8/1/2007 12:00:00 AM
Greetings, folks.
I'd originally posted this to the inetserver.asp.db group, but was advised
this one was a more appropriate one in which to ask this question.
Hoping someone here can give me even a half-informed (or at least
well-argued) opinion on which route to take for better performan... more >>
Query Optimization
Posted by Henning Eiben at 8/1/2007 12:00:00 AM
Hi,
I have a DB-based application, which has a UDF like this:
CREATE FUNCTION fn_concat(@A varchar(255), @B varchar(255))
RETURNS varchar(255)
AS BEGIN
RETURN coalesce(@A,@B)
END
Using SQL-Server 2000 I execute the following statement:
SELECT DISTINCT
A.a, dbo.sp_concat(A.b, A.c) ... more >>
Best way to accomplish this type of update in T-SQL
Posted by Brian Simmons at 8/1/2007 12:00:00 AM
Hi all,
SQL Server 2005
What's the best way to accomplish this type of an update in a stored
procedure?
User can pass in a string value, or they can omit that string value (and it
will default to NULL). The end goal is:
UPDATE TABLE
SET column =
IF parameter IS NULL
column
E... more >>
best way to get 10 random rows from 2 tables and compare
Posted by Matt Williamson at 8/1/2007 12:00:00 AM
I'm trying to figure out the best way to compare data in 2 tables that are
being created from different processes but should contain roughly the same
data. I can't do an exact comparison because one contains columns the other
doesn't, but I can select a few columns that are the same in each an... more >>
Load trc file to table
Posted by Yan at 8/1/2007 12:00:00 AM
Hi,
SQL Server 2005 sp2.
I encounter the bellow error while trying to load a trace file to a table.
SELECT * INTO dbo.TraceTable FROM
::fn_trace_gettable(N'E:\Backup\Traces\ProfilerGeneric4', DEFAULT)
----------------
Msg 567, Level 16, State 5, Line 1
File 'E:\Backup\Traces\Pr... more >>
Is AWE necessary to access 4 GB RAM?
Posted by John Kotuby at 8/1/2007 12:00:00 AM
Greetings...
I have SQL Server 2005 Standard running on Windows 2003 Server Enterprise
32-bit.
The machine has 4 GB of physical RAM installed.
Must I enable AWE in order to allow SQL Server 2005 to use all available
RAM?
Thanks for your replies.
... more >>
Insert statement errors
Posted by obelix via SQLMonster.com at 8/1/2007 12:00:00 AM
I've got an application that passes parms to an insert stored proc. My
problem is that I get an error that says 'String or binary data would be
truncated'. If I restore a back up of the same DB onto a different SQL server
I dont get the error.My initial impression was that there is/are columns
... more >>
|