How to convert Visual Foxpro database into SQL Server database

One of my clients has a Foxpro database (.DBF file). I need to convert it into a SQL Server 2008 database. Does anyone have any idea how to do this? Kindly give me solution. Thanks in advance….

Best (easiest) way to make a SQL Server dump and import that dump in another SQL Server

I would like to achieve a database export (dump) in SQL Server from one server and import that dump in another SQL Server and not necessarily in the same schema name. For example if I have a database prepared with all the data set for implement a new DB for a new customer, that db […]

SQL Server function intermittent performance issues

We have a function in our database that searches two large tables to see if a value exists. It is a pretty large query, but it is optimized to use indexes and generally runs pretty fast. Three times over the past 2 weeks, this function decided to go haywire and run extremely slow, which causes […]

What is the advantage of using FAST_FORWARD for defining a cursor?

What is the advantage of using FAST_FORWARD for defining a cursor? Is it better for performance? why?

Sql server table usage statistics

I want to find out which tables in the database are most heavily used (I mean read/write Bytes/Table Size ratio) or IO / Table size ratio. To decide which tables to place on faster discs and which on slower ones. Any ideas? I tried make use of dm_db_index_usage_stats But how to find out how many […]

How to select a row based on its row number?

I’m working on a small project in which I’ll need to select a record from a temporary table based on the actual row number of the record. How can I select a record based on its row number?

Cannot bulk load because the file could not be opened. Operating System Error Code 3

I’m trying to set up a Stored Procedure as a SQL Server Agent Job and it’s giving me the following error, Cannot bulk load because the file “P:\file.csv” could not be opened. Operating system error code 3(failed to retrieve text for this error. Reason: 15105). [SQLSTATE 42000] (Error 4861) Funny thing is the Stored Procedure […]

How do I perform an exact string match on a non-case sensitive field?

I would like to find all the rows in a table and match on an exact case sensitive string. Unfortunately, my table has the case insensitive collation. What is the most efficient way to perform this. Eg. I would like the following to return no rows: select * from sysobject where name = ‘Sysbinobjs’ For […]

ROW_Count() To Start Over Based On Order

Create Table #Test ( ID Int Primary Key Identity, Category VarChar(100) ) Insert into #Test (Category) Values (‘Banana’), (‘Banana’), (‘Banana’), (‘Banana’), (‘Banana’), (‘Banana’), (‘Strawberry’), (‘Strawberry’), (‘Strawberry’), (‘Banana’), (‘Banana’) Select * ,ROW_NUMBER() Over (Partition by Category order by ID) as RowNum From #Test Order by ID So this script returns this: ID Category RowNum 1 Banana […]

Create a trigger to insert records from a table to another one. Get inserted values in a trigger

I have two tables tbl_PurchaseDetails and tbl_ItemDetails. I need to insert some rows into tbl_ItemDetails from tbl_PurchaseDetails, right after it is inserted in tbl_PurchaseDetails. I know the problem but i am unable to solve it. Please help. I have written the following code for the trigger: CREATE TRIGGER trigger_UpdateItemDetails ON tbl_PurchaseDetails FOR INSERT AS DECLARE […]

MS SQL Server is a Microsoft SQL Database product, include sql server standard, sql server management studio, sql server express and so on.