sql-server

SQL Server - Clustered index design for dictionary

Hi, Would like some advice from this. I got a table where I want to keep track of an object and a list of keys related to the object. Example: OBJECTID ITEMTYPE ITEMKEY -------- -------- ------- 1 1 THE 1 1 BROWN 1 2 APPLE 1 3 ORANGE 2 2 W...

Set UK date format for SQL Express

Hi, How do I permanently set the date format for SQL Express to be UK format (dd/mm/yyyy). I know I can use SET DATEFORMAT DMY, but this only works for that connection. I have also seen, exec sp_addlanguage 'British', 'English', 'January,February,March,April,May,June,July,August,September,October, November,December', 'Jan,Feb,Mar,Ap...

DML operation with out logging - SQL Server

Is there any way that we can do DML operation with out logging it into log file? For example, when I am inserting a row in database, this operation will be logged in log file irrespective of using transaction or not. But I don't want to log this operation in the log file. ...

SLOW RUNNING PACKAGES

HI Everyone, I have SSIS packages which runs on nightly basis to move data from AS400 to SQL Server 2005. From last couple of months my packages consuming more time to complete as a scheduled job. If I run same packages manually they are completing normally . In all my ssis packages i am truncating the data in sql server then Bulk inser...

SQL server-declare local variable: "there is already an object named '' in the database"

hello, I wrote the following stored procedure, in which I use a local variable 'syncParam': declare @syncParam bit select isSync into syncParam from MyTable where id=@id if (@syncParam='True')... else ... return @syncParam When I executed this stored procedure at the first time it worked, but after that I get the following error:...

sql query to find nth highest salary from salary table

How can i find the Nth highest salary in the sql server ...

SQL Server 2008 DBCC Problems

We have a database Ms DBCC CHECKDB (MS) Or ALTER DATABASE MS SET SINGLE_USER DBCC CHECKDB(MS,REPAIR_ALLOW_DATA_LOSS) ALTER DATABASE MS SET MULTI_USER Error message Msg 0, Level 11, State 0, Line 0 A severe error occurred on the current command. The results, if any, should be discarded. Msg 0, Level 20, State 0, Line 0 A severe er...

comparing and contrasting Sybase and SQL Server

They share common history, they run on different operating systems. This is the part I know. what parts remain the same? which have changed since they split? is SQL Server knowledge still applicable to Sybase? what features available in Sql Server are not present in Sybase? which features that are present in Sybase are not availabl...

sql server 2008: configuration information

Hi, I have sql server 2008 installed on my dev machine. How I figure out things like, the name of the server, do I connect to it using windows auth or using sql auth. If I connect using sql auth what is my account information. I set it up a while back and I dont know how to read all the sql server install and configuration information....

DataGrid view in asp.net is not displaying data

I want to dispaly column in datagrid view using custom query statement but i want to send value to parametrized data in query how can i do this ? my code is below select c.customer_id, c.customer_first_name, c.customer_last_name, c.customer_address, c.account_number, c.account_type, a.account_balance, t.transfer_amount_balance, t.s...

SQL and MS access- filtering of the data on the form

Hi All. I am using SQL 2005 as backend and MS Access as frontend. Now, I get all my filtering of the data with views and no problems so far but I came accross some issues. In access I had a form and on that form I had a field1 which I used to filter the data I wanted in that form with query. Example: Last, First Name or DOB. In Access...

Design SQL schema in Visual Studio and auto-generate SQL script to create and upgrade database

I don't know much about SQL but this is what I want: Visually design an SQL database schema in Visual Studio Let VS generate a create script for this database Track modifications to my schema and automatically generate upgrade SQL scripts Generate entity classes I can use with WCF (without circular ref problems) Is this possible some...

convert Imagepath into bytes

Can anybody tell me that how to convert a image path into bytes to store in database in asp.net.please help me out. ...

How do i migrate data from MSSQL 2000 data tp MySQL?

Hi guys, I am given a task of developing a tool for migrating data from MSSQL 2000 do MySQL database. My clients runs a third party software which stores data in MSSQL 2000. The application is desktop software that stores data in local MSSQL Server. My Application is in web. We store data on online servers. Now my task is to write a ...

Export Data of Sql Compact database (mdf File) to Access or Excel or CSV format

Hi i Have Used Database file for storing Data in my Application. Now I want to take backup of data in Access, Excel or in Any other Format. Thank You.. ...

Why would updating a view cause a speed up?

We have a peculiar situation with a particular query. This query joins to a view which creates a PIVOT on some data. Now we are finding at some times this query runs really slow (10 seconds). I havent got a handle on how to consistently reproduce it running slowly. However, when it runs slow we can drop and recreate the View joined i...

XQuary adding or replacing attribute in single SQL update command

I have a Table with an XML column, I want to update the xml to insert attribute or to change the attribute value if the attribute already exists. Let's say the starting xml is: < d /> Inserting: UPDATE Table set XmlCol.modify('insert attribute att {"1"} into /d[1]') Changing: UPDATE Table set XmlCol.modify('replace value of /d[1]/...

T-SQL: Best way to copy hierarchy data?

My database looks like this: Questionnaire Id Description Category id description QuestionnaireId (FK) Question id CategoryId (FK) field When I copy a questionnaire, I'd like to copy all the underlying tables. So this means that the table Questionnaire gets a new Id. Then, all the belonging categories of the questionnaire must...

How to use CREATE LOGIN sql statement?

Hi, How to use CREATE LOGIN statement on SQL Server 2005? I was trying nearly everything, with commas, without them, with strings, without them etc. CREATE LOGIN @loginame WITH PASSWORD = 'pass', DEFAULT_DATABASE='dbname' DEFAULT_LANGUAGE='us_english', CHECK_POLICY= OFF; I always get below error: Incorrect syntax near the keyword '...

How to get the length of char or varchar field in sql server ?

Hi, I want to write a script for SQL Server, which changes the table from ASCII to UNICODE.For that i need to change Char(n) to nchar(n), similarly for varchar(n) to NVarchar(n).But i am not able to find out the value of n. Can anybody tell me, how can I get the value of n. Thanks In Advance ...