|
Hi ,
thanks for your reply, i am having one mdf and ldf files , i
want to restore the database from these two files . i tried to open with
access , but im getting error .
if u have any idea please let me explain ..
|
|
|
|
|
mrsuman wrote: thanks for your reply, i am having one mdf and ldf files , i want to restore the database from these two files . i tried to open with access , but im getting error .
Looks like you haven't read my reply... these are SQL Server databases, not Access files
|
|
|
|
|
i am importing data from Excel to Sql Server Table but I got
follwing error.
Heterogeneous queries require the ANSI_NULLS AND ANSI_WARNINGS
my code
Insert Into JewelryUploadTemp
SELECT * FROM OPENROWSET('Microsoft.Jet.OLEDB.4.0',
'Excel 8.0;Database=D:\share\JewelryUploadSampleMar2008.xls','select * from [chetan$]')
in stored procedure
I am waiting for help...
Best Regards,
Chetan Patel
|
|
|
|
|
Did you not try searching Google[^] to find out what the error message means?
Paul Marfleet
"No, his mind is not for rent
To any God or government"
Tom Sawyer - Rush
|
|
|
|
|
Hi,
Are you using a SP.
Try this;
Generally the error is due to needing to set the properties
when you create the stored procedure. Try recreating your
stored procedure using:
SET ANSI_NULLS ON
GO
SET ANSI_WARNINGS ON
GoodLuck
|
|
|
|
|
Dear all,
Here i m facing a problem with some group by date here i m getting two rows of a single date for values fetching. if any one wants i can give the code for ur easy answer giving.
thank you
sai krishna
|
|
|
|
|
When you are using date as group by field then it create new group for each and every record with different time.
ex/
01/10/2007 10:10:00 PM
01/10/2007 12:10:00 PM
so use Convert Function for Convert Date in dd/mm/yyyy fromat for correct answer
Best Regards,
Chetan Patel
|
|
|
|
|
thanks i got it
sai krishna
|
|
|
|
|
hi fellows,
i want to change the data type of a table1(column1) that exists as a foreign key in table2(column2).
i want to change the data type of column1(table1) but sql server gives the error that column2(table2) is dependent on column1(table1) so the data type cannot be changed.
waht query should i use to ensure that when data type is changed of column1, then the data types of all the referencing columns in different tables should be changed?
reply soon plz!!
modified on Saturday, March 8, 2008 3:34 AM
|
|
|
|
|
Suspend referential integrity between the 2 tables, then make your changes.
Paul Marfleet
"No, his mind is not for rent
To any God or government"
Tom Sawyer - Rush
|
|
|
|
|
how do i suspend refrential integrity constraint?
|
|
|
|
|
Bring your table up in Design mode. From the 'Table Designer' menu select 'Relationships'. Set the 'Enforce Foreign Key Constraint' option to 'No'.
Paul Marfleet
"No, his mind is not for rent
To any God or government"
Tom Sawyer - Rush
|
|
|
|
|
how do i do it without opening sql server. i want to do it through my own coding
|
|
|
|
|
Look at the ALTER TABLE[^] statement.
Paul Marfleet
"No, his mind is not for rent
To any God or government"
Tom Sawyer - Rush
|
|
|
|
|
While i am trying to import .dat file into the SQL database i am getting this error.
I have pointed the mdf and ldf files to D drive which has around 2.5gb of space left.I am using the bulk import for importing the data.
The statement has been terminated.
Msg 1105, Level 17, State 2, Line 1
Could not allocate space for object '(SYSTEM table id: -1073380781)' in database 'TEMPDB' because the 'DEFAULT' filegroup is full.
Msg 9002, Level 17, State 2, Line 1
The log file for database 'tempdb' is full. Back up the transaction log for the database to free up some log space.
Any solution is welcome.
|
|
|
|
|
i think you should turn off updating of log
TVMU^P[[IGIOQHG^JSH`A#@`RFJ\c^JPL>;"[,*/|+&WLEZGc`AFXc!L
%^]*IRXD#@GKCQ`R\^SF_WcHbORY87??6?N8?BcRAV\Z^&SU~%CSWQ@#2
W_AD`EPABIKRDFVS)EVLQK)JKSQXUFYK[M`UKs*$GwU#(QDXBER@CBN%
Rs0~53%eYrd8mt^7Z6]iTF+(EWfJ9zaK-i?TV.C\y<p?jxsg-b$f4ia>
--------------------------------------------------------
128 bit encrypted signature, crack if you can
|
|
|
|
|
Hi all, thanks for looking
I have a table in which i need to apply some conditions depending on the day
TableX columns:
ID int
Name varchar (50)
Mo int
Tu int
We int
Th int
Fr int
Sa int
Su int
Currently i have an SP that has 7 if else statements (1 for each day of the week (using datepart)) and these queries are almost identical, the only chnge is the column name
I would like to make this query smaller and i was wondering if there is another way to implement this
I wouldnt like to create a child table with the days values
Any advice will be appreciated
Thanks
Alexei Rodriguez
|
|
|
|
|
Use DATENAME(weekday, date) to return the name of the day that a particular date falls on.
Paul Marfleet
"No, his mind is not for rent
To any God or government"
Tom Sawyer - Rush
|
|
|
|
|
Thanks for your answer
Im using something similar (i dont know if faster):
datepart(dw,date)
What id like is to get rid of the if else statements
Will there be any way to acomplish this for this table structure?
Thanks again
Alexei Rodriguez
|
|
|
|
|
Use the CASE statement to select from a different field based on some criteria. Something like:
SELECT
CASE datepart(dw, date)
WHEN 1 THEN CAST(field1 as varchar)
WHEN 2 THEN CAST(field2 as varchar)
WHEN 3 THEN CAST(field3 as varchar)
etc...
END
Paul Marfleet
"No, his mind is not for rent
To any God or government"
Tom Sawyer - Rush
|
|
|
|
|
I have a parent table Item and a child table Grade. For a query, I would like to be able to select from a view or function that gives me one Item per row (as if I were selecting right from it) but adds an ntext column to the output, where its child Grades are listed in a delimited list. I'm not entirely sure where to go with this, without making it too terribly complicated. Please advise?
|
|
|
|
|
Google[^] is your friend here...
Paul Marfleet
"No, his mind is not for rent
To any God or government"
Tom Sawyer - Rush
|
|
|
|
|
Not sure how feasible this is, but will ask in case someone has figured it out:
I have a table of people with people and a unique id and a name (amongst other things of course)
e.g.
uid | uName
I have a separate table that has entries where two of the IDs will get recorded
e.g.
date|signed(bit)|approved (bit)|signerID|approverID
I want to be able to retrieve the uName for signerID and approverID
e.g.
SELECT t2.date,t2.signed,t2.approved,t1.userName as signerName,t1.userName as approverName
JOIN (so that signerName and approverName both get resolved).
WHERE date < _SOMEDATE_
I know I could dump using a insert select on the people table into a temp table and JOIN against that, but wanted to see if anyone had a fancier/more elegant solution than that ...
TIA
|
|
|
|
|
Something like:
SELECT Approvals.Date, Approvals.Signed, Approvals.Approved, Signer.uName, Approver.uName
FROM Approvals
INNER JOIN People AS Signer
ON Approvals.SignerID = Signer.uid
INNER JOIN People AS Approver
ON Approvals.ApproverID = Approver.uid
Regards
Paul Marfleet
"No, his mind is not for rent
To any God or government"
Tom Sawyer - Rush
|
|
|
|
|
Works great! I've become so fixed on Left Joins lately ... I knew there was a way to do it with a 'looser' join, but couldn't quite nail it down. Thanks!
|
|
|
|