sql-server-2005

SQL Server: invalid object name how to solve it?

error returns to me in below codes: Msg 208, Level 16, State 1, Line 1 Invalid object name 'ENG_PREP'. insert into ENG_PREP VALUES('572012-01-1,572012-01-2,572012-01-3,572013-01-1,572013-01-2', '', '500', '', 'A320 P.001-A', 'Removal of the LH Wing Safety Rope', '', '', '', '0', '', 'AF', '12-00-00-081-001', '', '', '', '', '', '...

How can i solve "An explicit value for the identity column in table"?

if i try to add some data into my table error occurs: Error:Msg 8101, Level 16, State 1, Line 1 An explicit value for the identity column in table 'ENG_PREP' can only be specified when a column list is used and IDENTITY_INSERT is ON. insert into ENG_PREP VALUES('572012-01-1,572012-01-2,572012-01-3,572013-01-1,572013-01-2', '', '500', ...

How to access SQL Server scalar funtions in MS Access VB

Hello, I'm trying to find out how I can access scalar functions from the SQL Server database of my adp file. I have an adp file in access 2007 and a SQL Server 2005 DB. In access VB I try to get the result of a scalar function with parameters. I tried with DAO, but it that case currentdb = nothing: Dim dbs As DAO.Database Dim sq...

Bulk updating an sql server table using xml

How can i update bulk data in sql server 2005 by sending the data in XML form ? i am able to insert bulk data into the table, but i am not getting idea to update the data. ...

SQL syntax problem (multiple selects)

I am having problems retrieving accurate data values with my stored proc query below: CREATE PROCEDURE usp_InvoiceErrorLog @RecID int AS DECLARE @ErrorString as varchar(1000), @ErrorCode as int; Select @ErrorCode = ErrorCode from tbl_AcctRecv_WebRpt Where RecID = @RecID; IF NOT(@ErrorCode = NULL) Begin Sele...

Error from SQL Server

Hello friends I am getting the following error while making the foreign key 'tbl_course' table saved successfully 'tbl_students' table - Unable to create relationship 'FK_tbl_students_tbl_course'. Introducing FOREIGN KEY constraint 'FK_tbl_students_tbl_course' on table 'tbl_students' may cause cycles or multiple cascade p...

Login Failed for user?

I am developing a web app that connects to a SQL 2000 database. Everything works perfectly on my database (which is actually SQL 2008) but when I try to migrate it onto another server (that's actually running SQL 2000) I get some strange errors. I'm getting Login Failed for the username that the web app uses, so I did my normal troubles...

Use a Select Statement within a wildcard where clause

Working in MS SQL 2005 and I want to use a select statement within a wildcard where clause like so: SELECT text FROM table_1 WHERE ID LIKE '%SELECT ID FROM table_2%' I'm looking for product ids within a large body of text that is held in a DB. The SELECT statement in the wildcard clause will return 50+ rows. The statement above is o...

Will a Cross Apply bail, but not error in SQL Server?

We're inserting a couple millions records into a details table, the data for which is stored in the master table in CSV type format. To do the insert we're using a cross apply function, which seems to work if I do the inserts one by one, but if I do the entire insert, only about 2/3 of the records go in, and the query just stops, with su...

Why we can't set default value of datetime parameter in stored procedure = getDate() ?

I want to know why I can't set default value to SP datetime parameter to getdate() as below : Create PROCEDURE [dbo].[UPILog] ( @UserID bigint, @ActionID smallint, @Details nvarchar(MAX) = null, @Created datetime = getdate() ) if I try to save it will give me a compiler error Msg 102, Level 15, State 1, Procedure ...

Query plan caching and performance

You can read the backstory if you want, after changing my nonclustered index to a clustered index things started running a lot faster. The problem with the initial query plan taking 2-3 seconds still remain though. However, the keep plan query hint improved that quite a bit. BACKSTORY I have an inverted index where I store things I wis...

What permissions should be granted to the remote user to do anything with "the database" and no other?

What permissions should be granted to the remote user to do anything with the database "123" in SQL Server 2005 Express using SQL Server Management Studio Express such that the remote user cannot do anything to any other database? I would also like that the remote user cannot see the other databases. That is "123" is for the user login...

Need guidance, link tutorials help using gridview

Need guidance, link tutorials help using gridview any site tutorial pdfs which clearly explain how to use gridview programmatically (forgive the spelling) the dataset binding etc with respect to gridview source of data is sql c# statement. like sql command="select etc" vs08 c# sql gridview control ...

How can i get Created date of a column in SQL server Table ?

I use the following query to get information about columns of a SQL Table : SELECT * from information_schema.columns WHERE table_name = 'userpersonalinformation' but I can't find any data about creation date for each column ... Is there any way to get creation date of a column in a table ? ...

GUID. and automatic id as primary key in sql databases

SELECT COUNT(*) FROM table_name; check count count+1 is the new primary key starting point then keep on incrementing before every insert operation but what is this GUID? doe sql server provide something where it automatically generates and incremented primary key? any link to description and any help thanks ...

How to set default value or binding for datetime to 1/1/0001 12:00:00 AM in SQL Server 2005?

Hi I am trying to put a default value of "1/1/0001 12:00:00 AM" in but first it does not allow me. So I then tried to put "1/1/0001" but when I test it. It gets changed to (((1)/(1))/(1)) and when I try out the default value it gives back "01/02/1900 12:00:00 AM" I am not sure why. ...

How can I restrict the part of a website so that it can be viewed by only one computer at a time?

Using C# Visual Studio 2008 and SQL Server 2005. One database server. One webserver Three clients Webpage name is alpha. Site name is mysite. I want that only one client at a time can view the page alpha. If one is viewing the page and another from another computer tries to view the same page, access is denied. Is there any way to c...

What locks are enforced by SQL Server 2005 Express ?

Consider a web page having grid-view connected to SqlDataSource having all permission to insert update and delete. Publish the web page. This is all on one computer local Now opening website on browser A - pressing edit of grid-view opening website on broswer B - pressing edit of grid-view. Now I edit in both browsers and press u...

how to restrict all pages of website to be opened once on complete computer. explanation provided

Possible Duplicate: how can i restrict the part of a website so that it can be viewed by only one computer at a time i want to implement a restriction such that only one copy of a page can be opened at a time. that is example:- open firefox type stackoverflow.com --new tab--again stackoverflow.com ---new tab--again stackove...

DISTINCT keyword in SQL server 2005

Hi I have written this query in sql server 2005 but it still will show the name of products that are the same!!thanks SELECT DISTINCT ProductName FROM Products,Suppliers WHERE Products.SupplierID = Suppliers.SupplierID AND Fax IS NULL for example I have two product names that are the same 'Chei' instead of returning one 'chei' it w...