all groups > sql server programming > august 2007 > threads for wednesday august 22
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
xp_cmdshell permission denied SQL 2005
Posted by jose.mendez22 NO[at]SPAM gmail.com at 8/22/2007 11:32:09 PM
My issue. I'm running a web app which makes command calls to a DB
using SQL Authentication. One task the app will have to do is utilize
th "xp_cmdshell" to populate an Excel spreadsheet and move the file
from location A to B which is a linked server. Since the DB user
executing all my sql com... more >>
EstimateIO,EstimateCPU in STATISTICS PROFILE.
Posted by shiju at 8/22/2007 11:23:11 PM
Is IO and CPU cost associated with a operator is a total cost or
Average cost(executes)?
Thanks
Shiju Samuel
... more >>
Can this be done in a query
Posted by vidya at 8/22/2007 9:47:12 PM
Hi,
Is it possible to achieve this using a simple query and without
procedural language? I can do this with a stored proc but I would like
to know if it is possible to get this with only a SQL query.
I have a table that contains list of customers(customer id) and
another table installed prod... more >>
A function for removing unwanted signs
Posted by natalymolyneux NO[at]SPAM gmail.com at 8/22/2007 8:57:40 PM
Hi everybody :-)
I am new to the forum and to the MS SQL programming. Could anybody
help me with my problem please?
I have a source flat (.txt) file that I am trying yo import in a
table. Every single field in each row has "~" signs at the beginning
of every field's data and also at the end... more >>
SQL CURSOR
Posted by IntraRELY at 8/22/2007 8:33:33 PM
I have a table with 100,000 row which represent Sales Leads. Primary key is
ACCOUNTNO.
I am trying to distribute them evenly between 5 sales reps EVENLY. I dont
want one rep getting all of a particular state and is why I am inclined to
loop through them individully using a cursor.
How ca... more >>
set default value 0 for int column
Posted by .nLL at 8/22/2007 7:43:27 PM
hi, im using sql server management studio to manage my sql server and want
to set default value 0 for an int column but got problem.
when i enter 0 to default value or binding section it becomes ((0)) and
doesnt set default value to 0
can some one explan what i am doing wrong?
also if i... more >>
Replace integers within varchar column
Posted by SqlBeginner at 8/22/2007 7:42:01 PM
Hi,
I am using SQL Server 2005. I have few 'Varchar' columns in my table. Now I
want to find out all integer values within a given 'Varchar' Column and
replace it with someother character. What's the easiest way of doing it?
For ex:
Create table test
(
s varchar(100),
a varchar(100)
... more >>
convert GMT to local time (DST sensitive)
Posted by John Grandy at 8/22/2007 6:00:45 PM
What is the best option for converting datetime values stored in db as GMT
to local time values properly adjusting for daylight savings time ?
Example: convert a GMT time to EST during standard-time portion of the year
and to EDT during a daylight-savings-time portion of the year.
... more >>
Don't see what you're looking for? Search DevelopmentNow.com.
Need help with SQL query
Posted by mitra at 8/22/2007 3:34:00 PM
Hi All,
There are three tables that I need to query to return a resultset
with certain data so that I could export the resultset to a text file:
Below are two samples of what the resultsets in the text file should look
like:
"nMessageID", "Subject", "Date", "Message-ID"
100,"Re: update"... more >>
Row By Row Processing Script
Posted by Pasha at 8/22/2007 2:34:02 PM
I'm developing an ETL process for Web Logs and have to apply some business
logic to the web sessions. The first step is to assign a different session
ID to the session with 'EXIT' method. Using a cursor (below) it will take an
enormous amount of time, as the logs can be big. (Some of the de... more >>
How to profile blocks?
Posted by Ian Boyd at 8/22/2007 2:22:05 PM
The reason i want to profile blocks is that i have an UPDATE statement that
normally runs near instantly, but occasionally will take up to 30 seconds,
before the client application gives up. The problem is obviously a block
that is held that is keeping the update from completing.
Right no... more >>
How to invoke DTSX package from stored proc?
Posted by <-> at 8/22/2007 2:02:32 PM
In order to perform bulk data inserts, we have a DTSX/SSIS package created
in SQL Server 2005 that performs a bulk insert into a table.
The package works fine, but, what's the best way to invoke it from a stored
proc?
One way that I know of is using xp_cmdshell with 'dtexec', but from what... more >>
Guid conversion error
Posted by KathySS at 8/22/2007 1:48:10 PM
I get the following error message - "Conversion from type 'Guid' to type
'String' is not valid."
Here is the SQL code
SQL code - Dim myCommand2 As New System.Data.SqlClient.SqlCommand("UPDATE
aspnet_Users SET aspnet_Users.InstantASP_UserID = " & UserID.ToString() & "
WHERE aspnet_Users.Use... more >>
Transaction log query
Posted by Sammy at 8/22/2007 12:42:03 PM
I have seen a clients transaction log that is 35 gb the database is 6gb. The
drive where the database is has about 30gb free space.
Apart from the transaction log eventually filling up the drive if its not
backed up or truncated and shrunk or the Db put in simple mode....in its
current stat... more >>
date handling
Posted by rodchar at 8/22/2007 10:58:01 AM
hey all,
given:
Select @Date1 = 9/1/2007
Select @Date2 = 8/16/2006
Select @Date3 = ??
i'd like to make @Date3 equal to the month and day of Date 2 and the year
from Date 1. What the easiest way to do this?
thanks,
rodchar... more >>
Database File Information/Path
Posted by Dragon at 8/22/2007 10:24:28 AM
Hi,
I am trying to write a script that will display physical files information
for all databases. I can find physical path for the MDF files but I cant's
seem to be able to find information on log and other files. Does anyone know
where I can find the path information for all files belongin... more >>
Help! Can anyone solve this stored procedure problem?
Posted by Sandy at 8/22/2007 9:04:07 AM
Hello -
I am using Sql Server 2005 and Crystal Reports 9.
I need to produce a report from the following simplified tables:
tblLoans
(LoanID,
DateEntered,
LoanType,
FileNumber)
tblBorrower
(BorrowerID,
BorrowerLast,
BorrowerFirst,
LoanID)
tblBusiness
(BusinessID,
... more >>
join optimization
Posted by Stephane at 8/22/2007 8:26:05 AM
Hi,
I have this query:
select top 1000 count(1) as nbCount, tbl_logs.fk_tbl_currentPages_id as item,
DATEADD(wk, DATEDIFF(wk, 0, dateadd(hh, 0, dateadded)), 0) as sDate
from tbl_logs
join (select id from tbl_visits
where
tbl_visits.fk_tbl_websites_Id = 10203
and tbl_visits.startT... more >>
full text search does not work
Posted by xiang.sun NO[at]SPAM hotmail.com at 8/22/2007 6:56:34 AM
I am using Microsoft SQL 2000. The information below is about its
version. When I activate my database, add full text categroy, add
index to my table, and activate it, I try to use contains or freetext
perdicates to search my tabel. Nothing happen. There is always 0
record. I do not know what is... more >>
how to query top 1 record for each group
Posted by xiang.sun NO[at]SPAM hotmail.com at 8/22/2007 6:46:17 AM
I do not want to use cursor which is too slow and want to use one
statement to query top 1 record from each group. For example, I have a
table including name and address. For the same name person he could
have lots of records which may same or not. I just need one for this
person. Is that possib... more >>
Creating a Backup Batch File for SQL 2005 Express
Posted by Leo Demarce at 8/22/2007 6:34:02 AM
I have 2 parts to this question based on this problem; I need to create a
scheduled backup for my SQL 2005 Express databases, but the Management Studio
Express does not come with an agent to process scheduled backups.
Part 1: has there been any kind of release from Microsoft to provide this
... more >>
Best practice, tip to write efficient code
Posted by joker197cinque NO[at]SPAM gmail.com at 8/22/2007 3:55:35 AM
Hello everyone,
can you point me to some resources/link to deepen my knowledge in
writing views, stored procedure, triggers in sql server 2005/t-sql ?
Any help really appreciated.
Best regards.
... more >>
Difference between =* and RIGHT OUTER JOIN
Posted by bgt at 8/22/2007 1:53:14 AM
Hi,
I wonder if someone can explain me the difference between =* and RIGHT
OUTER JOIN.
I have a db on SQL Server 2005 (Compatibility level is set to SQL
Server 2000).
When I lauch the following query:
SELECT DBUser_ID, ul.Location_ID, blnActivated, Location_Description
FROM tbDBUsers_Lo... more >>
Difference between LIKE and = (equals sign)
Posted by Richard at 8/22/2007 1:29:09 AM
Hello!
If I search a table using a varchar field value, is there any
difference (performance-wise) between
SELECT * FROM mytable WHERE myfield = 'somevalue'
and
SELECT * FROM mytable WHERE myfield like 'somevalue'
?
Regards,
... more >>
E-Mailing stored procedure results of job (SQL Server 2005)
Posted by Zamdrist at 8/22/2007 12:00:00 AM
What would be the preferred method of e-mailing the results of a
stored procedure ran via a scheduled job? The results would be sent to
myself, doesn't have to be fancy or anything.
I have the procedure, I can create the job...anything pointers would
be appreciated. Thank you.
Steve
... more >>
RESTORE DATABASE
Posted by Michael C at 8/22/2007 12:00:00 AM
I'm issuing a restore database command without using the WITH REPLACE option
but it overwrites the database regardless. SQL is below, it creates a
database, backs it up, inserts some data and then restores it. The inserted
data is overwritten and lost! I expected this statement to give an erro... more >>
Rewrite Access SQL for SQL Server
Posted by Mike Will via SQLMonster.com at 8/22/2007 12:00:00 AM
I've tried unsuccessfully to rewrite this query from Access in a way that SQL
Server can interpret it.
This is the Access query:
[OTHours]+[OTType]/1000000+NZ([OTRefusal],0)/10000000+IIf(tblOvertime.
OTRoster=tblEmployee.OTRoster,0.00000001,0.00000002)
Here is what I've tried in SQL Ser... more >>
option db_chaining
Posted by Andrea Anastasescu at 8/22/2007 12:00:00 AM
Hi everybody,
I have a problem with issuing sp_dboption <my_db>,'db_chaning', 'off'
It gives me an error:
Database option 'DB_CHAINING' does not exist.
SQLServer 8.00.194
Unfurtunatly, this line is generated automatically by visual studio team
edition for DB Proffesionals, so I can not ... more >>
|