Home All Groups Group Topic Archive Search About

SQL Server database programming

microsoft.public.sqlserver.programming
Score SQL Server 2000 - 64bit version - extended procedures
ps - 2 Sep 2006 10:35 PM - 3 messages
We have made a couple of extended procedure on SQL 2000 32 bit version. Now the database is decided to reside on SQL 2000 64 bit version. Since extended procedures will not work, can anyone give me any links or help how to ...
Score concatenate column from rows
Dahab - 2 Sep 2006 10:18 PM - 6 messages
Hi, Can anyone help me with this query. I have a table GassBottleSize with colums Gas, Bottlesize, id and values ID      Gas                     BottleSize ...
Score Need stored proc. Add record to Tbl2 if it exists in Tbl1 and not
Sandy - 2 Sep 2006 8:57 PM - 3 messages
Hello - I have two tables.  Tbl1 gets updated automatically.  I would like to update Tbl2 if a record exists in Tbl1 that is not in Tbl2 and delete a record from Tbl2 if it is not in Tbl1.  I am only concerned with one field - ...
Score Scheduled VS Made
Paul Ilacqua - 2 Sep 2006 8:35 PM - 8 messages
I am looking for the best method the extract "Supposed to make" - "Did Make", where "Supposed to make" and "Did Make" come from different queries.        I need to show when parts are scheduled and not made, and when parts ...
Score select last row for each value
realgeek - 2 Sep 2006 5:55 PM - 3 messages
Hi. Say I have a table with 3 fields, Date, Price and Code. There are many different priceswith different dates  for each code. I need a join condition that will add latest prices for each code into some big query ...
Score Processing rows in a trigger
Leila - 2 Sep 2006 5:38 PM - 7 messages
Hi, Users perform updates on the table and they can affect more than one row in single DML statement. What if I want to perform something on each record in Inserted table? Should I necessarily declare a cursor? Thanks in advance, ...
Score Smalldatetime problem during INSERT to DB
haldunn - 2 Sep 2006 1:55 PM - 2 messages
Hi all from Turkey. i'm using VB.NET and SQL Server 2005. I have an editbox(mask : dd/mm/yyyy). And i want to insert it to table. My table's column is smalldatetime. when i'm insert it, DB Column's value is being 01/01/1900 00:00:00. But i want for ...
Score Some records in a column imported as null
itsyash - 2 Sep 2006 11:58 AM - 2 messages
Hi, I am trying to use the import export wizard to transfer data from Excel to SQL Server 2000. The challenge: I have a column which has numbers that are manually entered. Some numbers have "/" between them. There are also a few email addresses in ...
Score Get the script for an object using T-SQL (without using SQL-DMO)
arch - 2 Sep 2006 7:29 AM - 9 messages
Is there any way to get the script (ddl) for an object (say a table) without using SQL-DMO.  I actually want to use only T-SQL to get the script for an object.  For example, I may want to write a query that returns a list of ...
Score Divide By Zero - How to Prevent with the following statement
Mark Moss - 2 Sep 2006 7:04 AM - 6 messages
Ladies / Gentlemen         Would one of you take a stab a converting the following statement so that I do not have to worry about difide by zero errors.             Z4.ProfitPercent    = ( ( ( Z4.CurrentPrice / Z4.CurrentSplit ) ...
Score Data Modeling: Variable Number of Attributes
Richard S. - 2 Sep 2006 5:19 AM - 5 messages
This post presents a relatively straight-forward problem and a proposed solution. I'd appreciate your perspective and suggestions: I'm working on the design of a new database for a medical clinic which must track, amongst other things, EVENTS + EVENT_DETAILS for patients. The ...
Score CASE in WHERE clause
PsychoCoder - 1 Sep 2006 11:44 PM - 4 messages
OK this is driving me absolutely crazy, whats wrong with this code: select           <somestuff> from            <sometable> where ...
Score Job and Exe
CLM - 1 Sep 2006 9:25 PM - 3 messages
Let's say you have a Sql Server Agent job (on 2000) that runs an executable, i.e. a .exe and is failing because it does not have permission to the folder. Here are my questions: 1.  What permissions does Sql Server Agent run under, the permissions of the ...
Score Determine Index Usage...
Brett Davis - 1 Sep 2006 8:37 PM - 4 messages
Hello... I am looking for a way in SQL Server 2000 to determine which indexes are used and which indexes are NOT used.  I have several databases that have gone through several iterations and is in need of index cleaning. ...
Score Query Help
Walter - 1 Sep 2006 7:35 PM - 2 messages
Hello All, Is there anyway to count order for each month being active? Example: OrderID : 10 OrderDate : 02/01/2006 OrderStatus: Active Order is been active till July 2006 OrderID : 10 OrderDate : 07/01/2006 OrderStatus: Closed Here is the result I'm trying to get: ...
Score advanced proximity search
thomasvmatthew - 1 Sep 2006 7:27 PM - 1 message
hi guys, wanted to know if anyone has figured out a way to perform customized proximity searches in SQL Server (i.e., find a word only if it's within 10/20/n words of another specified word).  The NEAR ...
Score Fixed Formatted File
wnfisba - 1 Sep 2006 7:11 PM - 3 messages
I have to create a fixed formatted file out of our SQL Server Databas eas an extract file that will be used to load a third party application. Do I have to re-cast each selected field so that it becomes fixed formatted??? ...
Score IF Statement - Whats Next
Stephen Lynch - 1 Sep 2006 7:06 PM - 5 messages
Can I use an If statement on a StProc?  I am erroring around the IF. USE DataInput GO CREATE PROC a_spAppendtoManualContribution @CompanyId int IF (SELECT COUNT(*) AS 'Number of Rows' FROM ManualContribution WHERE CompanyId = @Company)>0 /* Insert Records into the Manual Contribution Table */ ...
Score Grouping sysjobhistory
stavros - 1 Sep 2006 7:04 PM - 4 messages
I'm trying to report on the runtimes of a couple new jobs through several iterations, testing various code and data changes in each iteration.  The sysjobs and sysjobhistory tables have all the info I need for this, except I'd like to add a column showing the run ...
Score SQL server returns error in query analyzer
News - 1 Sep 2006 6:58 PM - 2 messages
I run SQL Server 2000 on shared server. When I work from my office location then everyting is ok, every query completes fine. Today, I stayed home, opened query analyzer and types simple query select * from Mytable where myid = 5034 ...
Score slow Table function fixed by resaving
bruestle - 1 Sep 2006 5:49 PM - 3 messages
I have a SQL Server 2005 table-function that normally runs in about .3 seconds.  About every two weeks it starts taking about 48 seconds.  To fix it all I have to do is to resave the procedure (i.e. in Server Management ...
Score command REPLICATE in sqlexpress2005
jmeykos - 1 Sep 2006 5:20 PM - 2 messages
I need to know if a can use the command REPLICATE in my aplication if I have installed sqlexpress2005 ...
Score install sqlexpress 2005 with specific collate
jmeykos - 1 Sep 2006 5:16 PM - 4 messages
I want to install sqlexpress 2005 with collate SQL_Latin1_General_CP1_CI_AS because my database have it an when I use tempdb ...
Score Marking (Not just Finding) Duplicate Values ......
sloan - 1 Sep 2006 5:03 PM - 7 messages
Below is a sample of what I'm trying to do. Let's say I have table (fakeRealTable  in my sample below) It has duplicate rows, the data is the same EXCEPT for the primary key (entryid in my sample) ...
Score SQL update from itself
Peter - 1 Sep 2006 4:49 PM - 4 messages
Hi folks,   update sql code!  (The company pays once per type for employee) before    employee    spendingType  amount     company_paid                 peter             subway           2                null  ...
Score (repost) How is the design for this complex requirement ?
krislioe - 1 Sep 2006 4:41 PM - 2 messages
Hi All, I have Customer hierarchy as follow :   CustomerCategory   CustomerType   CustomerGroup   Customer Discount can be given to a CustomerCategory, or CustomerType, or a CustomerGroup, or a Customer , or to ALL Customer. Discount is defined in a Promotion Table ...
Score Help: RAISERROR, RETURN value and application level database interface question.
Farmer - 1 Sep 2006 4:22 PM - 6 messages
Hi guys, Thank you for your time and help. Here is a problem that I am facing. Consider the SQL code below. It's a simple procedure, raises an error, goes to catch block, that error gets re-raised, and I return -100 as return code. When I call this sp via SQL, I can caprure that return code and print it. All is very cool. ...
Score Select part of a string
Dan Shepherd - 1 Sep 2006 4:12 PM - 14 messages
I have a column in a table that has multiple pieces of information in it that I need to break out into various columns.  The column is random but the values I need to separate out are the number and the UN number as below: ...
Score Order details table reference live data
Johan Sjöström - 1 Sep 2006 3:52 PM - 3 messages
This is a real pickle. My company's web application offers a lot of ways to order products, so there are quite a few Order/OrderDetail tables in the db (one for every type of order). SQL Server 2000 is used ...
Score Restore problem using SMO and SqlRestore
SPS Developer - 1 Sep 2006 3:51 PM - 3 messages
I'm trying to backup and restore a database using SMO and the code completes with no errors, but the database on the SQL Server remains in the DBName (Restoring...) state and never seems to finish. All the files appear ...
Score UPDATE in a SQL script file is not working.
Adam Porter - 1 Sep 2006 3:31 PM - 15 messages
I've got an upgrade.bat file that calls osql to run an upgrade.sql file. In this file, I create a couple of stored procedures, alter a couple stored procedures, add permissions to those procedures, and also include an UPDATE ...
Score Problem with WHERE clause
David - 1 Sep 2006 3:18 PM - 15 messages
I have a record on a table/view that has activity_start_date of 8/10/2006 and I cannot get it to display in my SQL.  Can someone help, I cannot find the problem.  I have tried both BETWEEN and >=/<= and neither one works. ...
Score Re: If Else Statement
Immy - 1 Sep 2006 3:16 PM - 1 message
Excuse the typo. IF NOT EXISTS (SELECT COUNT(*) AS 'Number of Rows' FROM ManualContribution>0) Insert Records into table ...
Score If Else Statement
Stephen Lynch - 1 Sep 2006 2:59 PM - 8 messages
ALL; How do I DO Nothing if my IF statement is false? For example: IF (SELECT COUNT(*) AS 'Number of Rows' FROM ManualContribution>0 DO NOTHING Else Insert Records into table Thanks Steve ...
Score query mistake
robken - 1 Sep 2006 2:28 PM - 2 messages
Hi all, I wrote the following query however when I run it I am getting a domain error message(possible something to do with the logs.)  Can anyone spot a mistake.  Note that the values that are being "logged" are all ...
Score slow query
JFB - 1 Sep 2006 2:18 PM - 3 messages
Let me try again.... SELECT p.*, o.pName, u.name FROM dbo.PrintersJobs p inner Join Orders o on p.orderid = o.orderid left outer join users u on p.dataperson = u.userid ORDER BY p.TimeEntered DESC, p.jobid desc ...
Score Installing stored procedures and functions
William Sullivan - 1 Sep 2006 2:13 PM - 3 messages
I can't find much information on creating an install package to add stored procs and functions to a sql server.  Of particular interest is encrypting them at installation time.  Any pointers are welcome.  Thanks. ...
Score Data Merging
neeju - 1 Sep 2006 1:27 PM - 5 messages
Hi All, Our client has acquired another company which is in same business. Now they are planning to merge the data from new comapny's DB's  to existing databases. Problem is the difference between the schema of both the databases. ...
Score Get the latest date for each ID
Brandon H. Campbell - 1 Sep 2006 12:55 PM - 4 messages
Hello, I'm using SQL 2000. I have a table with an ID and dates plus other fields. I was trying to get the latest date for each ID. I tried a simple grouping asking for the MAX(Date) and I still get all the dates. I tried writing a ...
Score Are there any online instructors in sql server?
HONOREDANCESTOR - 1 Sep 2006 12:35 PM - 4 messages
I'm reading a book that Microsoft puts out which prepares people for a sql server exam (for certification).  The problem is, it raises many questions that it does not answer.  So I need an expert to explain ...
Score Adding references to CLR User defined functions
roadz - 1 Sep 2006 11:51 AM - 5 messages
I would like to create a CLR user defined function in Visual Studio 2005 to retrieve information from Active Directory for the logged in user. Unfortunately I am unable to add a reference to System.DirectoryServices because Visual Studio only allows me to add ...
Score [DBNETLIB][ConnectionOpen (SECDoClientHandshake()).]SSL Security error
Matteo - 1 Sep 2006 11:48 AM - 1 message
Hi everyonbody, i've a problem with connection between client (windows XP, SQL 2000 sp3) and server (Windows 2003, SQL 2005 express). message error: [DBNETLIB][ConnectionOpen (SECDoClientHandshake()).]SSL Security error Reading on the net it seems to be related to SSL certificates ...
Score instead of insert trigger
Robert Bravery - 1 Sep 2006 11:10 AM - 3 messages
Hi all, Can I have an insert statement in an instead of insert trigger, inserting into the same table as the insert trigger. Would this trigger be repeatidly run Thanks Robert ...
Score How to list all Procedures and Functions with sp_xxxx?
Andreas Klemt - 1 Sep 2006 11:09 AM - 4 messages
Hello, how can I easily list all Procedures or Functions with a sp_xxx? Is there also a fast way with sp_xxx to find Procedures? Thanks for any help in advance! Regards Andreas Klemt ...
Score Phantom Transaction
rocket salad - 1 Sep 2006 10:57 AM - 6 messages
Picture this setup: 2 SQL Servers, S1 and S2 are physically seperate. On S1 is sat a stored procedure SP1 and on S2 is sat another, SP2. SP2 attempts to insert into a temprary table from SP1 using the following ...
Score Round Function 2dp
Betty - 1 Sep 2006 9:15 AM - 5 messages
I have the following code to work fine... SELECT AWD.EmpName, IsNull(FirstMonth.Productivity,0) as FirstMonthProductivity Left Outer Join (         select EmpName,         CASE (IsNull(SUM(Time_Avail_Queries + AvailTime + AcdTime + AcwTime + ...
Score About query performance
Vycka - 1 Sep 2006 8:54 AM - 2 messages
Hi, Lets say I have two queries: Query A: Select * From Table1 t1, Table2 t2 Where t1.ID = t2.ID and t1.Field = '123' Query B: Select * From Table1 t1 Join Table2 t2 On t1.ID = t2.ID Where t1.Field = '123' ...
Score SET/SELECT truncate string
barton - 1 Sep 2006 8:18 AM - 8 messages
Hello, I am looking for at this newsgroup to find solution for: in stored procedure: i can concenate strings to one string: DECLARE @SQL NVARCHAR(4000) SET @SQL = 'INSERT INTO.....' + @SQL1 + '....' + @SQL2.... etc. the length of @SQL must have about 1000 characters, but it truncated to ...
Score IP address problem
radhikausain - 1 Sep 2006 7:57 AM - 3 messages
i need 2 write a query to fetch the IP address of a system where i am storing my data. can any one what that query would be immediately.plz . regards radhika ...
Score I found a tickets site
teun blsy - 1 Sep 2006 7:05 AM - 1 message
I found a tickets site [link] we can find and buy all tickets,fun! ...
Score Case expression
dwasserman - 1 Sep 2006 3:42 AM - 4 messages
I am wondering if it is possible to output another field in a database from within a case statement, i.e.: CASE When Exam_Requirements = 'Y' then Exam_Comments The goal would be for each return of a yes in exam requirements the ...
Score INNER JOIN With more than one join condition
xgopi - 1 Sep 2006 3:40 AM - 8 messages
Need help in understanding  a query which is as follows  which has 2 join conditions Select C1,C2 From T1 INNER JOIN T2 ON T2.C1=T1.C1 INNER JOIN T3 ON T3.C1=T2.C1 ON T3.C2=T1.C2 ...
Score Chunk of rows in without using FETCH NEXT.
Vilma - 1 Sep 2006 3:19 AM - 4 messages
Hi all. I am looking for a way to get small chunks of rows (pages) with another sort order than the primary key, in this case a date. I have got a table like this.I would prefer not to use cursors. ...
Score DERIVEDTBL question
ja - 1 Sep 2006 2:19 AM - 3 messages
Hi,all     Could anybody tell me what does ' DERIVEDTBL' mean & how & where to use? -ja ...
Score Same databases on two different servers...I get different execution plans on each database...why?
mchi55 - 1 Sep 2006 12:54 AM - 4 messages
I have the exact same database on two different servers...but when I run the same query against both of them...they have different execution plans. One of the queries returns in 1 second...where the other one returns in ...
Score SQL 2005 versus 2000 performance - things to watch out for?
Darrick - 1 Sep 2006 12:04 AM - 5 messages
I'm trying to determine why a process is failing, but one thing I noticed right away is that it takes 40 seconds in SQL 2005 and takes 11 in SQL 2000 (both standard version), client is VB 6.  I haven't looked through all the ...
Score INSERT based on a date range
Terri - 31 Aug 2006 11:21 PM - 8 messages
I want to INSERT records into #TEST so that there is a record for every date within my date range. The date range is all dates between and equal to @StartDate and @EndDate. The inserted records will be a duplicate of the ...
Score how to display unicode data
msnews.microsoft.com - 31 Aug 2006 11:11 PM - 2 messages
i have nvarchar(japanese code page) data field . how can i display the japanese characters in query analyser.? they shows as ?? thx ...
Score JOIN Confusion
Willie Bodger - 31 Aug 2006 10:27 PM - 4 messages
So, I have a query like this: SELECT DISTINCT PCM.iOwnerID, PCM.chProductNumber, count(PCM.iHierarchyID) AS Num FROM (SELECT *       FROM dbo.vOnyx_Products       WHERE (iHierarchyID IN (199))) PCM LEFT OUTER JOIN ...
Score TSQL TIme Series
Kayode Yusuf - 31 Aug 2006 10:20 PM - 5 messages
have a problem with time series. This is my problem : Scenario 1 – I have the output below which is made up intervals with  hourly repeating values StartDate                                  EndDate                           ...
Score Update the last Operation in a Job
Deb Struble - 31 Aug 2006 9:53 PM - 5 messages
I have a sql jobroute table that consists a variety of information which include the fields job number, operation number, and last code.  I need to be able to locate the last operation for each job and update the last code ...
Score SQLDMO - SQLServer.Databases.Item
Maer - 31 Aug 2006 9:48 PM - 1 message
Hi guys - I've been having a strange problem with one of our clients. I use sqldmo (in c#) for some administrative tasks. I am able to create an SQLServer object and connect just fine. However, there is a problem when it ...
Score Convert varchar to int problem
dev648237923 - 31 Aug 2006 9:28 PM - 6 messages
I have a table with two varchar fields (a and b) like this: a, b ----- 1, 10 1, 20 2, some_text 2, some_more_text I want to sum up all the type answers where a='1' (so from the above it ...
Score Copying table & data (2000 - 2005)
modhak - 31 Aug 2006 9:15 PM - 2 messages
Hi All I have a table in SQL Server 2000. I want to copy the data to my SQL Server 2005. Is there anyway I can do it. This table in 2000 SQL server has foriegn key constraints. I do not ...
Score Apostrophe in UPDATE SET Query
Pancho - 31 Aug 2006 8:53 PM - 4 messages
Hello, I am doing some data corrections and tried to run this: UPDATE tablename SET Provider = 'Burkers' WHERE Provider = 'Burker's' Got this error message: Server: Msg 170, Level 15, State 1, Line 3 Line 3: Incorrect syntax near 's'. ...
Score Creating database via SMO
Wernfried Schwenkner - 31 Aug 2006 8:20 PM - 4 messages
I found some hints, how to create a database using SMO The following: Server server = new Server("localhost"); Database database = new Database(server, "TESTDATABASE"); FileGroup fileGroup = new FileGroup(database, "PRIMARY"); DataFile dataFile = new DataFile(fileGroup, "TESTDTABASE_DATA", "c: \\TESTDATABASE_DATA.mdf"); dataFile.GrowthType = FileGrowthType.Percent; ...
Score Help with formatting float data types
Frank Smith - 31 Aug 2006 7:49 PM - 5 messages
I need some help with formatting a float data type to be displayed a certain way. First allow me to list the fields involved, their data types, a sample value and the end result I desire. I'm trying to simulate an expression used ...
Score Update sql table
ntuyen01 - 31 Aug 2006 6:33 PM - 3 messages
Hi All, Please help. Example : I have a table "ABC"    --- -- Only one row for the ID ID = 5, ColX, ColY ID = 6 ColX, ColY I have another table 'XYZ              --- Many row for the same ID ...
Score Setting database to single user mode allows connections from outsi
Pedja - 31 Aug 2006 6:21 PM - 5 messages
HI All, I'm trying to use the following script as a job which should be running each first day of the month, at midnight, to repartition the database. This script suppose to disconnect all database users currently connected to the database, ...
Score Performance difference in 2 coding examples
Stephanie - 31 Aug 2006 6:18 PM - 4 messages
Is there any difference in these 2 ways of coding?  Does it matter if the qualifier is in the WHERE clause a opposed to being in an "AND" statement in the JOIN? Sample A SELECT A.Col1, B.Col2 ...
Score parse out set of numbers from a column
gv - 31 Aug 2006 6:16 PM - 13 messages
Hi all, I have the following text in a Varchar(200) column in a table and want to parse out just the first set of numbers: Example data Col1 Order the 90311 - Prov Order Notify User of Ack 8894 Order 30511 was assigned. 1 tsirry 2000-2-5 00:00: 2003-12-29 1:56:23.827 ...
Score SQL Server Offline Event
John Wright - 31 Aug 2006 5:39 PM - 2 messages
Is there an event I can watch that SQL Server Fires when it goes off line? I need to watch for an event to monitor SQL Server status, and when it is not online, switch to a backup server.  I am using .NET (C# or VB) to do ...
Score scripting constraints
samuelberthelot - 31 Aug 2006 5:12 PM - 5 messages
Hello, In SQL Server, in the diagram, I can setup constraints between tables. I can tick the following boxes in the properties of the constraint: -check existing data on creation -enforce relationship for replication -enforce relationship for INSERTs and UPDATEs ...
Score looping in stored procedure
laurie - 31 Aug 2006 5:10 PM - 5 messages
Hi, I have two tables (county(countyID, countyName) and results(resultsID, countyID, resultDate, fileName, rptYearQuarter).  Each county can have zero or more records in the results table.  I need to be able to get the most recent fileName for each county for a specific rptYearQuarter. ...
Score Read Only Column
Samuel Shulman - 31 Aug 2006 4:50 PM - 5 messages
I found 1 column which is Read-Only and it is not identity field How can I change it to not Read Only using the SQL Server 2005 Management application Thank you, Samuel ...
Score synchronize tables
soc - 31 Aug 2006 4:41 PM - 4 messages
I have 2 identical databases, db1 which is edited with updates and inserts and db2 which is read-only. Each table has an identifier column and a date-time-edited column. Can anyone provide the basis of an sql script which would edit a table in ...
Score Rollback trigger
jenks - 31 Aug 2006 4:25 PM - 5 messages
I am trying to create a trigger that rolls back updates to a specific columns in a table under certain conditions. The area I am having trouble with is only rolling back updates to these columns and allowing updates to other ...
Score SQL Exception with Bitwise AND ...
Brent D. - 31 Aug 2006 4:25 PM - 3 messages
I believe there is a bug in the SQL 2000 parser that causes the following SQL exception: System.Data.SqlClient.SqlException: Invalid operator for data type. Operator equals boolean AND, type equals numeric. Invalid operator for data type. Operator equals boolean AND, type equals ...
Score Need help with approach for query - extensible meta data table
Cy Huckaba - 31 Aug 2006 3:57 PM - 3 messages
I have a database structure that was built to be flexible and store extended properties on items without having to change the database when a new extended property added by a data import process. These extended props were not originally meant for direct querying and now we do want to start query for ...
Score SQL Server and XML
Mark Ebling - 31 Aug 2006 3:54 PM - 3 messages
Sorry, I've been stuck in a SQL Server 2000 and vb6.asp world and a bit isolated. My app is web based.  It's 99.9% Transact-SQL creating HTML output and .1% vb.asp. My VP.asp does two things: ...
Score stored procedure stopped working
Dan D. - 31 Aug 2006 3:49 PM - 17 messages
Using SS2000 SP4. I have a stored procedure that I created a week or so ago and it stopped working this morning. I use it in a report and the report stopped filtering data and I traced the problem back to the sp. This is the sp: ...
Score How is the design for this complex requirement ?
krislioe - 31 Aug 2006 3:47 PM - 6 messages
Hi All, We have a Discount scheme that can be given for all possible combination of all customer, area and product hierarchy (attached below). for example : Promotion No.001 =>for sales on : CustomerGroup 'A', Area 'B', and ProductBrand 'C' will get discount 2 % ...
Score trying to use a cursor to update table..
plan9 - 31 Aug 2006 3:21 PM - 11 messages
Hello I'm trying to use a cursor and some dynamic sql to updtate a table, but I'm having a error Server: Msg 170, Level 15, State 1, Line 1 Line 1: Incorrect syntax near 'periodo5'. the code.... --declare @jp_temp2 as  int ...
Score calling a clr sp from a clr sp
Sam Jost - 31 Aug 2006 2:51 PM - 4 messages
Say, for example, I've got two stored procedures in my dabase c# project, can one of them call the other directly or do I need to use a SqlCommand? Example: I've got this stored proc:   [Microsoft.SqlServer.Server.SqlProcedure] ...
Score Creating a new database using an existing as template
Johan Sjöström - 31 Aug 2006 2:47 PM - 3 messages
What are the "best practices" for this? I'm using SQL Server 2000. I basically want an identical database, but with a new name and new datafiles. Right now, I have copied the template db's mdf/ldf files to new ones, ...
Score Changing the identity seed & increment programatically - please help!
almurph - 31 Aug 2006 2:43 PM - 4 messages
Hi,         I want to change the identity values of an identity column of a table that already has rows in it, such that, it begins at zero and goes up in even numbers - that is, like 0, 2, 4, 6, 8, etc.... instead of the ...
Score Performance hit when stored proc name begins with SP ?
VMI - 31 Aug 2006 2:19 PM - 5 messages
Is it true that there's a performance degradation if the stored procedure name begins with SP? A colleague at work read that recently, but couldn't find the article. I just wanted to verify it. Thanks. ...
Score ODBC Errors?
Weston Fryatt - 31 Aug 2006 2:11 PM - 8 messages
Environment:     Windows 2003 Enterprise Server (Production Server)     SQL Server 2000 Standard Edition (with Service Pack 4 installed)     Windows 2003 Enterprise Server (Test Server)     SQL Server 2000 Enterprise (with Service Pack 4 installed) ...
Score import export wizard in SQL2005
Carlos - 31 Aug 2006 1:47 PM - 1 message
Hi all, I was trying to get to know ss2005, and I have not been able to find a way of exporting/importing data from a db table to a flat file. Where is the option in management studio to do such thing? ...
Score Need help..
sasireka.gurusoft - 31 Aug 2006 12:44 PM - 3 messages
Hello.. does anyone know how to deploy the ASP.Net applications using visual studio 2005 thanks sasi ...
Score Not (@myBit) is not working
Andreas Klemt - 31 Aug 2006 11:14 AM - 3 messages
Hello, I have this DECLAR @myBit bit SELECT @myBit = 1   --This means true Now I want to do the negative out of it like SELECT NOT (@myBit) but this does not working. How can I do this? Thanks for any help in advance! ...
Score temporary vs permenantly linked servers
rocket salad - 31 Aug 2006 11:01 AM - 4 messages
Where I work we write hundreds of procedures which run against different databases depending on the connection string passed in. To manage this, there is a user function which returns the string for the linked server, eg. '[x.x.x.x].somdb.dbo.' which can be prepended to tablenames in a string. ...
Score Way to check when a record was last updated without using a date field?
Cain - 31 Aug 2006 10:50 AM - 9 messages
Is there a way to check when a record was last updated without using a date field? Cheers, Cain. ...
Score Re: Should I use indexes?
SQL Menace - 31 Aug 2006 10:46 AM - 1 message
what about select field1 ,field1  as field2 into TempTable1 from Table1 then drop Table1 and rename TempTable1  to Table1 would that work? But anyway, why do you need the same column twice? you can do select field1 ,field1  as field2 ...
Score raise errro in clr procedure
Pma_Shane - 31 Aug 2006 10:33 AM - 7 messages
I am try to raise a error to sql server from a clr procedure. I  tried SqlContext.Pipe.ExecuteAndSend(new SqlCommand("raiserrro("foo", 16, 1))); try { p.ExecuteAndSend(cmd); } catch { } which casuse a message to be printed in query analizer but it doesn't seem ...
Score calling a clr stored procedure
Sam Jost - 31 Aug 2006 9:32 AM - 4 messages
Maybe a stupid question: when I write a clr enabled stored procedure, I can of course call it the usual way using a SqlCommand("Exec MyProc"). Is there another way to call this clr stored procedure? Maybe by somehow referencing the database assembly? ...
Score Free ebook of sqlserver 2000
Chamnap - 31 Aug 2006 9:24 AM - 4 messages
Hello, everyone. Do everyone know the link to free ebook of sqlserver 2000? Thanks in advance. ...
Score Scripting Database role members in SQL server express 2005
steve - 31 Aug 2006 7:37 AM - 4 messages
Hi All How do I check if a database role exists already using TSQL script Below is my current script .... I need to check if they exist so I can bypass the step or Delete then and recreate them I can't get the role line 'If not exists...' to work ...
Score Accessing SqlServer from Macintosh
Amit - 31 Aug 2006 7:20 AM - 2 messages
Hello, Can someone tell me, what are the various alternatives (free) for accessing SQL Server database from Mac OS X. Currently I am using SQL Server 8.x. Thanks in Advance Regards -Amit Gupta ...
Score Composite Key
Manish Sukhija - 31 Aug 2006 7:19 AM - 3 messages
Hi All,          Can i make Primary key and Composite ket seprately in one table or elaborating it can i make one field as primary key and three field as composite ket so that it is to be differenticate seprately. ...
MOD
Next »