This is the problem:
I got an "ADD ROW" button and a gridview. Click the "ADD ROW" button and a new gridview row is inserted with the first column as a template textbox. If I type anything in the textbox and then hit "ADD ROW" button, the textbox values are lost. What can I do to retain those...
I want to create web service. I need to call a method and pass any number of parameters. That is, call a method (function) and pass one argument, two arguments up to 200.
I tried to declare the parameters in the web service method as objects and call that method from a client application passing...
Declare @number int
set @number=10
DECLARE @strSQL varchar(1200)
set @strSQL = ' select top ('+ @number + ') account from contact'
EXEC(@strSQL)
The error I get is :
Conversion failed when converting the varchar value ' select top (' to data type int.
Any help would be appreciated
I have an input parameter in a stored procedure "@TicketNumber BigInt". I need to check the length of the parameter. If the length is 18, then all is fine. If the length is 17 then I need to append a '0' to the beginning of the parameter. If the length is 16, then append '00' and so on ... What...
I have an idea how to schedule a job in SQL server 2005. The job will be calling a stroed procedure with few parameters. The values for those parameters come from a table in SQL server and then should be passed to the stored procedure called from the job schedule. Do I need to write a script to...
How would you write a query to combine multiple records into one? for example, my table would have two fields like part number and location. I have multiple records for the same part number. I want to have the same part number with all locations it can be found at in one row(record). I want to...
SET @strSQL = @strSQL + ' WHERE Isdate(Date_Requested) <= ''0'''
The above is not producing the desired result in a sql string but it does in query analyzer.
I'm basically tring to look for dates with a null value.
I got this
SET @strSQL = @strSQL + ' WHERE date_requested>''01/01/1900...
Having errors wheyn writing the quer below in Query Analyzer
Declare @strSQL varchar(1200)
Declare @datestr smalldatetime
set @strSQL= 'select * from table1 where date_field > ''12/12/2004'''
EXEC (strSQL)
The above works just fine. date_field is of type smalldatetime in table1
How I can...
Guys,
I need help with this T-SQL syntax. I can not get it to work. I got a stored procedure that does a simple search.
here it is:
CREATE PROCEDURE [dbo].[usp_Search]
@reqno int ,
@deptno int
AS
SET NOCOUNT ON
DECLARE @strSQL varchar(1200)
DECLARE @check bit
SET @check = 0
SET @strSQL =...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.