all groups > sql server programming > february 2007 > threads for friday february 2
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
How to monitor a particular table using profiler
Posted by prashant at 2/2/2007 11:07:22 PM
I want observe what entries are getting into a table while I run an
application
OR any activities happening on a particular table
..How to monitor this
... more >>
Query Help Urgent!
Posted by Jami at 2/2/2007 9:07:36 PM
Hi!
I have following table structure and sample data
create table tbl_Mtab (ref_no char(10),date_time smalldatetime,stage
smallint)
go
insert into tbl_Mtab values('GKA0000001','2003-02-25
11:25:17.340000000','1'
insert into tbl_Mtab values('GKA0000001','2003-03-18
18:00:59.917000000'... more >>
how to create pivot table with the value
Posted by bobyang03 NO[at]SPAM gmail.com at 2/2/2007 6:59:41 PM
I have few questions, and thanks to all of you!
I try to do pivot tables in few way, as long as one way works, it will
be great!
1. I have created pivottable query with Access adp to SQL server. it
shows out correctly as what I want. how can I export it? I have hard
to time export it as org... more >>
Massive Load
Posted by Just D at 2/2/2007 6:31:22 PM
I have about 1 million rows of data written in a text file, about 10 columns
of different types. What's the fastest way to load the data in the DB table
keeping in mind that I can load this data into my own application to
generate any script from this text file or whatever if required to simpl... more >>
Replace
Posted by Ed at 2/2/2007 5:33:00 PM
Hi,
I have a query which join many tables together. However, some of the
datatype in the base tables are varchar(50). that's why the result of the
query returns something like $50 and 46% but they are actually characters not
Numeric.
My question is in the query, is there anyway I can d... more >>
getting two columns - avoiding two selects ?
Posted by jobs at 2/2/2007 3:49:02 PM
There must be a be a better way way to two pieces of information into
another table right?
Thanks for any help or information!
declare @jobname varchar(20),
@username varchar(20)
set @jobname = (select jobname from ActiveJob where jobno = @jobno)
set @username = (select use... more >>
indexes on the incremental
Posted by at 2/2/2007 3:42:03 PM
Does it make sense to add indexes on the incremental columns. Please help
... more >>
How can I return a column from several table columns?
Posted by ABC at 2/2/2007 3:32:29 PM
Table1(Code, AppCode1, AppCode2, AppCode3, AppCode4)
TableResult(Code, AppCode)
Is this the best statement?
Insert into TableResult Select Code, AppCode1From Table1 Where AppCode1 in
(@AppCode1, @AppCode2)
Insert into TableResult Select Code, AppCode1From Table1 Where AppCode2 in
(@App... more >>
Don't see what you're looking for? Search DevelopmentNow.com.
Business logic in triggers
Posted by Ken VdB at 2/2/2007 3:26:16 PM
Hi there everyone. I am working on an order entry system and I had in =
mind the idea that I would implement much of the basic business logic as =
triggers.
=20
I have an OrderDetails and an OrderHeaders table. The OrderHeaders =
table has a SubTotal field. I would like to have this fiel... more >>
Getting data of a networked drive
Posted by Robert Bravery at 2/2/2007 3:24:53 PM
Hi all,
I am importing dbase data.
I am trying to use opendatasource
SELECT *
FROM OPENDATASOURCE
( 'Microsoft.Jet.OLEDB.4.0',
'Data Source=\\Grms-win2k-pdc\DBASE\grms0506";Extended properties=DBASE
IV')...motclm06
But get an invalid path error.
THe current SQL server as a connect... more >>
SQL 2005 SSIS read flatfile and bcp troubles
Posted by === Steve L === at 2/2/2007 2:35:46 PM
For a flat file import to sql table:
In SQL 2005, I can't no longer read a text file into sql table
easily. But it's a snap in sql2000.
When bringing in a text file you know very little about in sql2000
you create a dts package, add a text file (source) task, locate the
flat file, then c... more >>
Running Totals Based upon Date
Posted by Casey at 2/2/2007 2:18:01 PM
Hi!
This is driving me nuts, and hopefully someone has some insight.
When I'm doing is summing a monthy count of a string, and attempting to
create a running total, based upon the month and year. It worked fine until
the new year, then it restarted the running total for Jan '07. Here's the SQL... more >>
What is your favorite data/schema migration tool
Posted by Ryan S at 2/2/2007 2:06:02 PM
Hi all,
I am looking for tools that will simplify migration from Dev to staging to
prod (including logins and permissions). If it does other things great.
What are people's favorite?
This product should work for SQL 2000 and 2005.
Thanks
--
Ryan S
Sr SQL DBA
1Jn5:12... more >>
working with ascii decimal values
Posted by JTL at 2/2/2007 1:42:26 PM
i have a bunch of values stored in an nvarchar column which are actually
ascii dec values, but due to the column datatype, they are now in string
format (i realize this is a backwards storage scenario- at best, but its
what i must work with right now).
sooo- i need to convert these ascii de... more >>
query challenge
Posted by Pat at 2/2/2007 1:41:02 PM
Hi Freinds,
SQL 2000
I need your help to write a query please...
I have a table like :
mid amount dinsert
----------------------------------
1 9.99 1/1/2007
1 10.25 1/5/2007
2 5.24 1/6/2007
3 3.25 1/6/2007
3 6... more >>
group by
Posted by cris at 2/2/2007 1:21:00 PM
Whenever i run this query.
select substring(seg3_code,4,2) + seg2_code as office,
substring(seg3_code,4,2) as soc,
REPLACE(str(round(sum(current_balance),3),20,2),'.',',') as balance,
from glbal
where balance_date > '2006-01-01'
group by seg2_code, substring(seg3_code, 4,2)
i get this m... more >>
CASE SELECT
Posted by wnfisba at 2/2/2007 12:58:00 PM
Trying this CASE SELECT statement and it does not like it.
Can anyone help???
Is this possible???
Thanks in advance for your help.
wnfisba
where a.loan_number in (case when @OO = 1 then (select b.loan_number from
dbadmin..aigbankpull b where b.occupancy = 'O/O')
... more >>
Can I search all views and stored procedures that contains the specific words?
Posted by ABC at 2/2/2007 12:47:59 PM
As we will change the datastructure, We need to prepare and list all views
and stored procedures to be modified.
Can I search all views and stored procedures that contains the specific
words?
... more >>
Creating a Derived Column
Posted by James at 2/2/2007 12:36:00 PM
I am new to sql and would like to know how I can create a derived column
called 'level' based on the value of a table column. i.e. I have a table
tblAges with an 'age' column. The age column contains positive integer values.
If the value of the 'age' column is less than 50 the derived column sh... more >>
get file size
Posted by rodchar at 2/2/2007 12:03:00 PM
hey all,
i'm storing my files as binary data inside my database table. is there a
function to get the file size of the file in the binary column?
thanks,
rodchar... more >>
Return value from EXEC
Posted by Mats Hansson at 2/2/2007 11:35:06 AM
Hi,
Is it possible to return a value when using EXE on a sql string?
For example:
DECLARE @SQL VARCHAR(1000)
DECLARE @ROWS INT
SET @SQL = 'SELECT COUNT(*) FROM Table'
EXEC @SQL, @ROWS OUTPUT
This doesn't work, but shows my idea. Can anyone help me?
Thanks,
Mats
... more >>
How to exec AUTO_UPDATE_STATISTICS_ASYNC?
Posted by perplexed at 2/2/2007 11:16:36 AM
I'm trying to run this in 2005
alter database mydb AUTO_UPDATE_STATISTICS_ASYNC ON
but get this error
Msg 156, Level 15, State 1, Line 1
Incorrect syntax near the keyword ON.
What am I doing wrong?
... more >>
Finding out if an object esists using SQL Server SMO
Posted by Patrick Hill at 2/2/2007 11:15:15 AM
Is there a way using SMO to find out if an object exists?
I want to find out if this sp exists on the server
[dbo].[spGetActiveEmps]
I know I would have to use something like:
theserver.Databases.Item(DBName).StoredProcedures.Item([dbo].[spGetActiveEmps])
... more >>
Partition large table
Posted by Andy at 2/2/2007 11:02:00 AM
I have a table with about 235 million records that we would like to split up
into monthly partitions for obvious reasons. The question I have is what is
the best way to do this? You can create the partitioned tables ahead of time
and loop through the table with a cursor and then based on the... more >>
GOTO...LABEL: syntax problems
Posted by Usarian at 2/2/2007 10:37:58 AM
I can't get my label to take.
I have SQL Server 2000.
I have tried putting the colon both before the tag as in:
http://www.microsoft.com/technet/prodtechnol/sql/2000/reskit/part2/c0761.mspx?mfr=true
http://www.akadia.com/services/sqlsrv2ora.html#_Toc513865464
and after the tag:
http://msdn... more >>
View with lookups and sums
Posted by Steve Mahon at 2/2/2007 9:26:01 AM
I'm working on an Inverntory application with MS Access DOA MDB front-end and
SQL 2005. Currently I have a vba function that calculates available inventory
for a particular item. I'd like to create a view in sql that has the current
information for all the products. Here is the existing struct... more >>
Passing Multi List Parameter Values To Stored Proc
Posted by Anonymous at 2/2/2007 9:17:01 AM
Using SQL Server 2005 I am creatiing a stored procedure to create a data
source for a report.
The parameter value can have multiple values separated by a semi-colon. The
code works fine except when the user does not pass in a value.
I can get it to work using an
If parameter value is ... more >>
sql server see different words as equal
Posted by Helmut Woess at 2/2/2007 8:49:07 AM
Hi,
i use SQLExpress and made a test with a table with only one field of type
varchar(50) and set it as primary key. At first i inserted "dass", then i
tried to insert "daß", but here i get the error 2627 - primary key
violation, a duplicate key cannot be inserted ... ??
thanks,
Helmut... more >>
FullText syntax for ANDing?
Posted by Ian Boyd at 2/2/2007 8:22:21 AM
i've created a fulltext catalog on a Customers table.
Lets say i have the keywords:
John Smith Miami
i only want rows returned that contain all those keywords. i don't care
which columns they appear in, as long as all of the keywords appear. i
blindly tried:
SELECT *
FROM Customer... more >>
Problem organizing data in table/results
Posted by schaapiee at 2/2/2007 7:52:57 AM
I have this table: #tmpAll
'Inst' 'Port' 'Tier'
22 6800 AchID
22 6800 BizMMA
22 6800 COD
22 6800 DbtCrd
22 6800 MerID
22 6800 Notes
and am writing the following code:
SELECT DISTINCT
Port,
Bal_10K = CASE Tier WHEN 'Pkg>10K' THEN 1 ELSE 0 END,
MerID = CASE Tier WHEN 'MerID' T... more >>
stored proc recompilation
Posted by Panos Stavroulis. at 2/2/2007 7:16:00 AM
Hi,
I have the following situation
INSERT into #tmp
select A.address, B.name, B.age,..... etc
FROM address A JOIN employer B
ON (A.id = B.id OR(A.sec_id = B.sec_id and B.age is NULL))
Notice the OR in the ON statement. Now when that runs it runs slowly.
If I separate the OR into 2 sep... more >>
dynamic Schema
Posted by sqlextreme at 2/2/2007 6:08:00 AM
Hello
It is possible the creation of dynamic plans, that permit the validation of
entrances XML, but that these plans be loaded or stored in table?
Thank.
Cristián Carrasco G.
... more >>
give your servername, username,password , u can see that in c:\T1I
Posted by Ramesh Subramaniyan at 2/2/2007 6:05:01 AM
u can see that exported file follwing location c:\T1Import88.CSV
DECLARE @SQL VARCHAR(2000)
DECLARE @AllowExportExcise VARCHAR(200)
DECLARE @DataBase VARCHAR(100)
DECLARE @Server sql_variant
DECLARE @Path VARCHAR(200)
DECLARE @ExportResult INT
SET @DataBase = DB_NAME... more >>
isql comand truncates database name in the -d option
Posted by leoh at 2/2/2007 6:02:00 AM
The command
C:\Documents and Settings\bs0001143>"isql.exe" -S "CSBM0105" -E
ssTivoli -d DRMS
_DirectoryServices_rms_bms_com_br_80 -Q "exec
sp_databasepercentspaceused DRMS_D
irectoryServices_rms_bms_com_br_80"
Returns error:
Msg 911, Level 16, State 1, Server CSBM0105, Line 1
Could not... more >>
International Date Options
Posted by Jaco at 2/2/2007 5:33:01 AM
I have some confusion about date formats in SQL Server
We have a SQL server that uses Latin1_general_ci_as as the default collation.
This server is installed on operating system with Dutch regional settings.
The default language in Syslanguages is set to us_english.
When I run this query:
U... more >>
How to record SQL calls when using Callable Statements?
Posted by cormac.foley NO[at]SPAM gmail.com at 2/2/2007 4:36:20 AM
Hi,
I'm developing a java application which uses SQL Server as the
database. I use Callable Statements to connect to the database. When
running the application I want to be able to monitor locks/process
info etc in the 'Current Activity' section in the 'Management' section
in SQL Server.
T... more >>
mssql 2005 problem, to many requests, need to optimize
Posted by Patrick F at 2/2/2007 2:54:00 AM
Hello, I have a bit of a problem. Some of my pages has way to many database
requests, some pages upto 70 requests,
and the loading time can be all the way up to 12seconds because of the many
requests. So i am trying to optimize it abit.
What i want to know if how to send several ID's to the da... more >>
I can delete but not insert!
Posted by Nab at 2/2/2007 2:45:01 AM
I have a frontpage website published on my local IIS and connected to a sql
server 2005 exoress through a system DSN datasource. My OS is Win XP. I can
delete records from a table in that database (through frontpage's database
editor). Howere, when I choose to insert a record nothing is insert... more >>
I can delete but not insert!
Posted by Nab at 2/2/2007 2:45:00 AM
I have a frontpage website published on my local IIS and connected to a sql
server 2005 exoress through a system DSN datasource. My OS is Win XP. I can
delete records from a table in that database (through frontpage's database
editor). Howere, when I choose to insert a record nothing is insert... more >>
how to use select query
Posted by junior at 2/2/2007 1:39:24 AM
Hello,
I am using sql server 2000 there is a problem with my select query.
scenario is:
I have three tables alert, contact and event.
now i have to show there data in gridview.
issue is this i need to select alert ID from alert table and event
name from event table and contact anme f... more >>
Select Into variable in Stored procedure without return it as result?
Posted by mtczx232 NO[at]SPAM yahoo.com at 2/2/2007 1:36:11 AM
I need to collect some info from select to variable like this:
select name=@name, date=@date ... from customers
but it's also return it as result set. have a way to prevent it from
return it?
I know that have another ways like cursor or Memory table but all
those ways need more coding ref... more >>
|