Cheers for the above but the id column is not a ID column as one would expect. I have had a look at the numbers and they are not even incrementing at some stages, which I do not understand any ideas?
What would best approach to change this column to a genuine id column?
Hi All
I have created a sp in sql 2005 and from my table variable I am inserting into a live table and the last column in the live table is a colum labelled id data type: int. The values in this are incrementing by 1, I need to know what to put in my insert statement that will populate the live...
Hi All
Iam new to sql and have been looking into data types. Please can someone tell me in plain english the pro's and cons of Storage size (bytes) or how they work related to data types.
Many Thanks in advance
Hi All
thanks for the posts and yes it was a typo on my behalf, it suppose to be a comma.
The thing that still bothers me is that, my field originalno is a varchar in an non sequential format, so I need to extract these records but like I said I dont want to be putting ',' comma for 2000...
But I still need to put comers at the end of each originalno. and I have around 200 records hence the reason Iam looking for a more effective syntax or way.
Hi All
I have need to know of an effective way to delete 2000 records from a table holding 4000 records. Their is a unique key ie. originalno. which identifies each record and also I have the originalno. of all the records that need to be deleted.
But what syntax do I use to make this quick...
This is my final select statement into my a db table
insert into testtable
select
case when PurposeCode = 'current'
then 'CODA' else 'FIRE' end,
case when PurposeCode = 'current'
then 'CODA' else 'FIRE' end,
null,
(select (processyear * 100) + processqtr from Report_Rates
where (processyear...
Hi All
I have complied a SP in sql 2005, iam using a table variable to manipulate the data, in my final insert which is directing the data to inserted into a db table, it is coming back with the following error msg :-
Msg 512, Level 16, State 1, Line 51
Subquery returned more than 1 value...
Hi All
Iam new to SQL espcially sql 2005, I have a select statement where Iam selecting to fields from a table and then at the same same adding the 2 fields to and outputting as a new column denoted with a t.
I want to refine the select by the new the results that have been generated ie...
Hi All
Iam working with sql 2005 and have a table sitting on a different server and db. I want to copy the table structure and data across to another server, how do I do this?
Many Thanks
Thanks for that Dennis, my next problem is that my SP has information coming in from different tables which sit on different servers. How do I reference a server before a table.dbo.field and also does this mean I got to create a link server?
Hi All
Iam new to SQL SPs and have created a SP which starts off with a declare statement referencing a table variable.
In the SP their are are various select and insert statements which manipulates the data and finally the data is inserted in a table.
However I want to test an section of the...
Hi All
I am trying to multiply the following
select process_yr
from tbl_report
where (process_yr*4)
and its not working....some can some one tell me what Iam doing wrong...
Many Thanks
Hi All
Iam new to sql and stored procedures.....
In a sp iam looking at a select statement has 'er' in it, what does do and mean?
eg.
from fin_datawh.dbo.tbl_Report_Exc_Rate er where rate_type_code like 'syse%'
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.