Special Thancks To Brett, Blindman And All The Others !
Jun 18, 2004
Just a few words to thanck some of the people
who connect each days to help others solve their problems.
I've finished migrating my programs to SQL Server
and it's been quite easier and quicker than I first tought
mainly because there are some
competent-intelligent-helpful-(funny) members on this forum.
So thank you all, thank you BK and BM
Caroline from France
View 10 Replies
ADVERTISEMENT
Jun 16, 2004
I posted a question yesterday about text field compare and I can't open the thread. Not sure why. Can you repost your reply to this thread regarding how to compare two text strings (i.e. two company names)? Much appreciated.
View 3 Replies
View Related
Jan 13, 2006
I found that an incredibly helpful place to vague posters too? Must be the new sherrif.
View 3 Replies
View Related
May 5, 2006
Hey it's not often the blindman asks for advice on sql coding (never, I think), so here is an opportunity to solve a problem I've been knocking my head against for two days.
Here is sample code for setting up the problem:create table #blindman
(pkey smallint primary key,
fkey char(1),
updateddatetime)
insert into #blindman (pkey, fkey, updated)
select1, 'A', '1/1/2006'
UNION
select2, 'B', '1/1/2006'
UNION
select3, 'A', '1/2/2006'
UNION
select4, 'B', '1/2/2006'
UNION
select5, 'A', '1/4/2006'
UNION
select6, 'B', '1/2/2006'
UNION
select7, 'A', '1/3/2006'
UNION
select8, 'B', '1/3/2006'
UNION
select9, 'A', '1/5/2006'
UNION
select10, 'B', '1/5/2006'
drop table #blindman
Notice that for fkey 'B', there are two entries with '1/2/2006', and for fkey 'A' the updated values are not in synch with the order of the primary key.
The challenge: determine the next pkey for each pkey value, ordered by [updated], and using pkey as a tie-breaker when two records have the same [updated] value.
Here is the desired output for the sample data:pkey fkey updated nextpkey
------ ---- ---------- --------
1 A 2006-01-01 3
3 A 2006-01-02 7
7 A 2006-01-03 5
5 A 2006-01-04 9
2 B 2006-01-01 4
4 B 2006-01-02 6
6 B 2006-01-02 8
8 B 2006-01-03 10
Records 9 and 10 are missing because they have not succeeding records, though I'd be just has satisfied to include them with NULL as their nextpkey value.
Ideally, I want this as a VIEW.
Who's up for the challenge?
View 14 Replies
View Related
Apr 25, 2007
Last year user X002548 assisted output to txt file
http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=68461&SearchTerms=create,file
where he used a BCP shell script to pass outfile specs.
I'm using SQL query writer ODBCview and would like to view the data before loading it into a file, but I'm getting a ?crunch? error.
In other languages you can :
set linesize X (518, in my case)
set space 0
set newpage 0
set pagesize 0
set heading off etc for a clean flat file load.
I'm getting errors using the set command; I think it may be a SQL/Plus function, not native to SQL.
Are there similar functions for setting page specs? Thank you guys so
very much. I'm a noob (4 days old at this now!) and am in awe of the support you provide.
Lisa
View 5 Replies
View Related
Nov 17, 2004
I want to thank Brett Kaiser and Pat Phelan for advising me to get the "The Guru's Guide to Transcact-SQL" HOLY MOLY what an awesome book and the software that comes with it is so awesome "Sequin". This book is better then any of the Microsoft books, it breaks it all down for you and doesnt make it too difficult to understand I stayed up late last night reading this book. (which is why I'm exhausted today). This is by far the best Transact-SQL book I have ever come across.
THANKS GUYS :):):)
View 8 Replies
View Related
Dec 8, 2005
Hi,
i have the following problem:
I like to extract all special characters in one table with many fields.
How can I handle this without using 'replace' for each field and many characters ?
Thx. for ur suggestions.
dajm
View 2 Replies
View Related
Jan 16, 2006
Hi All
I have a database I want to check whether any special characters are entered or not
E.g.
Post
-------
Director
Asst*Director
Ma^nager
I want to see all the entires where special characters like !@#$%^&*()_+ are entered
Plz help
Thanks
View 8 Replies
View Related
Mar 10, 2008
Hi,
I an concatenating a string using char(187) as the separator. When I run the command "select char(187)" I get the symbol >>
However, when it writes to a csv file it is showing as an overscore instead.
Is there a known problem with special characters when writing to files?
View 2 Replies
View Related
Jul 20, 2005
How can I insert by asp a string containing 'That's the stringAsp code:SQL = "insert into tablename (columnA) values ('" & variable & "')"The problem is when variable contains a ' (single quote), it stops thestring definition and get an error.Can I do something?Thanks--Posted via Mailgate.ORG Server - http://www.Mailgate.ORG
View 2 Replies
View Related
Apr 2, 2008
Our SQL 2005 databases have "SQL_Latin1_General_CP1_CI_AS"
collation settings on the server. One of tables has one column declared as "ntext".
When we try to insert "‚¬" character directly trough insert statement and retrieve it, we're getting right results. When we use web-services to insert data with this character (euro), and retrieving the data back, we're not getting this sign back. We are getting some characters like little squares. If I try to copy and paste them into notepad, I am getting ???
However, when I tried to place them here, I got them right:
‚¬ Å Å¡ Ž ž Å’ Å“ Ÿ
How can we assure visually they are inserted properly?
View 1 Replies
View Related
Sep 2, 2007
I have the following:
Demograph Table (PK MemberID)
-MemberID
-FirstName
-LastName
InsuranceSegments Table (PK = all columns combined)
-MemberID
-ProgramCode
-StatusCode
-BeginDate
-EndDate
I need to get the data into this table (i'll call the table MyTest)
-MemberID
-FirstName
-LastName
-BeginDate
-EndDate
-ProgramCode
-StatusCode
The catch:
For each record in the demograph table I need only one segment and that segment is to be based on the greatest EndDate.
What I need:
Give me the last segment for each demograph record and put each into it table MyTest
In my pseodo thinking
INSERT INTO MyTest (MemberID, FirstName, LastName, BeginDate, EndDate, ProgramCode, StatusCode)
SELECT
Demograph.MemberID, Demograph.FirstName, Demograph.LastName,
InsuranceSegments.BeginDate, InsuranceSegments.EndDate, InsuranceSegments.ProgramCode, InsuranceSegments.StatusCode
FROM
Demograph
INNER JOIN
InsuranceSegments
ON
Demograph.MemberID = InsuranceSegments.MemberID
WHERE { Need help :-) }
Need help with the where clause to get the segment with the 'highest/latest' EndDate
Sorry for the wall of text. I hope this is enough information to receive help and would like to thank you in advance for your time :-)
J
View 7 Replies
View Related
Feb 7, 2008
Hi everybody,
I need to write a special count on my table and I don't have idea how to do it.
I have an Audit table like that:
EventTime (DateTimeColumn) - Description (varchar) - UserID
----------------------------------------------------------------
2008-01-28 08:47:19 blabla User 12008-01-28 08:49:04 blabla User 1
2008-01-28 08:51:52 blabla User 2
2008-01-28 08:56:38 blabla User 3
2008-01-28 11:20:03 blabla User 2
2008-01-28 11:59:57 blabla User 32008-01-28 12:00:07 blabla User 32008-01-28 12:00:16 blabla User 32008-01-28 14:52:31 blabla User 32008-01-28 14:52:34 blabla User 4
2008-01-28 15:15:43 blabla User 4
I need to count the number of record for each user (on the datetime) BUT if there are x records in the same minute, I want to count it only one time.
Exemple: the user 1 and the user 3
For the user 1, the result should be 1 because there are 2 records for him, but 2 in the same minute.
For the user 3, the result should be 3 because there are 4 records for him, but 3 in the same minute.
I have any idea about the way to do it.
Your council are welcom ;o)
Thanks in advance
Jerome
View 6 Replies
View Related
Aug 29, 2006
Hello,
I am starting to use SQL Server 2005. I am having trouble connecting remotely. I tried to enable the 'sa' user and got this error:
Cannot use the special principal 'sa'
Is the 'sa' user no longer valid for remote connections?
Thank you
View 11 Replies
View Related
Jan 9, 2008
Ok, here's my issue... SQL 2005.
I have about 12 different databases, which about 4 of them are have no user mapped to it. Under the SA login, databases are mapped to the "dbo". The 4 I am having issues with have no user mapped. They are blank.
Here is where I am at... Security>Logins>sa>Login Properties>User Mapping
The columns are "Map", "Database", "User", and "Default Schema"
Here is an example of the correct Selection
Map=checked, Database=eDistribution, User=dbo, Default Schema=dbo
Now here is an example of a problem database
Map=unchecked, Database=FORMS, User=blank, Default Schema=blank
Here is the error when trying to add the "dbo" as a user
Any ideas?
TITLE: Microsoft SQL Server Management Studio
------------------------------
Create failed for User 'sa'. (Microsoft.SqlServer.Smo)
For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=9.00.1399.00&EvtSrc=Microsoft.SqlServer.Management.Smo.ExceptionTemplates.FailedOperationExceptionText&EvtID=Create+User&LinkId=20476
------------------------------
ADDITIONAL INFORMATION:
An exception occurred while executing a Transact-SQL statement or batch. (Microsoft.SqlServer.ConnectionInfo)
------------------------------
Cannot use the special principal 'sa'. (Microsoft SQL Server, Error: 15405)
For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=09.00.1406&EvtSrc=MSSQLServer&EvtID=15405&LinkId=20476
------------------------------
BUTTONS:
OK
------------------------------
TITLE: Microsoft SQL Server Management Studio
------------------------------
Create failed for User 'dbo'. (Microsoft.SqlServer.Smo)
For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=9.00.1399.00&EvtSrc=Microsoft.SqlServer.Management.Smo.ExceptionTemplates.FailedOperationExceptionText&EvtID=Create+User&LinkId=20476
------------------------------
ADDITIONAL INFORMATION:
An exception occurred while executing a Transact-SQL statement or batch. (Microsoft.SqlServer.ConnectionInfo)
------------------------------
User, group, or role 'dbo' already exists in the current database. (Microsoft SQL Server, Error: 15023)
For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=09.00.1406&EvtSrc=MSSQLServer&EvtID=15023&LinkId=20476
------------------------------
BUTTONS:
OK
------------------------------
View 1 Replies
View Related
Mar 1, 2007
Im starting a project that will be used to reserve rooms in a building. My problem right now is writing an sql statement that will return a dataset with the proper results. I have three tables setup below. I need a dataset that returns rooms that are closed on a certain date and a set that returns open rooms on a particular date.I cant seem to figure out that sql statement... Any suggestions will be greatly appreciated. tblRooms pkRoomID fkReservationID tblDates pkDateID fkReservationID tblReservation pkReservationID fkRoomID fkDateID
View 3 Replies
View Related
Apr 18, 2007
On the bills that our system generates there is a comments field that users fillout. We have occasional problems with special characters in the text messing up the validation code. Does anyone know of a query that can identify special characters in a text field? Like carriage returns, tabs, etc.?
Thanks, Dave
View 1 Replies
View Related
Aug 29, 2007
The following SELECT query gives me a list of 50 plus countries. How do I order them by 'United States' First (happens to be ID 225) and then alphabetical?
SELECT Country_ID, Country_Long FROM Countries WHERE isIndustrial = 1 ORDER BY Country_Long
View 6 Replies
View Related
Feb 7, 2005
how do i remove
in all of my fields in the table ? using a TSQL command ?
"DesktopModules/Events/Events.ascx
"
thanx !!
View 1 Replies
View Related
Dec 7, 2000
I made a stored proc for update fields in a table everything is correct but when my new field contains a special caracter like *,/,[, ' , and a space too i have an error. I wrote it and i don't understand why it doesn't work.
CREATE PROCEDURE [sp_modif](@ID varchar(100),
@Table varchar(100),
@NewId varchar(100),
@CUSTOMER varchar(100),
@NewCUSTOMER nvarchar(255))
DECLARE @Commandvarchar(8000)
SELECT @Command = "UPDATE "+@Table+" SET ["+@CUSTOMER+"] = '"+@NewCUSTOMER+"' where ID like "+@NewId
execute (@Command)
Thank you
View 1 Replies
View Related
Jul 6, 2000
Iam working on sql server 7.0.
I have to bring in data from a text file into the sql server database. I use the BCP utility in pulling the data.
The flat file data contains special characters like ®. This is the registered trade mark symbol. When I bcp the file using the character mode the special characters are automatically changed to «. So If I am going to pull a data like ACRYLON®, after the BCP I get it as ACRYLON«.
Inorder to replace all these I have written a program but since it has to scan every record the time taken is more. Will in be possible to accomodate iun the BCP to pull the data with special characters.
If you have an answer to this please reply soon.
Thanks,
-Rajesh
View 2 Replies
View Related
Mar 6, 2001
Hi !
I have an DB in SQL Server 7, and in Portuguese we have special characters like "á","õ",etc. And I want to let the visitor to a site to do a search (written in ASP), and not to need to write the correct way (without the accents). But either he writes or not in the correct way, the results are the same, not necessarly in the same order. Is there a SQL Server mechanism that permits this functionality, without doing a very complicated SELECT (takes a lot of time) or replicating a field in the DB (takes a lot of extra space)...
Thanks !
Filipe Lopes, Lisbon, Portugal.
View 2 Replies
View Related
Apr 13, 2003
I have a problem inserting German special chracters into a MSSql table.
üöäÖ works fine, but ßÜÄ are reduced to "_". I'm using a html form and a php script to enter the data into the database. Any idea why this isn't working? Funny thing is, when I use a german version of the SQL Server it also works without a problem... but I need this to work on ANY mssql server. Any help would be very much appreciated.
Michael
View 6 Replies
View Related
Oct 6, 2004
I had to update pricelist at local-db on the basis of prices in another SQL by matching the description. When i JOIN the tables, no record gets displayed, but the descrptions at both tables were exactly the same i believed. Took a lot of time in identifying the discrepancy; the data was like this:
CREATE TABLE #ABC (price money, DESCRIPTION VARCHAR(200))
GO
INSERT #ABC SELECT 19999,'SQL2000
'
GO
SELECT * FROM #ABC WHERE DESCRIPTION ='SQL2000'
--(0 row(s) affected)
SELECT * FROM #ABC WHERE LTRIM(RTRIM(DESCRIPTION))='SQL2000'
--(0 row(s) affected)
select * from #ABC WHERE REPLACE(DESCRIPTION,'
','')='SQL2000'
--(1 row(s) affected)
GO
DROP TABLE #ABC
:rolleyes: I believe, ENTER has some value within a field.
View 14 Replies
View Related
Feb 3, 2006
I'm trying to remove the special character ÿ from a varchar
select replace(my_col,'ÿ',' ')
this works, but the problem is that it also seems to replace the 'normal' y
(Database is case sensitive)
Why is that?
View 3 Replies
View Related
Mar 3, 2006
shailendra writes "Hi,everbody
lets come to my problem.I have one variable of type "ntext" which contain character "". i want to remove it or replace it with a blank character.
very urgent.....
waiting for the reply
shail"
View 1 Replies
View Related
Jan 2, 2007
Hi, I'm new here. Happy new year!
Simple question. I can not insert special characters such as ' " ( ) etc. What special escape I need to put in my sql statement?
View 2 Replies
View Related
Feb 5, 2008
Hi,
I have a problem doing a query in ASP. This is my query:
Dim vardate
vardate = "#" & latestdate & "#"
sSQL1 = "SELECT tbl_size.sizename, tbl_stylesize.sizeid, tbl_stylesize.rate, tbl_stylesize.changedate " & _
"FROM tbl_stylesize " & _
"INNER JOIN tbl_size " & _
"ON tbl_stylesize.sizeid = tbl_size.sizeid " & _
"WHERE tbl_stylesize.active = -1 " & _
" AND FORMAT (vardate, "mm/dd/yyyy" ) = tbl_stylesize.changedate " & _
" AND tbl_stylesize.styleid = " & arrItem & _
" ORDER BY tbl_size.sizeid"
The problem is the " (ando may be also /)in the FORMAT date. It reconize it like a end of statement. I tryed to write
"" & mm & "/" & dd & "/" & yyyy & """ or
Chr(34) & mm/dd/yyyy & Chr(34)
but anything is working.
Can you please help me?
Best Regards,
Tom
View 8 Replies
View Related
Mar 7, 2006
Hi,I have a MSSQL Server communicating with an Oracle database through aMSSQL linked server using a MS ODBC connection.If I query the Oracle database through the Oracle ODBC 32Bit Test, theresult is fine:select addrsurname from address where addrnr = 6666;HÅKANSSONIf I do the same query within the SQL Query Analyzer (using the linkedserver), I get:select * from openquery(TESTSW, 'select addrsurname from address whereaddrnr = 6666');H?KANSSONI have tried to both check and uncheck the Automatic ANSI to OEMconversion, but the result remains the same.Does anyone know what to do to make the result display the specialcharacters in SQL Query Analyzer?Thanks,Kenneth
View 4 Replies
View Related
Jul 20, 2005
Hi,This is a generic question, but for arguement's sake, let's say, myenvironment is SQL Server 2000.It seems that setting quoted_identifier off is the best way toaccomodate all sort of data input/update especially for data set thatcontains special characters like single quote as in O'Brien, otherfunky stuff like %^$*@#(!).However, this option won't help with a situation like data value of5'9",and let's say, we really can't predicate if this type of value will beused for ColA or ColB or ColC ...Examplecreate table #tmp (col1 varchar(30));set quoted_identifier off;insert into #tmp values("O'Brien's barking dog'");-- successinsert into #tmp values("O'book has funky (%^$*7) stuff");-- successinsert into #tmp values("John said "funky is OK" in his speech");-- failedGlobaly search and replace the double quotes before insert/update isjust too "expensive", not a good option.Now, if we can set a custom quoted_identifier, we can solve the aboveproblem easily, for instance,if MS SQL Server permits/acceptsset quoted_identier = '//$$';theninsert into #tmp values(//$$John said "funky is OK" in hisspeech//$$);(or the like)would succeedAny other thoughts/ideas? Thanks.Quote "Never stop thinking even though at times it may produce waste,which we all do, btw :) "
View 4 Replies
View Related
Jul 20, 2005
Beside its an opensource and supported by community, what's the fundamentaldifferences between PostgreSQL and those high-price commercial database (andsome are bloated such as Oracle) from software giant such as Microsoft SQLServer, Oracle, and Sybase?Is PostgreSQL reliable enough to be used for high-end commercialapplication? Thanks
View 49 Replies
View Related
Jun 14, 2007
Currently I have got a report where I want to insert special characters (like @, !, ?) at the end of a String which will be displayed in a textbox of the report. Wenn I insert the String value "test!?" the report will return this value "!?test".
Does somebody know what is going wrong?
View 1 Replies
View Related
Aug 31, 2007
Good day
I've looked for information about this but to no avail. Essentially why does Reporting Services not support spaces and special characters in a Field Name?
I know that SQL supports spaces utilizing [] brackets e.g. [Field Name With Spaces]. So how come RS doesn't?
Thanks
View 1 Replies
View Related