Home All Groups Group Topic Archive Search About

SQL Server database programming

microsoft.public.sqlserver.programming
Score Select statement
smk23 - 3 Sep 2005 9:50 PM - 3 messages
In this statement: "SELECT DISTINCT Address1 FROM Address" I would also like to see a couple other fields like AddressID and City, but want only the Address1 to be distinct. How would I write this? TIA ...
Score Understanding EXISTS
Paul Pedersen - 3 Sep 2005 8:09 PM - 6 messages
Working my way through t-sql here... In a book, I was given this example: SELECT Pub_name FROM Publishers WHERE EXISTS     (SELECT * FROM Titles     WHERE Titles.Pub_id = Publishers.Pub_id     AND Type = 'business') ...
Score Extracting Image from SQL Server
xactdata - 3 Sep 2005 4:43 PM - 1 message
I am currectly extracting an image field type from a SQL Server table using... dr is an OleDataReader object Byte b[] = __gc new Byte[Convert::ToInt32((dr->GetBytes(0, 0, 0, 0, Int32::MaxValue)))]; dr->GetBytes(0, 0, b, 0, b->Length); ...
Score Return One Row Per User, not TOP(1) HELP Please
Eamon Straughn - 3 Sep 2005 3:34 PM - 11 messages
SELECT AppFnd.afId, AppFnd.approve, AppFnd.Friend, AppFnd.apId, AppFnd.UName, Friends.Message, Friends.Rating, Friends.apId AS Expr1, Basic.Country, DATEDIFF(d, Basic.Dob, GETDATE()) / 364 AS Years, (12 - (DATEPART(m, Basic.Dob) - DATEPART(m, GETDATE()))) % 12 AS Months FROM ...
Score How to upload dynamic text file !!. Experts Only !!!
Ahmed Jewahar - 3 Sep 2005 12:05 PM - 6 messages
Dear All, I have project and I'm in the middle of system design & analysis. I would really appreciate if you could share your knowledge in the following area where I'm newbie. In Win2k/Win2003 server, SQL2K is running. I have a folder called ...
Score Fully qualified object names help reuse of execution plans.
Damien - 3 Sep 2005 11:51 AM - 3 messages
Fully qualified object names help reuse of execution plans. Is this true?  Discuss. Also, what constitutes fully qualified? Is it server.database.owner.object or can you get away with database.owner.object and still resuse your execution plans? ...
Score SqlException: Unknown error.
Lloyd - 3 Sep 2005 12:51 AM - 3 messages
I have some code doing a very simple select "select bonusid from game where gameid=@gameid" that works about 98% of the time, but somewhere around two percent of the time it throws an exception.  If I go through the sqlerror's ...
Score Error on query execution in VBA Excel using ADODB on SQL Server
Glenn Ray - 2 Sep 2005 10:04 PM - 2 messages
We're trying to upsize from MS Jet (Access) db to SQL Server and am having a major problem.  Because we've not seen this error with the MS Jet db, I suspect it's related to the user configuration in SQL Server. ...
Score Lookup tables
tshad - 2 Sep 2005 9:31 PM - 24 messages
What are the typical things you look for to decide whether to use a lookup table? I typically have Country lookup tables, State lookup tables, Airline lookup tables, etc. We also have a field that is a company type which would be one of 6 values: ...
Score triggers
greg - 2 Sep 2005 8:21 PM - 6 messages
hello, i have a basic question about triggers.  are they created the same way you create stored procedures?  right click on the stored procedure and pick new stored procedure? i created a new stored procedure and inserted this text: ...
Score GoalSeek in SQL Server?
carmaboy - 2 Sep 2005 7:52 PM - 8 messages
Has anyone create a GoalSeek function similar to that of Excel?  I've been researching this and trying to script one out myself without much sucess.  If someone could tell me that its impossible, that would be helpful too.  TIA. ...
Score Clustered index on Identity field
Pradeep Kutty - 2 Sep 2005 6:43 PM - 2 messages
Hi All, I have heard that if you create a clustered index on identity column(PK also) it would decrease the page splits. But how? Thanks, Pradeep ...
Score Cursor Update problem
Shannon Thompson - 2 Sep 2005 6:43 PM - 10 messages
I am using a cursor to take information from a temp table and either insert or update another table.  I am using a while loop to fetch all the vaules from the cursor and then I close and deallocate the cursor.  Everything runs ...
Score Sys Tables for Datetime type
wnfisba - 2 Sep 2005 6:33 PM - 9 messages
I am looking for a specific Datetime column and I don't know what table it resides in. How can I query the systables looking for all those columns with Datetime type??? Thank You! ...
Score Execute Command No transaction
Chris Calzaretta - 2 Sep 2005 6:33 PM - 3 messages
How would I execute a stored procedure and turn off the transaction. We do not care on our end if the data makes it over. So we dont need transaciton. Any Idea? Thanks ...
Score SELECT @Variabe = Dynamic string HOW???
James Hancock - 2 Sep 2005 6:30 PM - 8 messages
Here's a user defined function I'm working on: CREATE FUNCTION dbo.CreateList (@Table varchar(50), @ListField varchar(50), @Query varchar(500)) RETURNS nvarchar(1000) AS BEGIN DECLARE @List nvarchar(1000) SELECT @List = COALESCE(@List + '', '', '''') + @ListField + ' FROM ' + @Table + ' WHERE ' + @Query + ' ORDER BY ' + @ListField ...
Score Age Average
wnfisba - 2 Sep 2005 5:51 PM - 7 messages
I have to calculate the average age in a group. What is the best way to calculate the average age where I have the individual's birth date??? Thanks in advance! ...
Score How to capture result from READTEXT?
Snake - 2 Sep 2005 5:49 PM - 8 messages
In the continuing saga of dealing with blobs . . . READTEXT is a fine function, but useless by itself. I need to return the results of READTEXT into a varchar column but have been unable to do so or even find a similar example. Displaying the results in Query Analyzer is all ...
Score How to do field content search in sql
Raymond - 2 Sep 2005 5:36 PM - 6 messages
Hi everyone I have a silly question about SQL, I wonder if it is possible using existing technique to accomplish it. I have a binary field(e.g. Image) in SQL, I need to store image file(scanned from original document) in that field. I don't think it is ...
Score Please help Invalid Cloumn Name
Dib - 2 Sep 2005 5:36 PM - 3 messages
Hi, Here is my SP I  need to run this as this ConFirmOrders_SP 'SVR,UCC' this is giving me Server: Msg 207, Level 16, State 3, Line 1 Invalid column name 'UCC'. Server: Msg 207, Level 16, State 1, Line 1 ...
Score Shrinking a db
bagman3rd - 2 Sep 2005 5:34 PM - 3 messages
I am having trouble shrinking a database.  The database is 14 gig, with 6 gig free space.  I have tried to shrink the db with ERM, and I have tried from command line with dbcc shrinkdatabase and dbcc shrinkfile with no success.  ...
Score Clustered INdex on identity field
Pradeep Kutty - 2 Sep 2005 5:29 PM - 1 message
Hi All, I have heard that if you create a clustered index on a identity field and its a PK, it reduces the page splits... But how? Thanks, Prad ...
Score [Vent] SQL Server Upgrade
Mike Labosh - 2 Sep 2005 5:24 PM - 13 messages
It just occurred to the suits recently that the 240 GB is not enough, so what did they do? Change the RAID configuration?!?  NO! Get more drives for the RAID 10 stack?!?  NO! They bought a SATA drive and wired it to the SQL Server with a USB ...
Score Retrieving ntext column value skips values.
Snake - 2 Sep 2005 5:19 PM - 3 messages
I have the unfortunate task of dealing with an ntext column. I have to update part of the contents but first I was just trying to display the contents in Query Analyzer  using a script from page 61-62 of the Guru's transact sql ...
Score Question about Views in a Multi-User System
Mark Moss - 2 Sep 2005 4:58 PM - 7 messages
Sirs / Madams         I am new to MSSQL and was wondering about data conflicts with Views in a Multi-User System.  By that I mean if I have five users execute the same report against a database at the same time but with different criteria ...
Score Query for most recent of duplicate records
Jeff - 2 Sep 2005 4:32 PM - 7 messages
I need some ideas on this query.    I have a table with entries similar to the following with columns name, id, and timestamp. kmyoung    345    2005-08-22 07:29:00.000 ...
Score SQL Profile -- Trigger
Ed - 2 Sep 2005 4:18 PM - 7 messages
Hi,   Is there anyway I can capture the name of the trigger that is fired? I tried SQL:StmtCompleted and SQL:BatchCompleted but both did not show the name of trigger that was fired during the Insert/Update/Delete... ...
Score SQL Server error 1934
denix - 2 Sep 2005 4:01 PM - 3 messages
Hello all, I'm trying to write a very basic stored procedure that inserts a row into an indexed table with computed columns. I originally created it with this code : CREATE PROCEDURE insert_test AS SET ANSI_PADDING, ANSI_WARNINGS, CONCAT_NULL_YIELDS_NULL,  ARITHABORT, ...
Score GRMPH!!!!!!
Mike Labosh - 2 Sep 2005 3:36 PM - 7 messages
CREATE PROCEDURE dbo.msl_UpdateMSLJobTitle ( @description NVARCHAR(70), @jobTitleKey INT ) AS UPDATE msl_JobTitle   SET Description = @description WHERE JobTitleKey = @jobTitleKey GO Then I have some VB.NET code that runs it: Private Sub fixJobTitles()   Dim cnstr As String = ConfigurationSettings.AppSettings("connectionString") ...
Score Recovery Model What Database/table stores info
Lontae Jones - 2 Sep 2005 3:21 PM - 7 messages
What database/table stores information on the recovery models used for all database on an SQL server?  I want to change all to FUll.  Thanks ...
Score between
js - 2 Sep 2005 3:01 PM - 12 messages
hi, what diff: select * from mytable where intfieldname between 1 and 5 and select * from mytable where intfieldname between 5 and 1? Thanks. ...
Score getting a list of user created tables ONLY
kevin - 2 Sep 2005 2:48 PM - 4 messages
sql server 2k I am aware of SELECT * FROM INFORMATION_SCHEMA.TABLES ad sp_help, but in each case I also get a table called dtproperties and, in neither case, is there a logical way to tell one apart.  I am also adverse to using ...
Score Query Concept
Ed - 2 Sep 2005 2:27 PM - 6 messages
Hi,   I would like to use Northwind as an example. I am trying to use the Orders table and why the following query only returns one record for each customer if the outer query pass info into the inner ...
Score List of Tables and Primary Key Foreign Key Names
Alastair MacFarlane - 2 Sep 2005 2:21 PM - 4 messages
Dear All, I am trying to write some SQL that will give a list of all tables and Primary Key/ Foreign Key constraints in a database. The code below goes part of the way but not what I would like. It gives me: ...
Score Insert into another db on same server
dw - 2 Sep 2005 2:07 PM - 10 messages
Hi, all. What's the syntax for an insert from one database's table into another database's table on the same server? Here's what I've got and it keeps blowing up in SQL Query Analyzer, while connected to db1 which has ...
Score Query advice
siaj - 2 Sep 2005 1:44 PM - 5 messages
I need a suggestion. I have  a table with Columns (Rec_ID, Amt_Recieved, Amt_given, Rec_Status, Rec_Frequency , Rec_date) here Rec_ID and Rec_date are primary key I need a resultset out of this table  which has columns Rec_ID, Amt_Recieved, Amt_given  from the day previous to Rec_Date and Rec_Status, ...
Score case and order by problem?
WebBuilder451 - 2 Sep 2005 1:00 PM - 15 messages
Is there a problem with the case and order by when you attempt to order by a column that has been labeled? example (with assist from user MySqlServer, thanks you) CREATE TABLE tenbeat (   tenbeatcol1 int,   tenbeatcol2 int ) INSERT INTO tenbeat VALUES(3,4) ...
Score stupid coworker designed database with no identity keys.. :-(
Tony - 2 Sep 2005 12:50 PM - 4 messages
Discuss amoung yourselves; meanwhile I'm heading for the beach! Have a nice weekend folks! ...
Score table locking
Rippo - 2 Sep 2005 12:48 PM - 7 messages
Hi I have a table with an identity where I need to insert a set amount of rows. However I need to inser a full block with no gaps in the id's. If this sql was run by 2 people simulataneously then I could not get ...
Score wher statement to find a speciffic digit number
Hans [DiaGraphIT] - 2 Sep 2005 12:20 PM - 9 messages
Hi! I wounder how i can find a speciffic digit numberin a nvarchar string in my table. Case: I have a costumer table. In there I have a column for IdentityNumber (nvarchar 255)  - storing a 11 digit number. I want to make a select statement based on this column where the digit ...
Score Which one is faster?
Ion Popescu - 2 Sep 2005 11:55 AM - 8 messages
Which one is faster (regarding compilation time and execution time): SELECT @var1=(some expression), @var2=(other expression), [...] @var6=(last expression) or: SET @var1=(some expression) SET @var2=(other expression) [...] SET @var6=(last expression) All expressions are arithmetical expressions based on other variables ...
Score Remote insert performance
karuzo - 2 Sep 2005 11:22 AM - 2 messages
It seems that remote insert takes much more time than "local" insert. My table MyServer.MyDb.dbo.MyTable has hudreds of milions of rows and hudreds of GB. It has 3 indexes: clustered (not unique), nonclustered unique and nonclustered (not unique). ...
Score BCP exporting data, what's this ÿ character?
Scott A. Keen - 2 Sep 2005 10:17 AM - 4 messages
I'm using BCP to export data. When I look at the data with Notepad, some empty fields have this "ÿ" character, but this character does not appear in the database table. This is apparently causing problems with the company we're exchange data ...
Score Newbie Table Design Question
Alastair MacFarlane - 2 Sep 2005 10:03 AM - 3 messages
Dear All, I am looking over the design of another person's Database and I find that nearly all tables have Primary Keys and also a column called: rowguid - uniqueidentifier - with a (newid()) default value Why would the designer need a primary key and a GUID in every table. I am ...
Score select stored proc
soc - 2 Sep 2005 9:59 AM - 6 messages
Does it make sense to have a stored proc which selects from one of a number of tables depending on a variable, as below. Or should I have a stored proc for each table. Thanks Soc. CREATE PROCEDURE [user].[usp_tables] ...
Score Data access advise
John S - 2 Sep 2005 7:40 AM - 2 messages
Hi vs2005/sql server2005. I have created a simple winform app by dragging a table on a winform. I have used stored procedures for data access. I have the following questions; 1. Using the default code generated by vs2005 for data access, how can I ...
Score Recursive Problem
bali - 2 Sep 2005 7:30 AM - 1 message
Hi, I have a table say table1 whose structure would be Value1, Value2. Lets assume i have the following values in the Table1. Value1 Value2 1      2 2      3 3      4 ...
Score Behavior of OPTION
parasada - 2 Sep 2005 6:39 AM - 3 messages
we have migrated code from SQL7 to SQL2K and in some stored procs OPTION clause used as : OPTION (KEEPFIXED PLAN, FORCE ORDER) now there is a complaint that these procs are running quite slow. while trying to figure out the problem for the sluggishness ...
Score Adding New Measure to OLAP Cube
wilsonjust - 2 Sep 2005 5:48 AM - 2 messages
To add a record count measure to the olap cube. Create the cube as usual then run the following VB code with command line parameters Step1: Build your cube as usual Step2: Convert the blow vb code to exe prog ...
Score Adding New Measure to OLAP Cube
wilsonjust - 2 Sep 2005 5:48 AM - 1 message
To add a record count measure to the olap cube. Create the cube as usual then run the following VB code with command line parameters Step1: Build your cube as usual Step2: Convert the blow vb code to exe prog ...
Score Somewhat complicated GROUP behavior that has me stumped
Stefan Wrobel - 2 Sep 2005 4:16 AM - 6 messages
I'm trying to group results in a database in a way that I've never done before and it's got me stumped.  Let me first say that I cannot redesign this database at all, it is an off-the-shelf product that my company has ...
Score output parameters return NULL following a single NULL value
m9u35g - 2 Sep 2005 3:09 AM - 5 messages
I am encountering weird behavior, and I wonder if it is well-known, if it is a bug, or if it has a purpose of some sort. In a stored procedure with output parameters, if a NULL value is returned for an output parameter, all output parameters AFTER that ...
Score Divide by number of days in the year.
scuba79 - 2 Sep 2005 1:05 AM - 5 messages
How can I create a function that will divide a parameter passed into the stored procedure by the number of days in the current year?  I know that I can not just use 365 since it will not take into account leap years. ...
Score number of years,months and days in between two dates
Rajesh - 1 Sep 2005 11:20 PM - 4 messages
Num of Months in between Date1   '07-05-2005'    and Date2   '07-01-2006'   is 11 months 26 days. SELECT DATEDIFF(mm,'07-05-2005','07-01-2006') it gives me 12 months. which ...
Score Bulk insert Error
vineetbatta - 1 Sep 2005 10:58 PM - 2 messages
i am firing the following from QA bulk insert pubs.dbo.Orders from '\\<ServerName>\test\Orders.txt'      with (DATAFILETYPE  = 'native') This <ServerName> is not the servername of the SQL Box, but the remote box ...
Score GROUP BY and populating temp table, ideas?
Ada - 1 Sep 2005 10:33 PM - 2 messages
Hello All, I have the following table, and want to create a report as seen below. CREATE TABLE [dbo].[Sales] (     [ACTIVITY_ID] [varchar] (16) NOT NULL ,     [CREATED_BY] [varchar] (10)    NULL,     [YEAR] [varchar] (9)          NULL , ...
Score TSQL date help
smk23 - 1 Sep 2005 10:31 PM - 3 messages
In TSQL how would I set my WHERE clause to pull records with ApptDate in the past 3 months i.e. > (today-90 days) ? TIA ...
Score sort by calculated value
WebBuilder451 - 1 Sep 2005 9:49 PM - 6 messages
i have this line in my query: case When (h2.stkhst10wk - h2.stkhstClose) >= 0 then 'Below' else 'Above' end as tenBeat i need to sort by this value. of course order by tenBeat will not work, and tried   order by ((h2.stkhst10wk - h2.stkhstClose) >= 0) ...
Score Loop through table using column id instead of name
Ken Holzer - 1 Sep 2005 9:47 PM - 2 messages
I need to generate a comma delimited file that is a copy of a row in a table. I would like to be able to use the column id instead of the column name to do this. i would like to be able to pass a table name to the stored procedure ...
Score Preventing the loading of duplicate data to a table – Best Option
SJM - 1 Sep 2005 9:29 PM - 4 messages
Hello. I have a situation where the potential exists for duplicate data to be loaded to a table and I need to prevent this from occurring. The process starts with a file being created on a mainframe system and downloaded to SQL Server. If everything was going correctly, the data ...
Score Converting datatype on column...
Eric - 1 Sep 2005 9:26 PM - 2 messages
What impact will changing the datatype of a column from smalldatetime to datetime?  Currently, I need to allow for record insertion where the date may exeed year 2079. ...
Score finding foreign key info
Ned - 1 Sep 2005 9:21 PM - 3 messages
Hi, Is there a way to find out if a column on a table is a foreign key, what table it references and what column on that table it is referencing.  All of my foreign keys are a single column, which should make things easier. ...
Score find unique
rodchar - 1 Sep 2005 9:02 PM - 4 messages
hey all, i have a table which i would like to determine what fields make each record unique? Unfortunately there is not a tableid. thanks, rodchar ...
Score [OT] For your amusement
Mike Labosh - 1 Sep 2005 8:45 PM - 1 message
'Twas the night before go-live and all through the shop No one was sleeping, not even the boss The data files were stored on the hard drive with care In hopes that the Sample Loader soon would be there ...
Score How can I do this without a cursor??
Mike - 1 Sep 2005 8:43 PM - 5 messages
I have a slow-running stored procedure that imports several million rows of data from a staging table into a data warehouse table. The slowness, I know, is because the SP uses a cursor to process these n million rows, and the reason for the cursor is simply because I can't ...
Score How to abort stored procedure on error (@@ERROR > 0)
Radovan Biciste - 1 Sep 2005 8:24 PM - 2 messages
Hello, I'm still learning SQL Server. Right now I'm trying to find generic way to handle exception. I would like to have a stored procedure that would check @@ERROR and abort execution of parent procedure and raise the ...
Score Trouble with SP
Greg - 1 Sep 2005 7:44 PM - 12 messages
I'm trying to write the following stored proc.  The key is that I have a field that I'm creating that will be returned in the resultset for binding to a report.  This field, DueDate, has conditional logic to determine its ...
Score evaluate an expression into a variable
Jon LaRosa - 1 Sep 2005 7:17 PM - 3 messages
Hi all, In a stored procedure I am trying to do this: SET @Barr = (@Foo is NULL) so I don't have to use this inelegant and less efficient code: IF @Foo is NULL     SET @Barr = 1 ...
Score What does "Build an Index" mean?
Siegfried Heintze - 1 Sep 2005 7:01 PM - 5 messages
I was in a job interview recently where they asked me if I had ever "built an index". What does this mean? Thanks, Siegfried ...
Score Delete 1 month old records
Test Test - 1 Sep 2005 6:40 PM - 6 messages
I need to set up a job which will run the last day of every month to keep the data in the table for the current month only and delete everyhthing else (older than 1 month records would be deleted). see the ...
Score Adding Sequence number in SQL
kimmal - 1 Sep 2005 6:26 PM - 2 messages
Being a newbie to SQL programming, was hoping someone would be able to guide me in the right direction. I have a table that has the following data Center    Emp_ID 11    112 11    2254 ...
Score Petterns for SQL Tables and Stored Procedures
bobbyballgame - 1 Sep 2005 6:16 PM - 3 messages
I am looking for some patterns in SQL Server. The Patterns and Paractices did not seem to have what I am looking for, but it would seem to me that it is a very commmon scenario that must have been covered. ...
Score Decimal Digits Lost When Using Decimal(9,2) Parameter
joey.powell - 1 Sep 2005 6:08 PM - 4 messages
Hello, I am trying to use a decimal type parameter in my stored procedure. When I pass any decimal value to it (for example: 12.34), the decimal part is always truncated off. I am left with only 12 as the value that ...
Score Storing files in SQL Server
Dave - 1 Sep 2005 5:14 PM - 3 messages
I need to store large xml files in my database.  I was going to use the text datatype. Can someone point to some good how-to's on creating the SP as well as the ADO.NET code?  ...
Score sysobjects.xtype, sysdepends.depid and Views
Saffron - 1 Sep 2005 4:00 PM - 4 messages
I'm writing stored procedures to document tables. I want to be able to list all the views that reference a table. sp_help appears to provide this information but doesn't produce any results even for tables I know to be referenced. The sp_help code looks ...
Score The deptype column in sysdepends
Saffron - 1 Sep 2005 3:49 PM - 2 messages
Could someone please provide me with an explanation of the different deptype values for the sysdepends table. The column isn't listed in the MSDN Transact-SQL Reference for SQL Server 2000 and a search hasn't provided me with the answer either. ...
Score best way to determine if a table exists?
Les Stockton - 1 Sep 2005 3:29 PM - 10 messages
What's the best way to test for the existence of a table programmatically? ...
Score xp_cmdshell
marcmc - 1 Sep 2005 3:02 PM - 3 messages
I need to run xp_cmdshell from a SQLServer Job on Server1 that executes a batch file on Server2. Firstly can it be done? If so, any guides/ideas how? I was thinking of using xCmd or psExec. This is really urgent if you guys would like a real test, I know it has and ...
Score dont show select results
Carlo - 1 Sep 2005 2:45 PM - 7 messages
hi is it possible in a query dont show the result rows?? i wanna write select * from table set @num=@@rowcount and i dont wanna see all the rows affected thanks Carlo ...
Score Make view or stored procedure to Append many fields to single field view from 1 to many table
Kevin R - 1 Sep 2005 2:34 PM - 3 messages
Is it possible to do the following in SQL?  I have a '1- many' table link with the 'many' table containing authors.  I need to come up with a view (stored procedure?) that will combine any number of authors into a single ...
Score Trouble with hierarchy design
tonicvodka - 1 Sep 2005 2:06 PM - 4 messages
Hi all! I have the following tables; Advertiser, Home, SubletWeek and Customer. An advertiser can have one or many homes, a home can have one or many subletweeks, a subletweek must have a customer. An advertiser can also have one or many customers, a customer can have ...
Score Backup requirements
hals_left - 1 Sep 2005 1:40 PM - 5 messages
Hi, This is confusing me - is there some reason why I "need" 3rd party backup software to backup a single SQL Server 2000 database? I do a full backup of a small (< 1Gb ) db each night to a hard disk on ...
Score Is it possible to connect a SQL server database to any NNTP server?
J.S. - 1 Sep 2005 1:26 PM - 5 messages
I'd like to use a SQL server database as a backend for an NNTP server. Ideally, it would be the NNTP server that coems with Windows Server 2003 but that is not essential. Is it possible to do this?  What kind of application do I need to connect ...
Score how to rename a temp table
Sam - 1 Sep 2005 12:56 PM - 13 messages
EXEC sp_rename '#customers', '#custs' result with error :Invalid object name '#customers'. how to rename a temp table? ...
Score view in multi-users enviorment
Sam - 1 Sep 2005 12:44 PM - 4 messages
as a new imigrant from ms access to sql i have 1 basic question: in multi-users enviorment when user1 use: alter view AgeView select * from tbl where age=30 and on the very same time user2 use: alter view AgeView ...
Score Temporary table to a file
Chandra - 1 Sep 2005 12:39 PM - 7 messages
what is wrong with the following statements?? set @str = 'bcp mydb..#temp out OutPutfile /c /Sservername /Usa /Ppassword' exec master..xp_cmdshell @str ...
Score SQLDataAdapter.FillSchema() hangs with select on view
Ralph Schwitalla - 1 Sep 2005 12:07 PM - 7 messages
Hi Everybody, we have got the following Problem in our Production Database. We have a rather complex view A which is relying on (a rather complex) view B. The view A Schema is queried through ADO.Net with a SqlDataAdapter.FillSchema() with a select statement like: "Select * from ...
Score Deleting Duplicate Data
Ghulam Farid - 1 Sep 2005 11:22 AM - 3 messages
Hi to All! I have a table with 60 columns and more than one million rows. i have to implement composite primary key but it gives me error of duplicate data. i have used following query to detect the duplicate rows ...
Score How to simulate an array in SQL Server
mal_k100 - 1 Sep 2005 11:22 AM - 2 messages
Just thought some might be interested in how to identify individual items in an 'array' by declaring a local variable as table -------------------------------------------------------------------- declare @MyTable table (MyRowID int identity, MyData varchar(255)) declare @MyCurrentRow as int declare @MyRowCount as int insert into @MyTable select Name from sysobjects -- (or whatever) ...
Score MSDTC - standard?
len - 1 Sep 2005 11:01 AM - 2 messages
Hi there. The distributed transaction coordinator that comes with SQL Server (MSDTC).... is this based on some sort of standard? Are there other implementations of DTCs? Any info would be appreciated! Len ...
Score Simplifying CHECK constraint
Igor Solodovnikov - 1 Sep 2005 10:55 AM - 14 messages
I have table with following DDL: CREATE TABLE [dbo].[DiscTable] (     [id] [int] IDENTITY (1, 1) NOT NULL ,     [PeriodStart] [datetime] NULL ,     [PeriodStop] [datetime] NULL , ) ON [PRIMARY] Our business rules require PeriodStart and PeriodStop fields must have  ...
Score HTTP POST using MSXML2.ServerXMLHttp.3.0 in stored procedure
Mark Wiewel - 1 Sep 2005 10:53 AM - 1 message
Hi, I am trying to launch a HTTP-POST-request (not GET) from inside a stored procedure using MSXML2.ServerXMLHttp.3.0. The URL ist called without any problems, except the POST data isn't transmitted. I am not quite sure what the correct T-SQL syntax is, but I don't ...
Score compare two string in SQL Server
Martin - 1 Sep 2005 10:19 AM - 6 messages
Hi, I am writing a Store Procedure for Login, as following: @p_sUsername, @p_sPassword are parameters .... SELECT @BName = B.username, @BPW =  Password FROM BENUTZER as B WHERE username = @p_sUsername AND Passwort = @p_sPassword .... but the SELECT Statement can not differ Uppercase and Lowercase, that means, ...
Score Select statement selects range of records?
Mike - 1 Sep 2005 10:02 AM - 2 messages
Is there a statement that will allow me to select a range of records in the middle of a selection of records? e.g. Rather than TOP 10, can I get like records 10-20, or 50-65 etc? ...
Score Table data to a file
Chandra - 1 Sep 2005 9:03 AM - 5 messages
How to send the table data into a flat file (*.txt or *.sql)? I tried with BCP but unable to locate the file..where it will be created?? ...
Score where clause performance
benamis - 1 Sep 2005 8:32 AM - 4 messages
hi there is it true that it is more effective (on a large tables with index on a column) to make Q like this ..... where a>1 and a<3 than ...... where a=2 ...
Score Cursors
Chandra - 1 Sep 2005 6:51 AM - 5 messages
I wrote the following statements.. set @sqlstring = 'select * from employee' declare cursTemp Cursor for @sqlstring .... in sql server it is giving error.. what is wrong with this? How can I use string variable for declaring cursors? Thanks Chandra ...
Score SP plan different from batch
Buddy Ackerman - 1 Sep 2005 6:26 AM - 10 messages
I've got a SP that chooses to not use an index that I created for the express purpose of the query in the SP.  However, when I run the commands from the SP as a batch they use the index as designed and the batch runs in less than a second ...
Score Row data to column
Mit via SQLMonster.com - 1 Sep 2005 2:42 AM - 2 messages
I have a table like this User          Group U1              G1 U1              G2 ...
Score Optional Where?
Adam - 1 Sep 2005 12:56 AM - 5 messages
Hi all, I am trying to create an optional where clause in a store procedure. My attempt below is incorrect. What is the best way of acheiving what i want? Some corrected code would be great!!!! CREATE PROCEDURE [dbo].[get_accounts] ...
q
Next »