473,544 Members | 1,967 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Microsoft SQL Server Forum

Microsoft SQL Server database RDBMS - Ask questions about MSSQL administration, queries, errors, xml, data access, transact-sql, tools, mirroring, integration, setup, stored procedures, merging and more.
14
36,835
thread by: blueboy | last post Mar 21 '07 by: blueboy
Hi, I am planning to automate a nighty restore of a DB on another server can someone point me in the right direction with the SQL script to modify the logical file names to the correct path and not the ones carried over with the DB?? i.e the database is to be renamed on the new server any help much appreciated
5
36,625
thread by: nidaar | last post Jul 31 '08 by: Eric Isaacs
From a security point of view, is accepting wildcards like "%" in input parameters of stored procedures against any best practices? As an example, if a user defined function uses "Productname LIKE @ProductName" in WHERE clause of a select statement, and a stored procedure uses the user defined function while passing @ProductName input...
2
36,542
thread by: TaeMike | last post Sep 10 '08 by: TaeMike
Hello, I have some varchar(2000) fields in my tables, and they have a lot of "weird" characters in them including line break and carriage returns, etc. When I do a select, I see the entire string of characters. When I pull them from a custom program, dts wizard, or just copy them to the clipboard, it truncates some of them. I'm guessing because...
2
36,345
thread by: yoavyoavyoav | last post Apr 2 '11 by: Samrat Gavale
Hi, I'm running a query that displays a list of values. for example the result will be : a b c d
5
36,338
thread by: vinod | last post Jan 21 '08 by: debasisdas
Hi experts, I'm in need to use the rowid of a column. is there any concept like rowid? for example, i need the first row of a table.or 5th row of a table.how can i write the query? thank you verymuch in advance.
2
36,137
thread by: Scarab | last post Nov 28 '05 by: Erland Sommarskog
Hi,all, When I use following sql, an error occurs: insert into #tmprep EXECUTE proc_stat @start,@end There is a "select * from #tmp " in stored procedure proc_stat, and the error message is : Server: Msg 8164, Level 16, State 1, Procedure proc_stat, Line 42 An INSERT EXEC statement cannot be nested.
3
36,075
thread by: Sundaram Muthusamy | last post Jun 18 '07 by: vignessh
how we find the server name using sqlserver2005-Query analyser
2
35,631
thread by: Rico | last post Feb 14 '06 by: Rico
Hello, I'm wondering if there is a way to concatenate two fields or a field and a string value in a single field in a view? Where in Access I might write; & " (m3)" as TotalVolume is there a way to do this in an SQL Server View?
6
35,559
thread by: Mike S | last post Jun 22 '06 by: --CELKO--
Hi all, A (possibly dumb) question, but I've had no luck finding a definitive answer to it. Suppose I have two tables, Employees and Employers, which both have a column named "Id": Employees -Id -FirstName -LastName
6
35,408
thread by: Saiyan Vejita | last post Jul 20 '05 by: Ellen K.
I have the following SELECT query, the results of which I would delete from the table they're pulled from: SELECT A.* FROM SalesOrderPartPrices A WHERE EXISTS( SELECT 'Exists' FROM SalesOrderPartPrices B WHERE (A.SalesOrderNo = B.SalesOrderNo) AND (A.PartNo = B.PartNo) AND (A.UnitPrice = B.UnitPrice) AND
4
35,402
thread by: Tom Frank | last post Jul 20 '05 by: Sheetal Verghese
Hi, Anybody have an idea of copying data from tables of a database to another database. It should be a choice to select all tables, single table or several tables. For them knowing Oracle it is possible to do it with 'exp', where you can choose to script the database with or without data. So I am trying to get alike to MSSQL. The job is...
2
35,361
thread by: Ryan | last post Jul 23 '05 by: Ryan
Is there an equivalent function in SQL to the 'NETWORKDAYS(start_date,end_date,holidays)' function in Excel ? NetworkDays in Excel returns the number of whole working days between start_date and end_date. Working days exclude weekends and any dates identified in holidays. This part isn't vital but would be nice to have. The weekend stuff is...
3
35,348
thread by: Jack Turnbull | last post Aug 31 '06 by: Erland Sommarskog
Hi, Am new to Stored Procedures and am lost how to achieve the following. I have this table:- CREATE TABLE . ( IDENTITY (1, 1) NOT NULL , NULL , (50) COLLATE Latin1_General_CI_AS NULL , (100) COLLATE Latin1_General_CI_AS NULL ) ON
5
35,222
thread by: ciojr | last post Jun 27 '08 by: Gert-Jan Strik
how do i write sql statment to find records with name greater than 17 characters.
7
35,051
thread by: Jim Geissman | last post Jul 20 '05 by: Jim Geissman
Take a table, where not all the columns are populated: CREATE TABLE #T (A int, B int, C int, D int) INSERT #T (A,B) VALUES (1,2) INSERT #T (A,B) VALUES (3,4) INSERT #T (A,B) VALUES (5,6) INSERT #T (A,B) VALUES (7,8) INSERT #T (A,B) VALUES (9,10) The values for C and D can be computed as functions of A and B. For this
3
34,894
thread by: Leader | last post Jul 20 '05 by: Random
Hi All, I am facing a problem with a sql what i used in MS Access but its not returning the same result in MS Sql Server 2000. Here i am giving the sql: SELECT TOP 3 format( MY_DATE, "dddd mm, yyyy" ) FROM MY_TAB WHERE MY_ID=1 The above sql in ACCESS return me the date in below format in one column:
2
34,875
thread by: vishwa Ram | last post Oct 18 '10 by: ser mer
Hi all, I want sql query to rename a tablename from 'tbl1' to 'table1' globally. My DB tables tbl1,2,3...... Going to Rename table1,2,3.....
4
34,699
thread by: MikeG | last post May 4 '06 by: MikeG
Hi there, I am using SQL Server 2000 and have users that would like to insert and / or update an existing table using Excel as Excel is a tool they understand. Does anyone have an idea how to do that? If you think Access would be easier, I'm sure I could get my users to turned on to that instead. Any help is greatly appreciated. (;>)
2
34,468
thread by: Philippa | last post Jul 20 '05 by: Philippa
Is there a conversion for a date field in SQL to show the day of the week that day is ? I've looked in help with no luck. I know in excel for example you can create custom format for a date to 'dddd' and it displays the Monday, Tuesday etc... Even it the Day number was returned i.e if Monday = 1 then 1, 2, 3, 4, 5, 6, 7 instead of day...
2
34,308
thread by: dougancil | last post Nov 8 '10 by: dougancil
I'm trying to sum a column as well as round a column up to the nearest minute. Here's 2 queries I'm running, but I'd like to combine them in to one. Can anyone offer any suggestions: Query 1 select name, employeenumber, sum (ontime) as totalminutes into scratchpad2 from scratchpad1 where date between '5/1/2010' and '5/15/2010' group by...
9
34,130
thread by: Water Cooler v2 | last post Jan 30 '06 by: Alexander Kuznetsov
There are two datatypes for storing binary data type in the SQL Server: 1. binary - for fixed length binary data 2. varbinary - for variable length data My question is: how is data inserted into them? Do they have any delimiters that go into the insert statement like strings and datetimes have? What format (hex/decimal?) do they accept...
2
34,099
thread by: MarekD | last post Jul 23 '05 by: louis
Hi. I'm new in SqlServer programing. Is it possible to do something like this ( It is common construction in oracle ) Select X from( select a+1 as X from tab1 ) without creating view containig subquery ?
2
34,094
thread by: Garimella | last post Jan 31 '07 by: almaz
I need to convert a varchar to Integer to compare if it is in the range. The problem is there might be few rows which have characters in them instead of numbers. This column either contains a number like '01','04', '15' etc or say a name. How can i achieve this? Is it possible.
6
34,038
thread by: Clay Beatty | last post Jul 20 '05 by: Clay Beatty
When you create database diagrams in Enterprise Manager, the details for constructing those diagrams is saved into the dtproperties table. This table includes an image field which contains most of the relevant infomation, in a binary format. SQL Enterprise manager offers no way to script out those diagrams, so I have created two Transact...
5
34,032
thread by: Steve | last post May 17 '07 by: Plamen Ratchev
Hi; I thought I would rephrase a question I asked in another post to more quickly get to the heart of the matter. My apologies for anyone who is offended by what appears to be a repetition. My company has two identical web sites. One copy is for our customer, and one copy is for us to test our code changes on. We developed a hard to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.