Forum Replies Created

Viewing 9 posts - 16 through 24 (of 24 total)

  • RE: Grand Total with No Sub Totals

    You could use COMPUTE(Amount) or take the

    SUM(Amount) and group by the rest of the columns specified in the SELECT Statement, to achive you result.

  • RE: Identity skipping numbers when foreign key violate

    Its better to use the INSERT statment between

    BEGIN and COMMIT/ ROLLBACK, in which case I think you will not face this kind of issue. Or Another way is, to formulate...

  • RE: T-SQL "shortcut"?

    Well Jnelson, Mr. 5409045121009 is using corelated Sub-query. Thats one way of doing it. The other way to do is,

    Select (ColA/ColB) as Sum1, ColB into #TempTab from SomeTable

    Go

    Select (Sum1/ColB) as...

  • RE: UDF Functions and Dates

    Your objective is maintain a key value, which is a combination of the Customercode, Year and running serial number. The simple way to do it is,

    Cast(@CustomerCode as varchar(n))+ cast(year(getdate())...

  • RE: Can I declare global variables?

    fromnaija is quite right. There is no Global variables concept inbult in SQL Server. However, you can have a table in the master preferably or in the same database, where...

  • RE: Remove Leading Zeros

    Sorry, forgot to mention, while using the CONVERT of CAST in your UPDATE statement for that Column, you should CONVERT the Column to INT.

  • RE: Remove Leading Zeros

    write an UPDATE statement, and us CONVERT or CAST and convert the datatype of that Column in the UPDATE statement, then the leading zeros will be removed.

  • RE: Backup before or after shrinking (or both)?

    use DBCC SHRINKFILE with TRUNCATEONLY option,

    what it does is it shrinks the files to the extent possible or to the actual size of the data available and then frees the...

  • RE: Insert SQL statement into a table

    Yes, I do agree with the gentleman, who said it was not a problem if u could pass the query thru front end, the sql compiler would treat as a...

Viewing 9 posts - 16 through 24 (of 24 total)