SEARCH YOUR SOLUTION HERE  

store carriage return with text in table

Originally posted by : wk (skrecycle@rediffmail.com)
,
anybody knows the best menthod to store 2-3 paragraphs of text in SQL database How do i store the carriage return (enter) with the text

thanx!

Posted On: Tuesday 20th of November 2012 12:10:37 AM Total Views:  117
View Complete with Replies




Related Messages:

How to create an array in a paramater in sql stored procedure   (100 Views)
I am creating a stored procedure that asks the user for a list of customer segmentations(ie. G, P, S). How can I create a paramater that will allow multiple values(like an array) I want to use the logical operator IN(), but is won't work with a list. Here's part of my stored procedure: @MONTH CHAR(2), @YEAR CHAR(4), @cseg - How do I handle this
ASP stored procedure   (252 Views)
I want to pass a simple parameter into an oracle stored procedure and then view a single output. The code [code] [code] Please help I can't figure out what it is I am doing wrong
how to store the returned recordset in text file   (159 Views)
hi, The following code is not working. I want to store the returned recordset in text file. please give the solution. declare @str varchar(2000) declare @sqlpath varchar(50) SET @sqlpath = REPLACE('c:\shared\Backup_Status1_'+CONVERT(char(8 ),GETDATE(),1)+'.txt','/','-') set @str='osql -E -w 1000 -o ''''+@sqlpath+'''' -Q "select * from master.dbo.sysdatabases "' EXEC master..xp_cmdshell @str
sql datatypes for stored procedures   (71 Views)
Originally posted by : Drew (dfrank@san.rr.com)I want to create a stored procedure to inesrt text into a field of my MS Access 2000 database. I created the field as Memo type in access since that is supposed to be able to contain up to 65000 characters. In my stored procedure, however, i don't know what datatype to make the paramater that I am going to to insert into that field. I tried Text, and it threw an error if i tried over 256 characters. I also tried varchar(20000), and that allowed me to enter somewhere around 800 characters without throwing an error. What is the correct data type to use to support 10000 or so characters
Join these 2 views and make one stored procedure   (66 Views)
i have made 2 views and concted them and my query is working find, but i want to make a 1 stored procedure from these 2 views ... View 1 SELECT dbo.page_information.page_id FROM dbo.user_pages INNER JOIN dbo.page_information ON dbo.user_pages.page_id = dbo.page_information.page_id WHERE (dbo.user_pages.e_id = 32) View 2 SELECT dbo.page_information.page_id AS Expr1 FROM dbo.VIEW1 RIGHT OUTER JOIN dbo.page_information ON dbo.VIEW1.page_id = dbo.page_information.page_id WHERE (dbo.VIEW1.page_id IS NULL) Please can u hlp me out
Please help with wrong datatype of stored procedure!   (104 Views)
Hi all, Instead of writing the SQL statements in the ASP codes, I need to use stored procedures. I've got 2 variables (user, pass) to store the login name and password from the textboxes. When I run it, it gives me this error: ADODB.Parameter (0x800A0D5D) Application uses a value of the wrong type for the current operation. Is it some sort of wrong datatype thing login_name and login_password are both nvarchar. what have I done wrong it works perfectly before i do the stored procedure! Please help me it's really doing my head in! My original SQL statement: SQL = "SELECT * FROM users where login_password ='"&pass&"' and upper(login_name) =upper('"&user&"')" I created the stored procedure in SQL server: CREATE PROCEDURE sp_LOGIN (@pass nvarchar, @user nvarchar) AS SELECT * FROM users where login_password = @pass and login_name = @user and in my codes I used this: Set cmdStoredProc = Server.CreateObject("ADODB.Command") cmdStoredProc.ActiveConnection = conn cmdStoredProc.CommandText = "sp_LOGIN" cmdStoredProc.CommandType = adCmdStoredProc Set paramId = cmdStoredProc.CreateParameter("@user", adInteger, adParamInput) paramId.Value = user cmdStoredProc.Parameters.Append paramId Set rs = cmdStoredProc.Execute
stored Procedure   (256 Views)
Does anyone see anything wrong with this statement, I keep getting an Incorrect Syntax message must declare the variable Code: CREATE PROCEDURE [insert_Corovan_Table_1] @pdBegin DATETIME = TerminationDate (BETWEEN CONVERT(DATETIME, '2003-01-01 00:00:00', 102) AND CONVERT(DATETIME, '2003-12-31 00:00:00', 102)) @pdEnd DATETIME= NULL AS IF @pdBegin IS NULL SET @pdBegin = DateAdd(year, -2, GetDate()) IF @pdEnd IS NULL SET @pdEnd = DateAdd(year, 1,@pdBegin) AS INSERT INTO [GamingCommissiondb].[dbo].[Corovan_Table] ( [TM #], [FirstName], [LastName], [SS #], [TerminationDate], [Voluntary or Involuntary], [Notes]) SELECT ([TM#], [FirstName], [LastName], [SS #], [TerminationDate], [Voluntary_or_Involuntary], [Notes],) FROM TERMINATION GO
paging with stored procedures with parameters   (122 Views)
Originally posted by : Oliver (oliver@idea-uk.com)How do you use recordset paging if you are using a stored procedure that has parameters.ADO recordsets don't use paramteter so I am using the command object to pass in the paramters.The paging code works if there are no input paramsbut if they are it will not pass the params through the spCan anyone help
errors and stored procedures   (187 Views)
Originally posted by : Gulliver (gulliver@vi.is)Hi I am working with stored procedures a lot. Some of the storedprocedures are usingother stored procedures. When an error occure I want the name of the procedure that caused the errorto be returned with the line number where the error occured. Is this possible in SQL-Server Thank youGulliver
SQL stored procedure Loop Help   (127 Views)
, I have the following statements: CREATE TABLE CVPGFIDAYCOUNT6IMPORT AS (SELECT * FROM CMAMASTERIMPORT WHERE GFIDAYCOUNT =(SELECT DAYCOUNTLIST FROM CVPDAYCOUNTLIST WHERE TWENTYDAYCOUNT='3')); CREATE TABLE CVPGFIDAYCOUNT5IMPORT AS (SELECT * FROM CMAMASTERIMPORT WHERE GFIDAYCOUNT =(SELECT DAYCOUNTLIST FROM CVPDAYCOUNTLIST WHERE TWENTYDAYCOUNT='2')); CREATE TABLE CVPGFIDAYCOUNT4IMPORT AS (SELECT * FROM CMAMASTERIMPORT WHERE GFIDAYCOUNT =(SELECT DAYCOUNTLIST FROM CVPDAYCOUNTLIST WHERE TWENTYDAYCOUNT='1')); CREATE TABLE CVPGFIDAYCOUNT3IMPORT AS (SELECT * FROM CMAMASTERIMPORT WHERE GFIDAYCOUNT =(SELECT DAYCOUNTLIST FROM CVPDAYCOUNTLIST WHERE TWENTYDAYCOUNT='0')); I am trying to make the above more efficient. I am trying to apply a stored procedue statemnt(necessary) which can list one set of the above, and decrement the tables 'CVPGFIDAYCOUNTnnIMPORT' from 6 to 3, as well as TWENTYDAYCOUNT='n' from 3 down to 0. I have attempted the following declare @counter1 int set @counter1 = 6 while @counter1 > 3 begin set @counter = @counter1 - 1 declare @counter2 int set @counter2 = 3 while @counter2 > 0 begin set @counter2 = @counter2 - 1 CREATE TABLE CVPGFIDAYCOUNT&"counter1"&IMPORT AS (SELECT * FROM CMAMASTERIMPORT WHERE GFIDAYCOUNT =(SELECT DAYCOUNTLIST FROM CVPDAYCOUNTLIST WHERE TWENTYDAYCOUNT='"counter2"')); end end could someone please help!!!
HELP! ADO won't return my stored procedure's return values   (123 Views)
Originally posted by : Brad (BTorchin@aol.com)Environment: InterDEV 6.0 / MS SQLServer v7.0 / IIS 4.0I am trying to return a status code from a stored proc, but all I get are empty values (RETURN_VALUE and @Err are blank). The SP returns the values when called from another stored proc, so I know the problem is either my ADO code, some environment issue, or perhaps just bad karma. What am I doing wrongI tried different ways to return values from the stored proc using. I tried ordinals and explicitly naming parameters, either way the values returned were empty. The code below displayed blank values.--------------------ASP Code:Set conn = Server.CreateObject("ADODB.Connection")conn.ConnectionTimeout = Application("Arp_ConnectionTimeout")conn.CommandTimeout = Application("Arp_CommandTimeout")conn.Open Application("Arp_ConnectionString"), _Application("Arp_RuntimeUserName"), _Application("Arp_RuntimePassword")Set cmd = Server.CreateObject("ADODB.Command")cmd.CommandText = "dbo.DeleteCheck"cmd.CommandType = adCmdStoredProccmd.ActiveConnection = connset mParm = cmd.CreateParameter("RETURN_VALUE", adInteger ,adParamReturnValue)cmd.Parameters.Append mParmset mParm = cmd.CreateParameter("@CheckNo", adChar,adParamInput,10,CheckToDelete)cmd.Parameters.Append mParmset mParm = cmd.CreateParameter("@Outval", adInteger,adParamOutput)cmd.Parameters.Append mParmSet rs = Server.CreateObject ("ADODB.Recordset")Set rs = cmd.ExecuteResponse.Write "Parm 0=" & cmd.Parameters(0).Value Response.Write "Parm 2=" & cmd.Parameters(2).Value Response.Write "Parm @Outval=" & cmd.Parameters("@Outval").Value Response.Write "RETURN_VALUE=" & cmd.Parameters("RETURN_VALUE").Value -------------------SQL Codedeclare @rows int, @BatchStatus char(11), @Err intSELECT @Err = 3SELECT Trans.CheckNo, Trans.Amount, Trans.GroupOutID, Trans.IssueDate, GroupOut.BatchOutID, BatchOut.BatchOutStatus, Account.AccountDescFROM Account INNER JOIN GroupOut ON Account.AccountID = GroupOut.AccountID INNER JOIN BatchOut ON GroupOut.BatchOutID = BatchOut.BatchOutID INNER JOIN Trans ON GroupOut.GroupOutID = Trans.GroupOutID WHERE (Trans.CheckNo = @CheckNo) and (BatchOutStatus 'Closed')SELECT @rows = @@rowcountif @rows = 1 beginDELETE Trans WHERE CheckNo = @CheckNo SELECT @Err = 0end elsebegin if @rows < 1SELECT @Err = 1else SELECT @Err = 2end SELECT @Outval = @ErrRETURN @Er
Select stored procedure   (117 Views)
, i'm a beginner using SQL 2005 on a SQL 2003 server. I've created a .Net application that connect to a SQL database. I'm needing to create a select stored procedure to select all data between a date range. My boss tells I need to figure this out on my own and i'm not finding much to my question online. My data type is set now as a varch(50) its for a fiscal year. The user will mostly enter in 05/2008 to 04/2009 or sometime they put in 08 to 09 in that field, that is why I just made it a varch(50). I'm researching on how to create a stored procedure to select all between whats entered into that field. Can anyone give me any suggstions on how I might code something like this Below is what I've started, I appreciate the help. My code may very amateur, but that is why i'm looking help.
Backup on in one database, Restore to another.   (75 Views)
Part 2 of my laptop disaster recovery drama. I've attached my database to my local SQL Server Group, however, what I need to do is overwrite my databse on FastHosts. Now, I have backed up my local database and want to use this to update the FastHost version, which is about a month old. However, I can't seem to restore the database, as I presume you can only restore from backups made by the remote server vesion. () So, how can I get the info from my local database to my remote one! Does that make sense
how to update 2 tables using using stored procedure   (205 Views)
Originally posted by : asiya (asiya@talk21.com)hi and help me plsi am trying to insert data into 2 tables from an asp page using sql stored procedure, the problem am having is, i want to set the first table primary key as a foreign key in the second tablecan you help me pl
How do i load images stored in a access database?   (178 Views)
Originally posted by : Luciano (luciano@asas.net)What do i have to do to load an image stored in an OLE field in a access DB to show it in an asp document
IN predicate & passing input parm to its stored proc.   (130 Views)
Originally posted by : B. Bora Bali (bora@sprynet.com)Hi folks,I have a query like the following one. This is going to be placed in a stored procedure. I want to pass an input parameter, that is determined in an ASP script, to the IN predicate of the stored procedure's query statement: SELECT text FROM table WHERE id IN (k_1, k_2, k_3, ..., k_n)I want to pass the set of k_x as an input parm to the proc. (Is this possible) Note: id is an integer. If possible, how would the stored procedure for this query look like I really appreciate your inputs.(I am running MS SQL Server Version 6.5)-B. Bora Bali
Execute 1 stored procedure from another   (120 Views)
Just general question and some advice, can i execute one stored procedure from another and in order to get the results from it, and then do a count on these results. I was thinking of having the results put into the temp table and then doing a count on this temp table. Would that work
Call one stored procedure into another.   (113 Views)
Ok i have one stored procedure which generates a table of data. However i now need to do a count on some of the data and also need to find min value as well. I decided to call this stored proecure into another one and do the count and min calls from here as wasnt sure how to do it in the main query. I have managed to call the stored procedure and create a temp table for my new data, however i dont know how to populate the new table with values from the called stored procedure. I know i need to delcare them like i have done and then give them a value using the select, or i think i do, but then not sure how to actually get the value into the select. Does anyone know how to do this or even what i am going on about!!!!!! This is what i have so far Code: ALTER PROCEDURE sp_EngineerTimeslotsScheduleCount @STARTDATE DATETIME, @CONTRACT VARCHAR(3), @ENGINEER VARCHAR(20) AS DECLARE @BookedFromTime DATETIME DECLARE @BookedToTime DATETIME DECLARE @AMAppointments INT DECLARE @PMAppointments INT Select @BookedFromTime = '18/dec/2007' Select @BookedToTime = '18/dec/2007' Select @AMAppointments = '3' Select @PMAppointments = '5' EXEC sp_EngineerTimeslotsSchedule @STARTDATE, @CONTRACT, @ENGINEER CREATE TABLE #TempSchedule (TempAMTime Datetime, TempPMTime Datetime, TempAMSlots Int, TempPMSlots Int) INSERT #TempSchedule (TempAMTime, TempPMTime, TempAMSlots, TempPMSlots) VALUES (@BookedFromTime, @BookedToTime, @AMAppointments, @PMAppointments) SELECT * FROM #TempSchedule
Help with stored procedures in sql 2000   (147 Views)
HI , I was hoping someone would be able to help me with some thing. I am learning ASP.NEt v 2.0 and am using SQL server 2000 developerd edition to build an exommerce website using the Apress booking Beginning E-Commerce in C# 2005. I have been managing fine up to now but the book is building stored procedures for retrieving products lists from the database. The book is written for SQL 2005 express edition but says that with some extra woork there is no problems with getting the code to work in 2000. I have two procedures that implement paging which the book says doesn't work in sql 2000 and gives a very brief solution which doesn't make sense to me. Would anybody be able to help me convert these so i can use them in sql 2000 I get the rough idea but am having problems re-writing this and I am now holding my hands and admitting defeat. The procedures are as follows: Code: CREATE PROCEDURE GetProductsOnDepartmentPromotion (@DepartmentID INT, @DescriptionLength INT, @PageNumber INT, @ProductsPerPage INT, @HowManyProducts INT OUTPUT) AS -- declare a new TABLE variable DECLARE @Products TABLE (RowNumber INT, ProductID INT, Name VARCHAR(50), Description VARCHAR(5000), Price MONEY, Image1FileName VARCHAR(50), Image2FileName VARCHAR(50), OnDepartmentPromotion BIT, OnCatalogPromotion BIT) -- populate the table variable with the complete list of products INSERT INTO @Products SELECT ROW_NUMBER() OVER (ORDER BY ProductID) AS Row, ProductID, Name, SUBSTRING(Description, 1, @DescriptionLength) + '...' AS Description, Price, Image1FileName, Image2FileName, OnDepartmentPromotion, OnCatalogPromotion FROM (SELECT DISTINCT Product.ProductID, Product.Name, SUBSTRING(Product.Description, 1, @DescriptionLength) + '...' AS Description, Price, Image1FileName, Image2FileName, OnDepartmentPromotion, OnCatalogPromotion FROM Product INNER JOIN ProductCategory ON Product.ProductID = ProductCategory.ProductID INNER JOIN Category ON ProductCategory.CategoryID = Category.CategoryID WHERE Product.OnDepartmentPromotion = 1 AND Category.DepartmentID = @DepartmentID ) AS ProductOnDepPr -- return the total number of products using an OUTPUT variable SELECT @HowManyProducts = COUNT(ProductID) FROM @Products -- extract the requested page of products SELECT ProductID, Name, Description, Price, Image1FileName, Image2FileName, OnDepartmentPromotion, OnCatalogPromotion FROM @Products WHERE RowNumber > (@PageNumber - 1) * @ProductsPerPage AND RowNumber (@PageNumber - 1) * @ProductsPerPage AND RowNumber (@PageNumber - 1) * @ProductsPerPage AND RowNumber
insert stored procedure values in a table   (138 Views)
hi i have a stored procedure which is selecting a table from a linked server which is in my sql server database. the linked server is linked to an oracle database... my stored procedure is below as follows: Code: CREATE PROCEDURE sp_OracleStudentTbl AS SELECT * FROM OPENQUERY(XXXXXX, 'SELECT * FROM vw_student_details_forsurvey') GO it works fine .. when i try it in query analyzer. meaning it retrieves back results... i would like too insert this view into a table. which i have in my database where my stored procedure is . meaning i would like to create a table everytime i run this stored procedure and insert the data it has in it into a the table i am creating... the table will only be created twice a year.. so it will not be happening constantly....