|
That's a pretty vague error message. If I were you, I'd put a bunch of try catch blocks in there and try to get more information from the exception by popping up message boxes or printing the exception information into a log file or something. If the exception gives you a line number reference to your code at least that would be a place to start. Without more info...who knows what the underlying cause is.
Hope this helps.
|
|
|
|
|
ALTER procedure [dbo].[sp_BankInsert]
(
@bankid varchar(100),
@bankname varchar(100),
@address1 varchar(100),
@address2 varchar(100),
@city varchar(50),
@state varchar(100),
@country varchar(50),
@telephone1 varchar(20),
@telephone2 varchar(20),
@fax varchar(20),
@email varchar(50),
@contactperson varchar(100),
@cphone varchar(20)
)
begin
insert into tblBankMaster(bankid,bankname,address1,address2,city,state,
country,telephone1,telephone2,fax,email,contactperson,cphone)values('@bankid',
'@bankname','@address1','@address2','@city','@state','@country','@telephone1',
'@telephone2','@fax','@email','@contactperson','@cphone');
end
smar
|
|
|
|
|
Remove the ': should look like:
values(@bankid,
etc.
|
|
|
|
|
How to copy database design of a table into another table without copying its values
|
|
|
|
|
.NET- India wrote: How to copy database design of a table into another table without copying its values
If you want to do this manually, you can do this through Management Studio by right-clicking a table and selecting 'Script Table As... -> CREATE TO'.
If you want do do it in code, you could use SMO[^] to obtain metadata for a particular table and create another table based on this metadata.
Paul Marfleet
"No, his mind is not for rent
To any God or government"
Tom Sawyer - Rush
|
|
|
|
|
You could also
Select * into [NewTable] from [ExistingTable] where 1=0
SG
Cause is effect concealed. Effect is cause revealed.
|
|
|
|
|
hello all,
while i am trying to connect my windows application to mysql database, I am facing problem in opening the connection.
The error msg I am getting is "The 'System.Data.Odbc' provider is not registered on the local machine".
OleDbConnection con = new OleDbConnection("provider=System.Data.Odbc;Data Source=localhost; Initial Catalog=GKBM;Persist Security Info=True");
ANYBODY KNOWS THE SOLUTION TO THIS PROBLEM PLEASE REPLY ME AS SOON AS POSSIBLE.
THANKS & REGARDS
SMAR.
SMAR
|
|
|
|
|
When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: SQL Network Interfaces, error: 40)
i keep getting this error in the Application Log of the event viewer...
I have tried everything like changing the settings in SQL Server Surface Area Configuration...but am still getting the same error..
Am actually making a Windows Service that wud check the database for A DateTime field and if the entry in it matches the System DateTime it wud send an email to the person corresponding to whom this DateTime entry is in the database..
Please help me....
Thanks!!!
|
|
|
|
|
3 quick thoughts:
1: Did you restart the Sql service after making the changes to the surfacey widget?
2: Have you checked users/permisions?
3: Is your connection string correct? (Using the server tab in VSxxxx) Can you connect to the database?
Sorry if you've already done these.
|
|
|
|
|
Hi all,
i just want to know about how to Convert date formate 4th april 2008 to default date formate....
i write
select CONVERT (datetime, '4 July 1997')
it shows 1997-07-04 00:00:00.000
but i need
select CONVERT (datetime, '4th July 1997')
o4th july 1997 to show the default formate...
thanks in advance
Thanks
Subbu.
|
|
|
|
|
The CONVERT function has a number of options for different date formats. Read the documentation and choose the most appropriate format for your requirements.
Paul Marfleet
"No, his mind is not for rent
To any God or government"
Tom Sawyer - Rush
|
|
|
|
|
hi paul...
thank u for ur response .but i found answer for every formate....
but i need to convert dates like o4 th july 2005 or
3rd august 1997
31st december 2000
22nd july 1997....i.e th,nd,rd,....
to default formate..... 04/07/2005,
03/08/1997
helpe with a function.....
i am trying this ,but it convert without th,rd,nd,...
if not (@Date IS NULL)
BEGIN
SET @Date = LEFT(@strPhotoDate,patindex('%|%',@strPhotoDate )-1)
SET @Date = replace(@strPhotoDate,'th','')
SET @Date = replace(@strPhotoDate,'nd','')
SET @Date = replace(@strPhotoDate,'rd','')
SET @Date = replace(@strPhotoDate,'st','')
SET @Date = replace(@strPhotoDate,',','')
set @GetPhotoDate = CONVERT(datetime, @Date)
--cast(@GetPhotoDate as DATETIME)
END
END
like that...
thanks in advance
Thanks
Subbu.
|
|
|
|
|
hi paul...
thank u for ur response .but i found answer for every formate....
but i need to convert dates like o4 th july 2005 or
3rd august 1997
31st december 2000
22nd july 1997....i.e th,nd,rd,....
to default formate..... 04/07/2005,
03/08/1997
helpe with a function.....
i am trying this ,but it convert without th,rd,nd,...
if not (@Date IS NULL)
BEGIN
SET @Date = LEFT(@strPhotoDate,patindex('%|%',@strPhotoDate )-1)
SET @Date = replace(@strPhotoDate,'th','')
SET @Date = replace(@strPhotoDate,'nd','')
SET @Date = replace(@strPhotoDate,'rd','')
SET @Date = replace(@strPhotoDate,'st','')
SET @Date = replace(@strPhotoDate,',','')
set @Date1 = CONVERT(datetime, @Date)
--cast(@GetPhotoDate as DATETIME)
END
END
like that...
thanks in advance
Thanks
Subbu.
|
|
|
|
|
hi paul...
thank u for ur response .but i found answer for every formate....
but i need to convert dates like o4 th july 2005 or
3rd august 1997
31st december 2000
22nd july 1997....i.e th,nd,rd,....
to default formate..... 04/07/2005,
03/08/1997
helpe with a function.....
i am trying this ,but it convert without th,rd,nd,...
if not (@Date IS NULL)
BEGIN
SET @Date = LEFT(@strPhotoDate,patindex('%|%',@strPhotoDate )-1)
SET @Date = replace(@strPhotoDate,'th','')
SET @Date = replace(@strPhotoDate,'nd','')
SET @Date = replace(@strPhotoDate,'rd','')
SET @Date = replace(@strPhotoDate,'st','')
SET @Date = replace(@strPhotoDate,',','')
set @Date1 = CONVERT(datetime, @Date)
--cast(@Date1 as DATETIME)
END
END
like that...
thanks in advance
Thanks
Subbu.
|
|
|
|
|
If you are converting these dates for display purposes, you are much better to do it in your UI code.
|
|
|
|
|
Hi there,
I want to know if there is an executing speed difference between a View and a Table-Valued function.
Tnanks!
Regards,
Werries
A programmer's life is good... or is it?? Ek dink nie so nie!
|
|
|
|
|
The simple answer is yes, there are performance differences, but it all depends on what you are trying to acheive. Without further details I cannot say more. The best way to find out id to try it.
Bob
Ashfield Consultants Ltd
|
|
|
|
|
Hi Friends,
Let me Show u my table first and explain the problem later
CategoryID CategoryName
1 MSDN
2 Google
3 Project
4 Code
5 Google
6 Project
7 MSDN
8 Google
9 Google
10 MSDN
11 Project
12 Project
Now i need the top 2 categorynames from categorynames.
I need the result as below
CategoryID CategoryName
1 MSDN
7 MSDN
2 Google
5 Google
3 Project
6 Project
4 Code
Please some one help me in getting this Query............
Thanks in Advance
<b></b>
|
|
|
|
|
Top 2 on what basis? What is the rule to define which way the records are sorted?
|
|
|
|
|
Top2 based on each categoryname..........
|
|
|
|
|
Then the result you have shown does not match the data in the table.
|
|
|
|
|
I m facing a problem in this query
select a.eventid,b.name,convert(nvarchar,c.assigndate,106)as assigndate,<br />
convert(nvarchar,a.eventdate,106)as eventdate,a.event,a.details,a.eventtype from event as a left outer join emp <br />
as c on a.eventid=c.eventid left outer join user_info as b on b.userid=c.userid <br />
where(a.eventtype='Single Month' or(a.eventtype='All Month' and <br />
(select substring(convert(nvarchar,edate,102),9,4) from event where eventtype='All Month')>( select substring(convert(nvarchar,getdate(),102),9,4)) ))order by a.eventdateselect * from event<br />
<br />
In event table there are some fields like eventid,eventdate,eventtype n etc
In user_info there are userid, name n etc fields
i wanna get all record when
1> eventtype is Single Month and the eventdate is in current month n eventdate is heigher than currentdate
2> eventype is All Month and eventdate is heigher than current date
eventid -----eventdate ------- eventtype
1 -----2008-04-15 00:00:00 ----- All Month
2 -----2008-04-20 00:00:00 ----- Single Month
3 -----2008-04-16 00:00:00 ----- Single Month
4 -----2008-04-16 00:00:00 ----- All Month
The answer shd be eventid 2,3,4
The Great Pleasure In Doing That Things That Other People Say U Can't By Doing This U Can Shut Their Mouth
|
|
|
|
|
Try this
select a.eventid,b.name,convert(nvarchar,c.assigndate,106)as assigndate,<br />
convert(nvarchar,a.eventdate,106)as eventdate,a.event,a.details,a.eventtype from event as a left outer join emp <br />
as c on a.eventid=c.eventid left outer join user_info as b on b.userid=c.userid <br />
WHERE a.eventdate > getdate()<br />
AND (<br />
(a.eventtype = 'Single Month' and left(convert(varchar,getdate(),102),7) = left(convert(varchar,edate,102),7))<br />
OR (a.eventtype = 'All Month')<br />
)
Bob
Ashfield Consultants Ltd
|
|
|
|
|
Hi All,
I need to query the DB2 database tables and populate the Excel work sheets (one sheet for single table) using VB Macro.
Also, I need the validation in the Excel sheet itself. (DB2 database credetials)
Can you pls help me to get start?
Thanks,
Jeyakumar
Jey
modified on Wednesday, April 16, 2008 6:11 AM
|
|
|
|
|
Jay_se wrote: I need to query the DB2 database tables and populate the Excel work sheets (one sheet for single table) using VB Macro.
Also, I need the validation in the Excel sheet itself. (DB2 database credetials)
I believe Excel VBA does ADO, so you should be able to connect to the DB2 database and do your stuff. For connection information, look up www.connectionstrings.com[^].
|
|
|
|
|