SQL server -----IF we have lot of records in Database. How we can handle them?
IF we have lot of records in Database. How we can handle them? ...
IF we have lot of records in Database. How we can handle them? ...
How to get updated row's PK_ID UPDATE [M_RATINGS] SET [RATING] = @rating WHERE [POST_ID] = @postId AND [USER_ID] = @userId; ...
In the SSIS project, I use a custom log provider to write log in script task, like below: Dts.Events.FireInformation(19165, "STBuildFileName", "Attempting to download " + resultantFileName, Nothing, 0, False) But in eventlog, the event id of this log is not 19165 but another one.. Is there anyone know why its behavior like this? ...
My data looks like below: <products> <product ProductID="1" Price="79.99" Weight="30.00" Quantity="1"> <addon ProductAddonID="0" ControlTypeID="9" Price="25.00" Weight="0.00" Quantity="1" Name="yyy" Data="ASD" /> <addon ProductAddonID="89" ControlTypeID="0" Price="15.00" Weight="4.00" Quantity="1" Name="xxx" Data...
I'm in the process of importing data from a legacy MySQL database into SQL Server 2005. I have one table in particular that's causing me grief. I've imported it from MySQL using a linked server and the MySQL ODBC driver, and I end up with this: Col Name Datatype MaxLen OrderItem_ID bigint 8 PDM_Structure_ID int ...
I've got a hibernate query that returns a list of objects and I want to order by a title. This is a user maintained field and some of our customers like prefixing their titles with numbers, this isn't something I can control. The data is something like this: - 1 first thing - 2 second thing - 5 fifth thing - 10 tenth thing - 20 twe...
This three columns are taken from 3 tables. In other words, these records are retrieved by joining 3 tables. It is basically a very simple time sheet that keeps track of shift starts time, lunch time and so on. I want these four records to show in one row, for example: setDate --- ShiftStarted --- LunchStarted --- LunchEnded ---- ...
How to insert the resultset given by the commands RESTORE FILELISTONLY RESTORE HEADERONLY RESTORE VERIFYONLY into an automatically generated temp table ? I would like to use a technique similar to (so the table is auto created, with all the columns matching the resultset's columns) SELECT * INTO #TempTable FROM (RESTORE FILELISTON...
MS SQL SERVER 2008 I have a database. Several operators via my program can interact with it. Each operator have its own name. At present, I create a login and corresponding user name for each operator. Is it good idea ? Number of operators can grow ... maybe, there's some good practices about it ? ...
One of my databases had 450 GB of size for the data mdf file. I Dropped the unecassary tables to reclaim some space in the database and to my surprise even if there was around 150 GB of freespace, the data file won't shrink below the Files initial size which has grown to 450 GB. What could be the simplest solution/ workaround for this ? ...
I have an interface in CLR between SQL Server and the Exchange Web Services to Sync and send emails between applications. In testing this it works(ed) without any problems; we are seeing sporadic issues in the production environment where longer web service task appear to be have overlapped. My question is very simple and I cant decide ...
Hi, i am preparing for Microsoft exam 70-432 SQL Server 2008 . In the book i read, its highly recommended that you use separate log-in for each SQL Service. But i am unable to understand what is a benefit in using separate USER? Please let me know if anyone has an idea about this. Regards, fayalif ...
One of my table column's named "SetDate" of type DateTime looks as: 2010-08-02 02:55:58.420 The DateTime format from the application looks as: 2/11/2010 The problem is: I'm passing an SQL query to the DB via application. The query has WHERE clause which compares SetDate to the date coming from application. SetDate column carries ...
Simple table: create table Items ( Price money null ) Now I need to create a stored procedure that accepts one paramter of type bit @ItemsWithPriceTenDollarsOrMore which: returns all items if parameter is null returns all items with Price >=10 if parameter = 1 returns all items with Price < 10 if parameter = 0 I have difficulty ...
BEGIN TRY BEGIN TRANSACTION -- DO SOMETHIING COMMIT TRAN END TRY BEGIN CATCH IF(@@TRANCOUNT > 0) ROLLBACK TRANSACTION RAISERROR(ERROR_MESSAGE(), ERROR_SEVERITY(), ERROR_STATE()) --ERROR: Incorrect syntax near 'ERROR_MESSAGE'. END CATCH What wrong in the raise error statement? ...
Sorry for this simple question, but i'm missing the forest through the trees. These are my tables (i left the sparepart-table because i'm only looking for two special fk's): I need the distinct rows from tabData which are referenced in the child-table tabDataDetail with fiSparePart=8837 and 8969. The following gives me only that rows ...
I'm trying to use FreeTDS's ODBC driver to access a MS SQL Server 2005 instance from a Linux application. When I run tsql on the command line, it will read /etc/freetds.conf and $HOME/.freetds.conf and pull in the options I want to set (confirmed with strace watching open/access calls). However when I use FreeTDS via unixODBC (which is...
Is there a way to subtract a geometry from another? A kind of reverse STUnion.. The problem I am having is that I need to ensure a shape fits within another (without changing the larger shape). I thought I could use the STIntersection to get the shape thats "in". However, STIntersection is not accurate and produces a shape that can (an...
Hello, I have a SQL Server 2008 database that has two tables. These two tables are CoreGroup and CoreGroupMember. Please note, I did not setup these tables. Regardless, the table structure is: CoreGroup --------- ID GroupMember1MemberName GroupMember2MemberName GroupMember3MemberName GroupMember4MemberName CoreGroupMember ------------...
Hi, I need to create a stored procedure which receives a parameter (named @codes). This is a string which contains a list of codes separated by a semicolumn. I'd need to look inside a table and return all rows that have a code (which is in the column EANcodes) which was passed in the @codes parameter. Can anyone help me get started. M...